Re: Soup Connection Management for SPDY in libsoup



On 02/25/2013 10:12 AM, ANUJ MISHRA wrote:
I want some of your suggestion regarding multiple stream handling in
libsoup. I can see that libsoup is tradition client server based library
and maintaining state for everything. But for SPDY we need to keep only
one connection and deal with streams. Where multiple streams would
arrive through single connection and we will do de-muxing of it and
provide it to application layer. Libsoup's connection, session, message
objects are tightly coupled with request/response mechanism.

I was assuming that SoupMessage itself would be unchanged.

SoupSession would want to keep track in SoupSessionHost whether a host
supported SPDY or not (the same way it tracks ssl_fallback now).
SoupConnection would become a superclass, with SoupHTTPConnection and
SoupSPDYConnection subclasses. I can see two possibilities for how
SoupSPDYConnection would work:

    1. a SPDY SoupSessionHost would have only a single
       SoupSPDYConnection, which internally would multiplex into
       multiple GIOStreams

    2. a SPDY SoupSessionHost would have a single
       "SoupSPDYMasterConnection" from which you could create multiple
       SoupSPDYConnections each representing a stream within the single
       connection

Not sure which would be cleaner/easier. Other than this change to
host/connection management, I don't think you should need to make any
changes to SoupSession.

Some of the code in soup-message-io would make sense to share between
HTTP and SPDY, but some would not. I'm not sure what the best way to
reorganize this would be. At a high level though, the idea is that
eventually, whether you're using HTTP or SPDY, you'd end up with an
io->body_istream that could be read to get the response body, so the
parts of soup-message-io that deal with that would not need to be
changed (and, eg, soup_message_io_run_until_read() and
soup_message_io_get_response_istream() would both work exactly the same
way they do now, from SoupSession's perspective.)

-- Dan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]