testing/xpcshell/node-http2/node_modules/http2-protocol/lib/index.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 // [node-http2-protocol][homepage] is an implementation of the [HTTP/2 (draft 10)][http2]
michael@0 2 // framing layer for [node.js][node].
michael@0 3 //
michael@0 4 // The main building blocks are [node.js streams][node-stream] that are connected through pipes.
michael@0 5 //
michael@0 6 // The main components are:
michael@0 7 //
michael@0 8 // * [Endpoint](endpoint.html): represents an HTTP/2 endpoint (client or server). It's
michael@0 9 // responsible for the the first part of the handshake process (sending/receiving the
michael@0 10 // [connection header][http2-connheader]) and manages other components (framer, compressor,
michael@0 11 // connection, streams) that make up a client or server.
michael@0 12 //
michael@0 13 // * [Connection](connection.html): multiplexes the active HTTP/2 streams, manages connection
michael@0 14 // lifecycle and settings, and responsible for enforcing the connection level limits (flow
michael@0 15 // control, initiated stream limit)
michael@0 16 //
michael@0 17 // * [Stream](stream.html): implementation of the [HTTP/2 stream concept](http2-stream).
michael@0 18 // Implements the [stream state machine][http2-streamstate] defined by the standard, provides
michael@0 19 // management methods and events for using the stream (sending/receiving headers, data, etc.),
michael@0 20 // and enforces stream level constraints (flow control, sending only legal frames).
michael@0 21 //
michael@0 22 // * [Flow](flow.html): implements flow control for Connection and Stream as parent class.
michael@0 23 //
michael@0 24 // * [Compressor and Decompressor](compressor.html): compression and decompression of HEADER and
michael@0 25 // PUSH_PROMISE frames
michael@0 26 //
michael@0 27 // * [Serializer and Deserializer](framer.html): the lowest layer in the stack that transforms
michael@0 28 // between the binary and the JavaScript object representation of HTTP/2 frames
michael@0 29 //
michael@0 30 // [homepage]: https://github.com/molnarg/node-http2
michael@0 31 // [http2]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-10
michael@0 32 // [http2-connheader]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-10#section-3.5
michael@0 33 // [http2-stream]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-10#section-5
michael@0 34 // [http2-streamstate]: http://tools.ietf.org/html/draft-ietf-httpbis-http2-10#section-5.1
michael@0 35 // [node]: http://nodejs.org/
michael@0 36 // [node-stream]: http://nodejs.org/api/stream.html
michael@0 37 // [node-https]: http://nodejs.org/api/https.html
michael@0 38 // [node-http]: http://nodejs.org/api/http.html
michael@0 39
michael@0 40 exports.ImplementedVersion = 'h2-10';
michael@0 41
michael@0 42 exports.Endpoint = require('./endpoint').Endpoint;
michael@0 43
michael@0 44 /* Bunyan serializers exported by submodules that are worth adding when creating a logger. */
michael@0 45 exports.serializers = {};
michael@0 46 var modules = ['./framer', './compressor', './flow', './connection', './stream', './endpoint'];
michael@0 47 modules.map(require).forEach(function(module) {
michael@0 48 for (var name in module.serializers) {
michael@0 49 exports.serializers[name] = module.serializers[name];
michael@0 50 }
michael@0 51 });
michael@0 52
michael@0 53 /*
michael@0 54 Stream API Endpoint API
michael@0 55 Stream data
michael@0 56
michael@0 57 | ^ | ^
michael@0 58 | | | |
michael@0 59 | | | |
michael@0 60 +-----------|------------|---------------------------------------+
michael@0 61 | | | Endpoint |
michael@0 62 | | | |
michael@0 63 | +-------|------------|-----------------------------------+ |
michael@0 64 | | | | Connection | |
michael@0 65 | | v | | |
michael@0 66 | | +-----------------------+ +-------------------- | |
michael@0 67 | | | Stream | | Stream ... | |
michael@0 68 | | +-----------------------+ +-------------------- | |
michael@0 69 | | | ^ | ^ | |
michael@0 70 | | v | v | | |
michael@0 71 | | +------------+--+--------+--+------------+- ... | |
michael@0 72 | | | ^ | |
michael@0 73 | | | | | |
michael@0 74 | +-----------------------|--------|-----------------------+ |
michael@0 75 | | | |
michael@0 76 | v | |
michael@0 77 | +--------------------------+ +--------------------------+ |
michael@0 78 | | Compressor | | Decompressor | |
michael@0 79 | +--------------------------+ +--------------------------+ |
michael@0 80 | | ^ |
michael@0 81 | v | |
michael@0 82 | +--------------------------+ +--------------------------+ |
michael@0 83 | | Serializer | | Deserializer | |
michael@0 84 | +--------------------------+ +--------------------------+ |
michael@0 85 | | ^ |
michael@0 86 +---------------------------|--------|---------------------------+
michael@0 87 | |
michael@0 88 v |
michael@0 89
michael@0 90 Raw data
michael@0 91
michael@0 92 */

mercurial