gecko-dev/netwerk/protocol/http
Henri Sivonen 57d5f3ee13 Bug 1484984 - Avoid writing past the logical length of a string in networking code. r=valentin
MozReview-Commit-ID: IIffoxnF6KS

Differential Revision: https://phabricator.services.mozilla.com/D3884

--HG--
extra : moz-landing-system : lando
2018-08-21 14:20:48 +00:00
..
ASpdySession.cpp Bug 1460310 - Separate HTTP and SPDY identifiers into separate namespaces. r=dragana 2018-06-01 11:32:05 -07:00
ASpdySession.h Bug 1460310 - Separate HTTP and SPDY identifiers into separate namespaces. r=dragana 2018-06-01 11:32:05 -07:00
AltDataOutputStreamChild.cpp Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj 2018-04-28 12:50:58 -07:00
AltDataOutputStreamChild.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
AltDataOutputStreamParent.cpp
AltDataOutputStreamParent.h
AlternateServices.cpp Bug 1475647 - Remove nsISSLStatusProvider interface. r=baku,Gijs,jchen,jryans,keeler,mcmanus 2018-07-13 11:48:55 -07:00
AlternateServices.h Bug 1463509 - SOCKS support for Alternative Services r=valentin 2018-05-22 13:50:56 -04:00
BackgroundChannelRegistrar.cpp
BackgroundChannelRegistrar.h
CacheControlParser.cpp
CacheControlParser.h
ConnectionDiagnostics.cpp Bug 1460310 - Separate HTTP and SPDY identifiers into separate namespaces. r=dragana 2018-06-01 11:32:05 -07:00
Http2Compression.cpp Bug 1484984 - Avoid writing past the logical length of a string in networking code. r=valentin 2018-08-21 14:20:48 +00:00
Http2Compression.h Bug 1453795 - Necko - Initialize member fields in classes/ structures. r=michal 2018-06-14 11:19:07 +03:00
Http2HuffmanIncoming.h
Http2HuffmanOutgoing.h
Http2Push.cpp
Http2Push.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
Http2Session.cpp Backed out changeset 89117b6b5799 (bug 1470853) for xpcshell failures on dom/push/test/xpcshell/test_notification_http2.js. CLOSED TREE 2018-08-20 19:20:20 +03:00
Http2Session.h Backed out changeset 89117b6b5799 (bug 1470853) for xpcshell failures on dom/push/test/xpcshell/test_notification_http2.js. CLOSED TREE 2018-08-20 19:20:20 +03:00
Http2Stream.cpp Bug 1468583 - Explicitly tie h2stream to transaction in logs for logan. r=valentin 2018-07-27 06:35:00 +00:00
Http2Stream.h Bug 1416529 r=mcmanus 2018-02-09 09:22:18 -08:00
HttpAuthUtils.cpp Bug 1410794 (attempt 2) - Change some |string| occurrences in nsIPrefBranch.idl to |ACString|. r=erahm. 2017-10-27 10:30:33 +11:00
HttpAuthUtils.h
HttpBackgroundChannelChild.cpp Bug 1482950 - Use the correct 3rdparty check in tracking annotations. r=dimi,Ehsan,mayhemer!,ehsan! 2018-08-20 23:53:45 +00:00
HttpBackgroundChannelChild.h Bug 1482950 - Use the correct 3rdparty check in tracking annotations. r=dimi,Ehsan,mayhemer!,ehsan! 2018-08-20 23:53:45 +00:00
HttpBackgroundChannelParent.cpp Bug 1482950 - Use the correct 3rdparty check in tracking annotations. r=dimi,Ehsan,mayhemer!,ehsan! 2018-08-20 23:53:45 +00:00
HttpBackgroundChannelParent.h Bug 1482950 - Use the correct 3rdparty check in tracking annotations. r=dimi,Ehsan,mayhemer!,ehsan! 2018-08-20 23:53:45 +00:00
HttpBaseChannel.cpp Bug 1484984 - Avoid writing past the logical length of a string in networking code. r=valentin 2018-08-21 14:20:48 +00:00
HttpBaseChannel.h Bug 1482950 - Use the correct 3rdparty check in tracking annotations. r=dimi,Ehsan,mayhemer!,ehsan! 2018-08-20 23:53:45 +00:00
HttpChannelChild.cpp Bug 1482950 - Use the correct 3rdparty check in tracking annotations. r=dimi,Ehsan,mayhemer!,ehsan! 2018-08-20 23:53:45 +00:00
HttpChannelChild.h Bug 1482950 - Use the correct 3rdparty check in tracking annotations. r=dimi,Ehsan,mayhemer!,ehsan! 2018-08-20 23:53:45 +00:00
HttpChannelParent.cpp Bug 1482950 - Use the correct 3rdparty check in tracking annotations. r=dimi,Ehsan,mayhemer!,ehsan! 2018-08-20 23:53:45 +00:00
HttpChannelParent.h Bug 1280629 - Part 2: telemetry of e10 back pressure suspension rate r=dragana 2018-08-15 22:36:42 +00:00
HttpChannelParentListener.cpp Bug 1463287: Add QueryInterface helper macro for concrete class types. r=bz 2018-05-21 16:33:18 -07:00
HttpChannelParentListener.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
HttpInfo.cpp
HttpInfo.h
HttpLog.h Bug 1445796 - Add logging of a calling JS script to more http channel methods. r=valentin 2018-03-16 09:28:00 -04:00
InterceptedChannel.cpp Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
InterceptedChannel.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
InterceptedHttpChannel.cpp Bug 1475073: Pass individual CORS errors as categories to web console error messages. r=baku 2018-07-20 19:57:41 +02:00
InterceptedHttpChannel.h Bug 1475073: Pass individual CORS errors as categories to web console error messages. r=baku 2018-07-20 19:57:41 +02:00
NullHttpChannel.cpp Bug 1482950 - Use the correct 3rdparty check in tracking annotations. r=dimi,Ehsan,mayhemer!,ehsan! 2018-08-20 23:53:45 +00:00
NullHttpChannel.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
NullHttpTransaction.cpp Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
NullHttpTransaction.h Bug 1436263 - Part 2: Replace `override final` virtual function specifiers with just `final`. r=froydnj 2018-02-05 22:50:00 -08:00
PAltDataOutputStream.ipdl
PHttpBackgroundChannel.ipdl Bug 1482950 - Use the correct 3rdparty check in tracking annotations. r=dimi,Ehsan,mayhemer!,ehsan! 2018-08-20 23:53:45 +00:00
PHttpChannel.ipdl Bug 1280629 - Part 1: Suspend the http channel if the child process is not able to consume on time r=dragana 2018-08-15 22:35:58 +00:00
PHttpChannelParams.h Bug 1460310 - Separate HTTP and SPDY identifiers into separate namespaces. r=dragana 2018-06-01 11:32:05 -07:00
PSpdyPush.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
README
TimingStruct.h Bug 1457323: Add network markers to Content processes, add redirects and improve markers r=mstange 2018-05-08 15:50:39 -04:00
TunnelUtils.cpp Bug 1453795 - Necko - Initialize member fields in classes/ structures. r=michal 2018-06-14 11:19:07 +03:00
TunnelUtils.h Bug 1436263 - Part 2: Replace `override final` virtual function specifiers with just `final`. r=froydnj 2018-02-05 22:50:00 -08:00
UAOverridesBootstrapper.js Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8 2018-04-22 20:55:06 -07:00
UAOverridesBootstrapper.manifest
UserAgentOverrides.jsm Bug 1440284 - change this.EXPORTED_SYMBOLS back to var EXPORTED_SYMBOLS in JS modules, r=mccr8. 2018-02-23 20:50:01 +01:00
UserAgentUpdates.jsm Bug 1464548: Part 3 - Update callers to use defineLazyGlobalGetters. r=mccr8 2018-05-25 17:02:29 -07:00
WellKnownOpportunisticUtils.js Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8 2018-04-22 20:55:06 -07:00
WellKnownOpportunisticUtils.manifest
http2_huffman_table.txt
make_incoming_tables.py
make_outgoing_tables.py
moz.build Backed out changeset 5950c9d63c3b (bug 1090497) for build bustages on several files. CLOSED TREE 2018-08-02 19:59:53 +03:00
nsAHttpConnection.h Bug 1460310 - Separate HTTP and SPDY identifiers into separate namespaces. r=dragana 2018-06-01 11:32:05 -07:00
nsAHttpTransaction.h Bug 1367861 - enable throttling for http/2. r=mayhemer 2018-01-10 13:35:02 -08:00
nsCORSListenerProxy.cpp Bug 1475073: Pass individual CORS errors as categories to web console error messages. r=baku 2018-07-20 19:57:41 +02:00
nsCORSListenerProxy.h Bug 1475073: Pass individual CORS errors as categories to web console error messages. r=baku 2018-07-20 19:57:41 +02:00
nsHttp.cpp Bug 1460310 - Separate HTTP and SPDY identifiers into separate namespaces. r=dragana 2018-06-01 11:32:05 -07:00
nsHttp.h Bug 1475420 - mark the TRR connection as DISABLE_TRR to avoid TXT deadlock r=valentin 2018-07-12 17:48:54 -04:00
nsHttpActivityDistributor.cpp Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsHttpActivityDistributor.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsHttpAtomList.h Bug 1413999 Part2: Take http trailers from chunk decoder and add serverTiming attribute in nsITimedChannel r=dragana 2018-01-03 02:04:00 +02:00
nsHttpAuthCache.cpp Bug 1442756 - Switch nsHttpAuthCache::mDB to nsClassHashtable. r=mayhemer 2018-03-02 15:04:25 -08:00
nsHttpAuthCache.h Bug 1453795 - Necko - Initialize member fields in classes/ structures. r=michal 2018-06-14 11:19:07 +03:00
nsHttpAuthManager.cpp Bug 1453795 - Necko - Initialize member fields in classes/ structures. r=michal 2018-06-14 11:19:07 +03:00
nsHttpAuthManager.h Bug 1453795 - Necko - Initialize member fields in classes/ structures. r=michal 2018-06-14 11:19:07 +03:00
nsHttpBasicAuth.cpp Bug 1402247 - Use encoding_rs for XPCOM string encoding conversions. r=Nika,erahm,froydnj. 2018-08-14 14:43:42 +03:00
nsHttpBasicAuth.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsHttpChannel.cpp bug 1483311 - add LOAD_DISABLE_TRR as a loadflag r=mcmanus 2018-08-20 22:02:04 +00:00
nsHttpChannel.h Bug 1482950 - Backed out changeset 32d94a3cc7af. r=xeonchen! 2018-08-19 09:00:44 +00:00
nsHttpChannelAuthProvider.cpp Bug 1470458 - Use correct function to copy UTF8 string, r=valentin 2018-08-07 06:00:00 +03:00
nsHttpChannelAuthProvider.h Bug 1436655 - Introduce a mechanism for VarCache prefs to be defined entirely in the binary. r=glandium 2018-03-26 09:39:40 +11:00
nsHttpChunkedDecoder.cpp Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj 2018-04-28 12:50:58 -07:00
nsHttpChunkedDecoder.h Bug 1413999 Part2: Take http trailers from chunk decoder and add serverTiming attribute in nsITimedChannel r=dragana 2018-01-03 02:04:00 +02:00
nsHttpConnection.cpp Backed out changeset 89117b6b5799 (bug 1470853) for xpcshell failures on dom/push/test/xpcshell/test_notification_http2.js. CLOSED TREE 2018-08-20 19:20:20 +03:00
nsHttpConnection.h Bug 1460310 - Separate HTTP and SPDY identifiers into separate namespaces. r=dragana 2018-06-01 11:32:05 -07:00
nsHttpConnectionInfo.cpp Backed out changeset 89117b6b5799 (bug 1470853) for xpcshell failures on dom/push/test/xpcshell/test_notification_http2.js. CLOSED TREE 2018-08-20 19:20:20 +03:00
nsHttpConnectionInfo.h Backed out changeset 89117b6b5799 (bug 1470853) for xpcshell failures on dom/push/test/xpcshell/test_notification_http2.js. CLOSED TREE 2018-08-20 19:20:20 +03:00
nsHttpConnectionMgr.cpp Bug 1475420 - mark the TRR connection as DISABLE_TRR to avoid TXT deadlock r=valentin 2018-07-12 17:48:54 -04:00
nsHttpConnectionMgr.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsHttpDigestAuth.cpp Bug 1389251 - Add esc_Spaces that may be used to force escaping of spaces r=bz,jdescottes 2018-06-18 15:06:25 +02:00
nsHttpDigestAuth.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsHttpHandler.cpp Bug 1280629 - Part 1: Suspend the http channel if the child process is not able to consume on time r=dragana 2018-08-15 22:35:58 +00:00
nsHttpHandler.h Bug 1280629 - Part 1: Suspend the http channel if the child process is not able to consume on time r=dragana 2018-08-15 22:35:58 +00:00
nsHttpHeaderArray.cpp Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsHttpHeaderArray.h
nsHttpNTLMAuth.cpp Bug 1475647 - Remove nsISSLStatusProvider interface. r=baku,Gijs,jchen,jryans,keeler,mcmanus 2018-07-13 11:48:55 -07:00
nsHttpNTLMAuth.h Bug 1453795 - Necko - Initialize member fields in classes/ structures. r=michal 2018-06-14 11:19:07 +03:00
nsHttpRequestHead.cpp Bug 1460310 - Separate HTTP and SPDY identifiers into separate namespaces. r=dragana 2018-06-01 11:32:05 -07:00
nsHttpRequestHead.h Bug 1460310 - Separate HTTP and SPDY identifiers into separate namespaces. r=dragana 2018-06-01 11:32:05 -07:00
nsHttpResponseHead.cpp Bug 1460310 - Separate HTTP and SPDY identifiers into separate namespaces. r=dragana 2018-06-01 11:32:05 -07:00
nsHttpResponseHead.h Bug 1460310 - Separate HTTP and SPDY identifiers into separate namespaces. r=dragana 2018-06-01 11:32:05 -07:00
nsHttpTransaction.cpp Bug 1453204 - Fix 425 return code for websocket. r=michal 2018-06-29 09:10:00 +03:00
nsHttpTransaction.h Bug 1460310 - Separate HTTP and SPDY identifiers into separate namespaces. r=dragana 2018-06-01 11:32:05 -07:00
nsIBackgroundChannelRegistrar.idl
nsICorsPreflightCallback.h
nsIHttpActivityObserver.idl
nsIHttpAuthManager.idl
nsIHttpAuthenticableChannel.idl
nsIHttpAuthenticator.idl
nsIHttpChannel.idl Bug 1482950 - Use the correct 3rdparty check in tracking annotations. r=dimi,Ehsan,mayhemer!,ehsan! 2018-08-20 23:53:45 +00:00
nsIHttpChannelAuthProvider.idl
nsIHttpChannelChild.idl Bug 1446933 - Remove 'using namespace mozilla::net' from BackgroundUtils.h, r=qdot 2018-05-30 21:21:17 +02:00
nsIHttpChannelInternal.idl Bug 1474280 - Part 1: Cancel timed-out trackers; r=mayhemer 2018-07-23 05:28:00 +03:00
nsIHttpHeaderVisitor.idl
nsIHttpProtocolHandler.idl
nsIRaceCacheWithNetwork.idl
nsIWellKnownOpportunisticUtils.idl
nsServerTiming.cpp Bug 1460590 part 1 - Fix our parsing of Server-Timing. r=valentin 2018-06-01 11:39:49 -07:00
nsServerTiming.h Bug 1423495 - Part6: Use threadsafe refcounting for nsServerTiming r=baku,nwgh 2018-04-24 13:04:12 +02: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>