gecko/netwerk/protocol/http
Patrick McManus dd0c0a9a27 Bug 613977 - Intermittent invalid certificate error prompt (partial) r=honzab a=blocking-beta9
Bug 614677 - Connection is reset message appears intermittently
Bug 614950 - Connections stall occasionally after 592284 landed

A couple of follow-on changes to 592284 rolled together to prevent
diff conflicts

1] Set the securitycallback information for unused speculative
connections in the connection manager to be the new cloned connection
rather than the one they originated on. (613977)

2] When adding unused speculative connections to the connection
manager, due so with a short timeout (<= 5 seconds) as some servers
get grumpy if they haven't seen a request in that time. Most will
close the connection, but some will just sit there quietly and RST
things when the connection is used - so if you don't use the
connection quickly don't use it at all. This is probably a L4 load
balancer issue, actually. Mozillazine illustrates the
problem. Connections are made in bursts anyhow, so the reuse optimization is
likely still quite useful. (614677 and 614950)

3] mark every connection in the connection manager persistent
conneciton pool as "reused". This allows the transaction to be
restarted if a RST is recvd upon sending the requests (see #2) - with
the conservative timeout this is now a rare event, but still possible
so recovery is the right thing to do. (614677 and 614950)

4] obtain an nshttpconnection object from the connection manager,
subject to the max connection constraints, at the same time as
starting the backup conneciton. If we defer that until recycling time
the exceeded limits of the SocketService can cause problems for other
connections.

also re-enables the syn retry feature by default.

