gecko-dev/netwerk/protocol/http/src
darin%meer.net d469418257 fixes bug 334439 "nsHttpConnectionMgr::MAX_CONNECTIONS set to mMaxRequestDelay; should be mMaxConnections" patch by dave.puchyr@avaritia.com, r=biesi, sr=darin 2006-04-18 14:24:09 +00:00
..
.cvsignore
Makefile.in Initial patch for bug 312760 "Provide base channel for use by protocol implementations" r=biesi sr=bzbarsky 2005-11-12 18:17:19 +00:00
README
nsAHttpConnection.h landing framework changes to support NTLM authentication b=159015 r=dougt,cathleen sr=alecf 2003-03-26 05:05:49 +00:00
nsAHttpTransaction.h bug 264599 make unfrozen necko interfaces use 64-bit integers. 2005-01-09 20:43:35 +00:00
nsHttp.cpp fixes bug 329746, r=biesi sr=bz 2006-04-07 17:45:44 +00:00
nsHttp.h fixes bug 329746, r=biesi sr=bz 2006-04-07 17:45:44 +00:00
nsHttpAtomList.h some webdav plumbing and light tidying; bug 212342; r=darin,sr=bzbarsky 2004-10-15 05:59:21 +00:00
nsHttpAuthCache.cpp bug 272277: Change to Append/Assign/Equals-Literal in networking 2004-12-04 10:19:29 +00:00
nsHttpAuthCache.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsHttpAuthManager.cpp Bug 296456: Fix license headers on some HTTP source files; r=darin,sr=dveditz, a=asa 2005-06-11 13:12:55 +00:00
nsHttpAuthManager.h Bug 296456: Fix license headers on some HTTP source files; r=darin,sr=dveditz, a=asa 2005-06-11 13:12:55 +00:00
nsHttpBasicAuth.cpp bug 85310 remove *WithConversion from necko r+sr=darin 2004-07-21 12:25:20 +00:00
nsHttpBasicAuth.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsHttpChannel.cpp fixes bug 329746, r=biesi sr=bz 2006-04-07 17:45:44 +00:00
nsHttpChannel.h fixes bug 330397 "Additional problems with incomplete cache entries and cache flush assertions." r=biesi sr=bzbarsky 2006-03-30 21:06:54 +00:00
nsHttpChunkedDecoder.cpp Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsHttpChunkedDecoder.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsHttpConnection.cpp fixing bustage 2006-01-02 03:20:04 +00:00
nsHttpConnection.h 286790 remove unused variable 2005-03-20 13:22:05 +00:00
nsHttpConnectionInfo.cpp Bug 296456: Fix license headers on some HTTP source files; r=darin,sr=dveditz, a=asa 2005-06-11 13:12:55 +00:00
nsHttpConnectionInfo.h landing patch for bug 282442 "Provide interface for configuring proxies" r=biesi sr=bzbarsky 2005-03-25 03:41:33 +00:00
nsHttpConnectionMgr.cpp Bug 308573 use if (NS_FAILED(...)) instead of if NS_FAILED(...) 2005-09-15 23:17:17 +00:00
nsHttpConnectionMgr.h fixes bug 325808 "HTTP code could use a HasToken function" r=biesi, sr=bzbarsky 2006-02-17 22:52:40 +00:00
nsHttpDigestAuth.cpp bug 183156 remove *UCS2* functions, replacing them with *UTF16* ones 2006-02-03 14:18:39 +00:00
nsHttpDigestAuth.h fixes bug 308405 "'@mozilla.org/security/hash;1' incorrectly invoked as a service in nsHttpDigestAuth.cpp" r=dougt 2005-09-15 00:25:21 +00:00
nsHttpHandler.cpp fixes bug 334439 "nsHttpConnectionMgr::MAX_CONNECTIONS set to mMaxRequestDelay; should be mMaxConnections" patch by dave.puchyr@avaritia.com, r=biesi, sr=darin 2006-04-18 14:24:09 +00:00
nsHttpHandler.h Bug 315598 Allow more than one global redirect observer, using the 2006-02-22 14:07:21 +00:00
nsHttpHeaderArray.cpp fixes bug 329746, r=biesi sr=bz 2006-04-07 17:45:44 +00:00
nsHttpHeaderArray.h fixes bug 325808 "HTTP code could use a HasToken function" r=biesi, sr=bzbarsky 2006-02-17 22:52:40 +00:00
nsHttpNTLMAuth.cpp increased logging for NTLM authentication to help track down cause of bug 283331 2005-03-25 22:25:32 +00:00
nsHttpNTLMAuth.h fixes bug 224653 "provide cross-platform NTLM auth implementation" r=kaie sr=bryner 2003-11-18 02:20:34 +00:00
nsHttpPipeline.cpp bug 264599 make unfrozen necko interfaces use 64-bit integers. 2005-01-09 20:43:35 +00:00
nsHttpPipeline.h Bug 236613: change to MPL/LGPL/GPL tri-license. 2004-04-18 22:01:16 +00:00
nsHttpRequestHead.cpp bug 272277: Change to Append/Assign/Equals-Literal in networking 2004-12-04 10:19:29 +00:00
nsHttpRequestHead.h fixes bug 325808 "HTTP code could use a HasToken function" r=biesi, sr=bzbarsky 2006-02-17 22:52:40 +00:00
nsHttpResponseHead.cpp fixes bug 328817, r=biesi sr=bz 2006-04-07 17:44:32 +00:00
nsHttpResponseHead.h fixes bug 328817, r=biesi sr=bz 2006-04-07 17:44:32 +00:00
nsHttpTransaction.cpp fixes bug 330214 "Ignore Transfer-Encoding header sent with HTTP/1.0 response" r=biesi sr=bzbarsky 2006-04-05 02:09:41 +00:00
nsHttpTransaction.h fixes bug 142255 "RFE provide a way to prioritize connections" r=bz 2005-01-15 07:01:20 +00:00

README

                                                        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>