pjs/netwerk/protocol/http/src
darin%meer.net d37ee0a0e8 fixes bug 318006, r=biesi, sr=dveditz 2006-07-20 00:57:38 +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
nsAHttpTransaction.h
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
nsHttpAuthCache.cpp
nsHttpAuthCache.h
nsHttpAuthManager.cpp
nsHttpAuthManager.h
nsHttpBasicAuth.cpp
nsHttpBasicAuth.h
nsHttpChannel.cpp fixes bug 318006, r=biesi, sr=dveditz 2006-07-20 00:57:38 +00:00
nsHttpChannel.h fixes bug 331825 "Unable to do conditional gets via XMLHttpRequest with 1.5.0.1, works in 1.0.7" r=biesi sr=bzbarsky 2006-06-23 00:49:40 +00:00
nsHttpChunkedDecoder.cpp
nsHttpChunkedDecoder.h
nsHttpConnection.cpp landing patch for bug 326273 "Implement nsIThreadManager" (Mac portions by Mark Mentovai) with reviews from bienvenu, bsmedberg, bzbarsky, josh, roc, and ssieb 2006-05-10 17:30:15 +00:00
nsHttpConnection.h landing patch for bug 326273 "Implement nsIThreadManager" (Mac portions by Mark Mentovai) with reviews from bienvenu, bsmedberg, bzbarsky, josh, roc, and ssieb 2006-05-10 17:30:15 +00:00
nsHttpConnectionInfo.cpp
nsHttpConnectionInfo.h
nsHttpConnectionMgr.cpp landing patch for bug 326273 "Implement nsIThreadManager" (Mac portions by Mark Mentovai) with reviews from bienvenu, bsmedberg, bzbarsky, josh, roc, and ssieb 2006-05-10 17:30:15 +00:00
nsHttpConnectionMgr.h fixes bug 337752 "gcc 3.2.2 generates bad code for nsRunnableMethod<T>" r=bsmedberg 2006-05-12 20:18:13 +00:00
nsHttpDigestAuth.cpp bug 183156 remove *UCS2* functions, replacing them with *UTF16* ones 2006-02-03 14:18:39 +00:00
nsHttpDigestAuth.h
nsHttpHandler.cpp #326273 2006-05-11 17:22:54 +00:00
nsHttpHandler.h landing patch for bug 326273 "Implement nsIThreadManager" (Mac portions by Mark Mentovai) with reviews from bienvenu, bsmedberg, bzbarsky, josh, roc, and ssieb 2006-05-10 17:30:15 +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 Bug 326528: fix out-of-bound error in pref reading code, r+sr=darin 2006-06-26 00:05:15 +00:00
nsHttpNTLMAuth.h
nsHttpPipeline.cpp
nsHttpPipeline.h
nsHttpRequestHead.cpp
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 323708 "Recalculation of ComputeFreshnessLife wrong after performing If-Modified-Since / If-None-Match request" patch by mozilla@com.jkkn.dk r=biesi sr=darin 2006-06-27 23:49:31 +00:00
nsHttpResponseHead.h fixes bug 328817, r=biesi sr=bz 2006-04-07 17:44:32 +00:00
nsHttpTransaction.cpp fixing bug 334142 "Firefox 1.5.0.2 doesn't work with some online banking systems" r+sr=bzbarsky 2006-06-22 21:53:06 +00:00
nsHttpTransaction.h fixes bug 308371 "Add additional instrumentation to Http protocol" patch by LeRoy Krueger (leroyk@attglobal.net), r+sr=darin 2006-05-19 22:50:02 +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>