r+ honzab
2010-12-16 08:50:36 -05:00
..
HttpBaseChannel.cpp Fix non-IPC bustage from bug 536289. Patch as agreed with jdm over irc. a=bustage-fix. 2010-10-21 22:01:38 +01:00
HttpBaseChannel.h Fix non-IPC bustage from bug 536289. Patch as agreed with jdm over irc. a=bustage-fix. 2010-10-21 22:01:38 +01:00
HttpChannelChild.cpp Bug 591707 - e10s: handle redirects from HTTP to a different protocol, r=jduell, a=blocking-fennec2.0b3+ 2010-11-23 23:56:06 +01:00
HttpChannelChild.h Bug 591707 - e10s: handle redirects from HTTP to a different protocol, r=jduell, a=blocking-fennec2.0b3+ 2010-11-23 23:56:06 +01:00
HttpChannelParent.cpp Bug 591707 - e10s: handle redirects from HTTP to a different protocol, r=jduell, a=blocking-fennec2.0b3+ 2010-11-23 23:56:06 +01:00
HttpChannelParent.h Bug 591707 - e10s: handle redirects from HTTP to a different protocol, r=jduell, a=blocking-fennec2.0b3+ 2010-11-23 23:56:06 +01:00
HttpChannelParentListener.cpp Bug 591707 - e10s: handle redirects from HTTP to a different protocol, r=jduell, a=blocking-fennec2.0b3+ 2010-11-23 23:56:06 +01:00
HttpChannelParentListener.h Bug 591707 - e10s: handle redirects from HTTP to a different protocol, r=jduell, a=blocking-fennec2.0b3+ 2010-11-23 23:56:06 +01:00
ipdl.mk Fixup to http after the necko-file-move 2010-06-07 14:40:08 -07:00
Makefile.in Bug 591707 - e10s: handle redirects from HTTP to a different protocol, r=jduell, a=blocking-fennec2.0b3+ 2010-11-23 23:56:06 +01:00
nsAHttpConnection.h Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsAHttpTransaction.h Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttp.cpp Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttp.h Fixup to http after the necko-file-move 2010-06-07 14:40:08 -07:00
nsHttpActivityDistributor.cpp Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpActivityDistributor.h Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpAtomList.h Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpAuthCache.cpp Bug 558624 - e10s Cookies: Optimize implementation. Part 1. Clean up warning in http. r=dwitte. a=blocking-fennec 2010-10-01 15:18:55 -07:00
nsHttpAuthCache.h Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpAuthManager.cpp Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpAuthManager.h Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpBasicAuth.cpp Bug 472529, websockets (netwerk patch), r=smaug+biesi 2010-06-17 21:33:42 +03:00
nsHttpBasicAuth.h Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpChannel.cpp Backed out changeset dd249f45dc3d 2010-11-29 15:34:30 -08:00
nsHttpChannel.h Backed out changeset dd249f45dc3d 2010-11-29 15:34:30 -08:00
nsHttpChannelAuthProvider.cpp Bug 472529, websockets (netwerk patch), r=smaug+biesi 2010-06-17 21:33:42 +03:00
nsHttpChannelAuthProvider.h Merge from m-c. 2010-06-22 17:33:57 -07:00
nsHttpChunkedDecoder.cpp Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpChunkedDecoder.h Merging with M-C. 2010-06-07 13:38:02 -07:00
nsHttpConnection.cpp Bug 613977 - Intermittent invalid certificate error prompt (partial) r=honzab a=blocking-beta9 2010-12-16 08:50:36 -05:00
nsHttpConnection.h Bug 613977 - Intermittent invalid certificate error prompt (partial) r=honzab a=blocking-beta9 2010-12-16 08:50:36 -05:00
nsHttpConnectionInfo.cpp Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpConnectionInfo.h bug 363109 - body of HTTP 304 response is treated as a HTTP/0.9 response to subsequent HTTP request. r=biesi, sr=bz, a=blocker 2010-12-01 02:02:52 +02:00
nsHttpConnectionMgr.cpp Bug 613977 - Intermittent invalid certificate error prompt (partial) r=honzab a=blocking-beta9 2010-12-16 08:50:36 -05:00
nsHttpConnectionMgr.h Bug 613977 - Intermittent invalid certificate error prompt (partial) r=honzab a=blocking-beta9 2010-12-16 08:50:36 -05:00
nsHttpDigestAuth.cpp Bug 472529, websockets (netwerk patch), r=smaug+biesi 2010-06-17 21:33:42 +03:00
nsHttpDigestAuth.h Bug 472529, websockets (netwerk patch), r=smaug+biesi 2010-06-17 21:33:42 +03:00
nsHttpHandler.cpp Bug 614229 - nsHttpHandler getting the private-browsing service can cause recursive initialization of layout, and I suspect can cause incorrect behavior in Firefox because we may end up creating HTTP URIs before we're finished with XPCOM registration, r=honza+ehsan a=blocking bug 581335 which blocks Fennec b3 2010-11-24 08:58:42 -05:00
nsHttpHandler.h Bug 614229 - nsHttpHandler getting the private-browsing service can cause recursive initialization of layout, and I suspect can cause incorrect behavior in Firefox because we may end up creating HTTP URIs before we're finished with XPCOM registration, r=honza+ehsan a=blocking bug 581335 which blocks Fennec b3 2010-11-24 08:58:42 -05:00
nsHttpHeaderArray.cpp Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpHeaderArray.h Merging with M-C. 2010-06-07 13:38:02 -07:00
nsHttpNTLMAuth.cpp Bug 472529, websockets (netwerk patch), r=smaug+biesi 2010-06-17 21:33:42 +03:00
nsHttpNTLMAuth.h Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpPipeline.cpp Bug 616591 followup to fix a comment., a=DONTBUILD 2010-12-08 21:01:17 -05:00
nsHttpPipeline.h Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpRequestHead.cpp Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpRequestHead.h Merging with M-C. 2010-06-07 13:38:02 -07:00
nsHttpResponseHead.cpp Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsHttpResponseHead.h Merging with M-C. 2010-06-07 13:38:02 -07:00
nsHttpTransaction.cpp Bug 616591 - Firefox 4.0b8pre crash in [@ nsHttpPipeline::GetConnectionInfo(nsHttpConnectionInfo**]; r=bzbarsky a=blocking-beta8+ 2010-12-04 04:21:03 -05:00
nsHttpTransaction.h bug 363109 - body of HTTP 304 response is treated as a HTTP/0.9 response to subsequent HTTP request. r=biesi, sr=bz, a=blocker 2010-12-01 02:02:52 +02:00
nsIHttpActivityObserver.idl Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsIHttpAuthenticableChannel.idl Bug 472529, websockets (netwerk patch), r=smaug+biesi 2010-06-17 21:33:42 +03:00
nsIHttpAuthenticator.idl Bug 472529, websockets (netwerk patch), r=smaug+biesi 2010-06-17 21:33:42 +03:00
nsIHttpAuthManager.idl Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsIHttpChannel.idl Remove @status FROZEN and @status UNDER_REVIEW. r=bsmedberg 2010-07-02 10:27:06 -04:00
nsIHttpChannelAuthProvider.idl Bug 472529, websockets (netwerk patch), r=smaug+biesi 2010-06-17 21:33:42 +03:00
nsIHttpChannelChild.idl Bug 591707 - e10s: handle redirects from HTTP to a different protocol, r=jduell, a=blocking-fennec2.0b3+ 2010-11-23 23:56:06 +01:00
nsIHttpChannelInternal.idl Bug 558624 - e10s Cookies: Optimize implementation. Part 5. Mop up mRemoteChannel and its uses. r=dwitte. a=blocking-fennec 2010-10-01 21:17:27 -07:00
nsIHttpEventSink.idl Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00
nsIHttpHeaderVisitor.idl Remove @status FROZEN and @status UNDER_REVIEW. r=bsmedberg 2010-07-02 10:27:06 -04:00
nsIHttpProtocolHandler.idl Bug 591573 - remove support for general.useragent.vendor & vendorSub. r=dwitte sr=dveditz a=jst 2010-10-15 11:11:19 +02:00
PHttpChannel.ipdl Bug 591707 - e10s: handle redirects from HTTP to a different protocol, r=jduell, a=blocking-fennec2.0b3+ 2010-11-23 23:56:06 +01:00
PHttpChannelParams.h Bug 536289 - Part 1: Move IPC::InputStream to a more general location. r=jduell a=blocking-fennec 2010-10-14 14:21:48 -04:00
README Bug 542222 - Reduce recursion in netwerk makefiles. 2010-06-05 21:18:12 -04:00

                                                        Darin Fisher
                                                        darin@netscape.com
                                                        8/8/2001

                            HTTP DESIGN NOTES


CLASS BREAKDOWN

  nsHttpHandler
    - implements nsIProtocolHandler
    - manages preferences
    - owns the authentication cache
    - holds references to frequently used services

  nsHttpChannel
    - implements nsIHttpChannel
    - talks to the cache
    - initiates http transactions
    - processes http response codes
    - intercepts progress notifications
  
  nsHttpConnection
    - implements nsIStreamListener & nsIStreamProvider
    - talks to the socket transport service
    - feeds data to its transaction object
    - routes progress notifications

  nsHttpConnectionInfo
    - identifies a connection

  nsHttpTransaction
    - implements nsIRequest
    - encapsulates a http request and response
    - parses incoming data

  nsHttpChunkedDecoder
    - owned by a transaction
    - removes chunked decoding
  
  nsHttpRequestHead
    - owns a nsHttpHeaderArray
    - knows how to fill a request buffer

  nsHttpResponseHead
    - owns a nsHttpHeaderArray
    - knows how to parse response lines
    - performs common header manipulations/calculations

  nsHttpHeaderArray
    - stores http "<header>:<value>" pairs

  nsHttpAuthCache
    - stores authentication credentials for http auth domains

  nsHttpBasicAuth
    - implements nsIHttpAuthenticator
    - generates BASIC auth credentials from user:pass


ATOMS

  nsHttp:: (header namespace)

  eg. nsHttp::Content_Length


TRANSACTION MODEL

  InitiateTransaction -> ActivateConnection -> AsyncWrite, AsyncRead

  The channel creates transactions, and passes them to the handler via
  InitiateTransaction along with a nsHttpConnectionInfo object 
  identifying the requested connection.  The handler either dispatches
  the transaction immediately or queues it up to be dispatched later,
  depending on whether or not the limit on the number of connections
  to the requested server has been reached.  Once the transaction can
  be run, the handler looks for an idle connection or creates a new
  connection, and then (re)activates the connection, assigning it the
  new transaction.

  Once activated the connection ensures that it has a socket transport,
  and then calls AsyncWrite and AsyncRead on the socket transport.  This
  begins the process of talking to the server.  To minimize buffering,
  socket transport thread-proxying is completely disabled (using the flags
  DONT_PROXY_LISTENER | DONT_PROXY_PROVIDER | DONT_PROXY_OBSERVER with
  both AsyncWrite and AsyncRead).  This means that the nsHttpConnection's
  OnStartRequest, OnDataAvailable, OnDataWritable, and OnStopRequest
  methods will execute on the socket transport thread.

  The transaction defines (non-virtual) OnDataReadable, OnDataWritable, and
  OnStopTransaction methods, which the connection calls in response to
  its OnDataAvailable, OnDataWritable, and OnStopRequest methods, respectively.
  The transaction owns a nsStreamListenerProxy created by the channel, which
  it uses to transfer data from the socket thread over to the client's thread.
  To mimize buffering, the transaction implements nsIInputStream, and passes
  itself to the stream listener proxy's OnDataAvailable.  In this way, we
  have effectively wedged the response parsing between the socket and the
  thread proxy's buffer.  When read, the transaction turns around and reads
  from the socket using the buffer passed to it.  The transaction scans the
  buffer for headers, removes them as they are detected, and copies the headers
  into its nsHttpResponseHead object.  The rest of the data remains in the
  buffer, and is proxied over to the client's thread to be handled first by the
  http channel and eventually by the client.

  There are several other major design factors, including:

    - transaction cancelation
    - progress notification
    - SSL tunneling
    - chunked decoding
    - thread safety
    - premature EOF detection and transaction restarting
    - pipelining (not yet implemented)


CACHING

<EOF>