Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Backport http2 changes from 10.x #22850

Closed
wants to merge 67 commits into from
Closed

Commits on Oct 16, 2018

  1. http2: fix ping duration calculation

    PR-URL: nodejs#19956
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    141f166 View commit details
    Browse the repository at this point in the history
  2. doc: close event does not take arguments

    Explicitly added in the docs that the close event does not expect
    any arguments when invoked.
    
    Fixes: nodejs#20018
    
    PR-URL: nodejs#20031
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    indranil authored and kjin committed Oct 16, 2018
    Copy the full SHA
    f3f4ee6 View commit details
    Browse the repository at this point in the history
  3. http2: refactor how trailers are done

    Rather than an option, introduce a method and an event...
    
    ```js
    server.on('stream', (stream) => {
      stream.respond(undefined, { waitForTrailers: true });
      stream.on('wantTrailers', () => {
        stream.sendTrailers({ abc: 'xyz'});
      });
      stream.end('hello world');
    });
    ```
    
    This is a breaking change in the API such that the prior
    `options.getTrailers` is no longer supported at all.
    Ordinarily this would be semver-major and require a
    deprecation but the http2 stuff is still experimental.
    
    PR-URL: nodejs#19959
    Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    ecc2a70 View commit details
    Browse the repository at this point in the history
  4. test: remove message from strictEqual assertions

    When an AssertionError happens, the value of headers['set-cookie']
    is not reported. That information is useful for debugging.
    Hence removed the value passed as the message in deepStrictEqual
    assertions of test/parallel/test-http2-cookies.js
    
    PR-URL: nodejs#20174
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Richard Lau <riclau@uk.ibm.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    bryancr89 authored and kjin committed Oct 16, 2018
    Copy the full SHA
    8786251 View commit details
    Browse the repository at this point in the history
  5. doc,http2: add parameters for Http2Session:connect event

    Add parameters for the callback for the Http2Session:connect event
    inline with the pattern in the rest of the documentation.
    
    Refs: nodejs/help#877 (comment)
    
    PR-URL: nodejs#20193
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    ryzokuken authored and kjin committed Oct 16, 2018
    Copy the full SHA
    b01edd2 View commit details
    Browse the repository at this point in the history
  6. test: add strictEqual method to assert

    Adds strictEqual method to assert on stream.session.alpnProtocol
    to verify expected value 'h2'. This changes 'h2' from an assertion
    error message to the value expected from stream.session.alpnProtocol.
    
    PR-URL: nodejs#20189
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: Richard Lau <riclau@uk.ibm.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    9christine authored and kjin committed Oct 16, 2018
    Copy the full SHA
    19e41a6 View commit details
    Browse the repository at this point in the history
  7. doc: add parameters for Http2Session:error event

    Add parameters for the callback for the Http2Session:error event
    inline with the pattern in the rest of the documentation.
    
    Refs: nodejs/help#877 (comment)
    
    PR-URL: nodejs#20206
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    ryzokuken authored and kjin committed Oct 16, 2018
    Copy the full SHA
    ac14fec View commit details
    Browse the repository at this point in the history
  8. doc: improve docs for Http2Session:frameError

    Improve documentation regarding the callback parameters for the
    frameError event for instances of Http2Session, making it inline with
    the currently accepted structure, like the rest of the documentation.
    
    Refs: nodejs/help#877 (comment)
    
    PR-URL: nodejs#20236
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    ryzokuken authored and kjin committed Oct 16, 2018
    Copy the full SHA
    110ac58 View commit details
    Browse the repository at this point in the history
  9. http: added aborted property to request

    PR-URL: nodejs#20094
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    ronag authored and kjin committed Oct 16, 2018
    Copy the full SHA
    df3e6d9 View commit details
    Browse the repository at this point in the history
  10. test: removed assert.strictEqual message

    PR-URL: nodejs#20223
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    kailashyogeshwar85 authored and kjin committed Oct 16, 2018
    Copy the full SHA
    4fbd216 View commit details
    Browse the repository at this point in the history
  11. doc: improve parameters for Http2Session:goaway event

    Improve parameters for the callback for the Http2Session:connect event
    inline with the pattern in the rest of the documentation.
    
    Refs: nodejs/help#877 (comment)
    ryzokuken authored and kjin committed Oct 16, 2018
    Copy the full SHA
    d0594df View commit details
    Browse the repository at this point in the history
  12. http2: fix responses to long payload reqs

    When a request with a long payload is received, http2 does
    not allow a response that does not process all the incoming
    payload. Add a conditional Http2Stream.close call that runs
    only if the user hasn't attempted to read the stream.
    
    PR-URL: nodejs#20084
    Fixes: nodejs#20060
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    apapirovski authored and kjin committed Oct 16, 2018
    Copy the full SHA
    7bb1a8c View commit details
    Browse the repository at this point in the history
  13. http2: fix ping callback

    In case there was no ack, the callback would have returned
    more than the error as return value. This makes sure that is not
    the case anymore.
    
    PR-URL: nodejs#20311
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    BridgeAR authored and kjin committed Oct 16, 2018
    Copy the full SHA
    cdbf96f View commit details
    Browse the repository at this point in the history
  14. test: verify arguments length in common.expectsError

    If `common.expectsError` is used as a callback, it will now also
    verify that there is only one argument (the expected error).
    
    PR-URL: nodejs#20311
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    BridgeAR authored and kjin committed Oct 16, 2018
    Copy the full SHA
    07aab18 View commit details
    Browse the repository at this point in the history
  15. doc: add parameters for settings events

    Add parameters for the callback for the Http2Session:localSettings event
    and Http2Session:remoteSettings event inline with the pattern in the
    rest of the documentation.
    
    Refs: nodejs/help#877 (comment)
    
    PR-URL: nodejs#20371
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    ryzokuken authored and kjin committed Oct 16, 2018
    Copy the full SHA
    c9865ff View commit details
    Browse the repository at this point in the history
  16. http2: reduce require calls in http2/core

    This commit removes unnecesary requires of http and internal/util in
    http2/core.js
    
    PR-URL: nodejs#20422
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    danbev authored and kjin committed Oct 16, 2018
    Copy the full SHA
    d9efc87 View commit details
    Browse the repository at this point in the history
  17. http2: rename http2_state class to Http2State

    This commit renames the http2_state class to follow the guidelines in
    CPP_STYLE_GUIDE.md.
    
    PR-URL: nodejs#20423
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    danbev authored and kjin committed Oct 16, 2018
    Copy the full SHA
    ce96ad0 View commit details
    Browse the repository at this point in the history
  18. doc: add parameters for Http2Session:stream event

    Add parameters for the callback for the Http2Session:stream event
    inline with the pattern in the rest of the documentation.
    
    Refs: nodejs/help#877 (comment)
    
    PR-URL: nodejs#20547
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    ryzokuken authored and kjin committed Oct 16, 2018
    Copy the full SHA
    807807f View commit details
    Browse the repository at this point in the history
  19. test: fix flaky http2-flow-control test

    PR-URL: nodejs#20556
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    apapirovski authored and kjin committed Oct 16, 2018
    Copy the full SHA
    7d23d63 View commit details
    Browse the repository at this point in the history
  20. doc: add params for ClientHttp2Session:altsvc

    Add parameters for the callback for the ClientHttp2Session:altsvc
    event inline with the pattern in the rest of the documentation.
    
    Refs: nodejs/help#877 (comment)
    
    PR-URL: nodejs#20598
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    ryzokuken authored and kjin committed Oct 16, 2018
    Copy the full SHA
    e3e16d7 View commit details
    Browse the repository at this point in the history
  21. doc: add parameters for Http2Stream:error event

    Add parameters for the callback for the Http2Stream:error event
    inline with the pattern in the rest of the documentation.
    
    Refs: nodejs/help#877 (comment)
    
    PR-URL: nodejs#20610
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    ryzokuken authored and kjin committed Oct 16, 2018
    Copy the full SHA
    776c3d0 View commit details
    Browse the repository at this point in the history
  22. http2: avoid bind and properly clean up in compat

    PR-URL: nodejs#20374
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    ronag authored and kjin committed Oct 16, 2018
    Copy the full SHA
    11f194f View commit details
    Browse the repository at this point in the history
  23. test: improve reliability of http2-session-timeout

    Check actual expired time rather than relying on a number of calls to
    setTimeout() in test-http2-session-timeout more robust.
    
    PR-URL: nodejs#20692
    Fixes: nodejs#20628
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Trott authored and kjin committed Oct 16, 2018
    Copy the full SHA
    9cf40c5 View commit details
    Browse the repository at this point in the history
  24. http2: fix end without read

    Adjust http2 behaviour to allow ending a stream even after some
    data comes in (when the user has no intention of reading that
    data). Also correctly end a stream when trailers are present.
    
    PR-URL: nodejs#20621
    Fixes: nodejs#20060
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    apapirovski authored and kjin committed Oct 16, 2018
    Copy the full SHA
    2238e12 View commit details
    Browse the repository at this point in the history
  25. net,http2: refactor _write and _writev

    Refactor writable part (the _write and _writev functions) in net.Socket
    and http2.Http2Stream classes.
    Also involves adding a generic "WriteGeneric" method to the Http2Stream
    class based on net.Socket._writeGeneric, but behind a symbol.
    
    PR-URL: nodejs#20643
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    ryzokuken authored and kjin committed Oct 16, 2018
    Copy the full SHA
    c9f8d6f View commit details
    Browse the repository at this point in the history
  26. doc: fix typo in http2.md

    PR-URL: nodejs#20843
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Tobias Nießen <tniessen@tnie.de>
    kakts authored and kjin committed Oct 16, 2018
    Copy the full SHA
    4ef2393 View commit details
    Browse the repository at this point in the history
  27. http2: fix several serious bugs

    Currently http2 does not properly submit GOAWAY frames when a session
    is being destroyed. It also doesn't properly handle when the other
    party severs the connection after sending a GOAWAY frame, even though
    it should.
    
    Edge, IE & Safari are currently unable to handle empty TRAILERS
    frames despite them being correctly to spec. Instead send an empty
    DATA frame with END_STREAM flag in those situations.
    
    Fix and adjust several flaky and/or incorrect tests.
    
    PR-URL: nodejs#20772
    Fixes: nodejs#20705
    Fixes: nodejs#20750
    Fixes: nodejs#20850
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    apapirovski authored and kjin committed Oct 16, 2018
    Copy the full SHA
    2151bf3 View commit details
    Browse the repository at this point in the history
  28. test: fix flaky http2-session-unref

    It's possible for the connections to take too long and since the server
    is already unrefed, the process will just exit. Instead adjust the test
    so that server unref only happens after all sessions have been
    successfuly established and unrefed. That still tests the same condition
    but will not fail under load.
    
    PR-URL: nodejs#20772
    Fixes: nodejs#20705
    Fixes: nodejs#20750
    Fixes: nodejs#20850
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    apapirovski authored and kjin committed Oct 16, 2018
    Copy the full SHA
    e825eed View commit details
    Browse the repository at this point in the history
  29. http2: delay closing stream

    Delay automatically closing the stream with setImmediate in order
    to allow any pushStreams to be sent first.
    
    PR-URL: nodejs#20997
    Fixes: nodejs#20992
    Reviewed-By: James M Snell <jasnell@gmail.com>
    apapirovski authored and kjin committed Oct 16, 2018
    Copy the full SHA
    830cc57 View commit details
    Browse the repository at this point in the history
  30. http2: force through RST_STREAM in destroy

    If still needed, force through RST_STREAM in Http2Stream#destroy
    calls, so that nghttp2 can wrap up properly and doesn't continue
    trying to read & write data to the stream.
    
    PR-URL: nodejs#21016
    Fixes: nodejs#21008
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    apapirovski authored and kjin committed Oct 16, 2018
    Copy the full SHA
    21f3e27 View commit details
    Browse the repository at this point in the history
  31. test: minor adjustments to test-http2-respond-file

    PR-URL: nodejs#21098
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: Jon Moss <me@jonathanmoss.me>
    Reviewed-By: Richard Lau <riclau@uk.ibm.com>
    addaleax authored and kjin committed Oct 16, 2018
    Copy the full SHA
    b53a753 View commit details
    Browse the repository at this point in the history
  32. http2: fix premature destroy

    Check stream._writableState.finished instead of stream.writable
    as the latter can lead to premature calls to destroy and dropped
    writes on busy processes.
    
    PR-URL: nodejs#21051
    Fixes: nodejs#20750
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    apapirovski authored and kjin committed Oct 16, 2018
    Copy the full SHA
    3a34ebd View commit details
    Browse the repository at this point in the history
  33. http2: safer Http2Session destructor

    It's hypothetically (and with certain V8 flags) possible for the session
    to be garbage collected before all the streams are. In that case, trying
    to remove the stream from the session will lead to a segfault due to
    attempting to access no longer valid memory. Fix this by unsetting the
    session on any streams still around when destroying.
    
    PR-URL: nodejs#21194
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
    apapirovski authored and kjin committed Oct 16, 2018
    Copy the full SHA
    3d38b99 View commit details
    Browse the repository at this point in the history
  34. http2: fix memory leak for uncommon headers

    Fix a memory leak that occurs with header names that are
    short and not present in the static table of default headers.
    
    PR-URL: nodejs#21336
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
    Reviewed-By: Richard Lau <riclau@uk.ibm.com>
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    addaleax authored and kjin committed Oct 16, 2018
    Copy the full SHA
    4d46e35 View commit details
    Browse the repository at this point in the history
  35. http2: fix memory leak when headers are not emitted

    When headers are not emitted to JS, e.g. because of an error
    before that could happen, we currently still have the vector of
    previously received headers lying around, each one holding
    a reference count of 1.
    
    To fix the resulting memory leak, release them in the `Http2Stream`
    destructor.
    
    Also, clear the vector of headers once they have been emitted –
    there’s not need to keep it around, wasting memory.
    
    PR-URL: nodejs#21373
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    addaleax authored and kjin committed Oct 16, 2018
    Copy the full SHA
    78c7fc4 View commit details
    Browse the repository at this point in the history
  36. http2: track memory allocated by nghttp2

    Provide a custom memory allocator for nghttp2, and track
    memory allocated by the library with it.
    
    This makes the used-memory-per-session estimate more
    accurate, and allows us to track memory leaks either
    in nghttp2 itself or, more likely, through faulty
    usage on our end.
    
    It also allows us to make the per-session memory limit
    more accurate in the future; currently, we are not
    handling this in an ideal way, and instead let nghttp2
    allocate what it wants, even if that goes over our limit.
    
    PR-URL: nodejs#21374
    Refs: nodejs#21373
    Refs: nodejs#21336
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    addaleax authored and kjin committed Oct 16, 2018
    Copy the full SHA
    f8ca564 View commit details
    Browse the repository at this point in the history
  37. doc: Improve doc for Http2 headers object

    Add more details regarding processing and data type of incoming
    headers in Http2.
    
    PR-URL: nodejs#21296
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
    Flarna authored and kjin committed Oct 16, 2018
    Copy the full SHA
    9e64f91 View commit details
    Browse the repository at this point in the history
  38. http2: pass incoming set-cookie header as array

    Incoming set-cookie headers should be passed to user as array like in
    http module.
    
    Besides improving compatibility between http and http2 it avoids the
    need to check if the type is an array or not in user code.
    
    PR-URL: nodejs#21360
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Flarna authored and kjin committed Oct 16, 2018
    Copy the full SHA
    6bdee91 View commit details
    Browse the repository at this point in the history
  39. doc: fix http2stream.pushStream error doc

    The old error code `ERR_HTTP2_STREAM_CLOSED` was removed in commit
    0babd18 (pull request nodejs#17406), and the
    testcase for http2stream.pushStream was changed accordingly, but the
    documentation change was overlooked.
    
    This commit fixes it and aligns the documentation with the testcase.
    
    This is a part of the fixes hinted by nodejs#21470, which includes some tests
    for error codes usage and documentation and enforces a stricter format.
    
    Refs: nodejs#21470
    Refs: nodejs#17406
    PR-URL: nodejs#21487
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    ChALkeR authored and kjin committed Oct 16, 2018
    Copy the full SHA
    00002a6 View commit details
    Browse the repository at this point in the history
  40. http2: order declarations in core.js

    Order declarations:
    
    * public modules in alphabetical order
    * internal modules in alphabetical order
    * process.binding() calls in alphabetical order
    * exports in alphabetical order
    
    PR-URL: nodejs#21689
    Reviewed-By: Gus Caplan <me@gus.host>
    Reviewed-By: Weijia Wang <starkwang@126.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Trott authored and kjin committed Oct 16, 2018
    Copy the full SHA
    823b31e View commit details
    Browse the repository at this point in the history
  41. errors: fix undefined HTTP2 and tls errors

    Includes implementation of tls, HTTP2 error with documentation.
    
    PR-URL: nodejs#21564
    Refs: nodejs#21440
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    thatshailesh authored and kjin committed Oct 16, 2018
    Copy the full SHA
    a9053fa View commit details
    Browse the repository at this point in the history
  42. http2: remove waitTrailers listener after closing a stream

    When `writeHeader` of `Http2ServerResponse` instance are called with
    204, 205 and 304 status codes an underlying stream closes.
    If call `end` method after sending any of these status codes it will
    cause an error `TypeError: Cannot read property 'Symbol(trailers)' of
    undefined` because a reference to `Http2ServerResponse` instance
    associated with Http2Stream already was deleted.
    The closing of stream causes emitting `waitTrailers` event and, when
    this event handles inside `onStreamTrailerReady` handler, there is
    no reference to Http2ServerResponse instance.
    
    Fixes: nodejs#21740
    PR-URL: nodejs#21764
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    RidgeA authored and kjin committed Oct 16, 2018
    Copy the full SHA
    9a0d117 View commit details
    Browse the repository at this point in the history
  43. doc: add missing require to example in http2.md

    PR-URL: nodejs#21858
    Reviewed-By: Gus Caplan <me@gus.host>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    kevinsimper authored and kjin committed Oct 16, 2018
    Copy the full SHA
    41edcf4 View commit details
    Browse the repository at this point in the history
  44. http2: remove unused nghttp2 error list

    Remove a list of HTTP2 errors as well as `nghttp2_errname()`
    that converted an integer nghttp2 error code to a string
    representation.
    
    We already use `nghttp2_strerror()` for this, which
    is provided by nghttp2 returns a better error string anyway.
    
    PR-URL: nodejs#21827
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    addaleax authored and kjin committed Oct 16, 2018
    Copy the full SHA
    d78a7b3 View commit details
    Browse the repository at this point in the history
  45. http2: release request()'s "connect" event listener after it runs

    The `Http2Session#request()` method internally listens to the "connect"
    event if the session has not yet established a connection so that the
    actual request can be sent after the connection has been established.
    
    This commit removes the event listener after it runs and carries out
    the request and is no longer needed. In practice this shouldn't affect
    the behavior of the session object since the "connect" event fires only
    once anyway, but removing the listener releases its references. The
    rest of this class subscribes to the "connect" event with `once`
    instead of `on` as well.
    
    Tested by adding a new test that ensures `Http2Session#request()` is
    called before the connection is established, indicated by a "connect"
    listener that is run. The test also ensures all "connect" listeners are
    removed after the connection is established.
    
    PR-URL: nodejs#21916
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    ide authored and kjin committed Oct 16, 2018
    Copy the full SHA
    aa4c19b View commit details
    Browse the repository at this point in the history
  46. test: refactor test-http2-compat-serverresponse-finished.js

    PR-URL: nodejs#21929
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Jon Moss <me@jonathanmoss.me>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    antsmartian authored and kjin committed Oct 16, 2018
    Copy the full SHA
    833ef17 View commit details
    Browse the repository at this point in the history
  47. test: improve reliability in http2-session-timeout

    Use `setImmediate()` instead of `setTimeout()` to improve robustness of
    test-http2-session-timeout.
    
    Fixes: nodejs#20628
    
    PR-URL: nodejs#22026
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Jon Moss <me@jonathanmoss.me>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Trott authored and kjin committed Oct 16, 2018
    Copy the full SHA
    23b53e7 View commit details
    Browse the repository at this point in the history
  48. http2: remove streamError from docs

    `streamError` was removed quite some time ago but the docs and
    code comments weren't updated. Fix that.
    
    Fixes: nodejs#20211
    
    PR-URL: nodejs#22246
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Jon Moss <me@jonathanmoss.me>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    07ef45d View commit details
    Browse the repository at this point in the history
  49. doc: clarify http2 docs around class exports

    PR-URL: nodejs#22247
    Fixes: nodejs#21434
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: George Adams <george.adams@uk.ibm.com>
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    411acb7 View commit details
    Browse the repository at this point in the history
  50. http2: avoid race condition in OnHeaderCallback

    Fixes: nodejs#21416
    
    PR-URL: nodejs#22256
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: George Adams <george.adams@uk.ibm.com>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    ee3e471 View commit details
    Browse the repository at this point in the history
  51. test: add test-http2-large-file sequential test

    Refs: nodejs#19141
    
    PR-URL: nodejs#22254
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: George Adams <george.adams@uk.ibm.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    81f3ebc View commit details
    Browse the repository at this point in the history
  52. http2: explicitly disallow nested push streams

    Fixes: nodejs#19095
    
    PR-URL: nodejs#22245
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    f1e310e View commit details
    Browse the repository at this point in the history
  53. http2: emit timeout on compat request and response

    v8.x Backport Note: The timeout has been increased to 10ms.
    
    Fixes: nodejs#20079
    
    PR-URL: nodejs#22252
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    3dc84ca View commit details
    Browse the repository at this point in the history
  54. doc: make createPushResponse() more detailled

    We don't know what will return when successful or failure for
    the callback of the function. So this commit makes it more detailled.
    
    PR-URL: nodejs#22366
    Refs: nodejs#22322
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    MaleDong authored and kjin committed Oct 16, 2018
    Copy the full SHA
    28cd408 View commit details
    Browse the repository at this point in the history
  55. doc: simplify http2 wording and formatting

    Remove `It is important to note that` and italics from `waitForTrailers`
    sentences.
    
    PR-URL: nodejs#22541
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Trott authored and kjin committed Oct 16, 2018
    Copy the full SHA
    391e30a View commit details
    Browse the repository at this point in the history
  56. http2: throw better error when accessing unbound socket proxy

    Fixes: nodejs#22268
    
    PR-URL: nodejs#22486
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    3640568 View commit details
    Browse the repository at this point in the history
  57. deps: update to nghttp2 1.33.0

    Refs: https://github.com/nghttp2/nghttp2/releases/tag/v1.33.0
    
    PR-URL: nodejs#22649
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    addaleax authored and kjin committed Oct 16, 2018
    Copy the full SHA
    f6d9bf3 View commit details
    Browse the repository at this point in the history
  58. http2: don't expose the original socket through the socket proxy

    Refs: nodejs#22486
    
    PR-URL: nodejs#22650
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    szmarczak authored and kjin committed Oct 16, 2018
    Copy the full SHA
    62ce017 View commit details
    Browse the repository at this point in the history
  59. doc: document http2 timeouts

    New default timeout values of "2 minutes" were added into documentation
    inside 2 classes under "Event: 'timeout'":
    1) Class: Http2SecureServer
    2) Class: Http2Server
    
    New sections for `.setTimeout()` method were added inside
    `Http2SecureServer` & `Http2Server` docs.
    
    PR-URL: nodejs#22798
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    sagitsofan authored and kjin committed Oct 16, 2018
    Copy the full SHA
    f9cd2d5 View commit details
    Browse the repository at this point in the history
  60. http2: add http2stream.endAfterHeaders property

    Indicates is the END_STREAM flag was set on the received HEADERS frame
    
    PR-URL: nodejs#22843
    Fixes: nodejs#22497
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    565d9d8 View commit details
    Browse the repository at this point in the history
  61. http2: check if stream is not destroyed before sending trailers

    Fixes: nodejs#22855
    PR-URL: nodejs#22896
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    mcollina authored and kjin committed Oct 16, 2018
    Copy the full SHA
    2fd285a View commit details
    Browse the repository at this point in the history
  62. http2: add origin frame support

    v8.x Backport Note -- as V8 doesn't expose an overload of String::WriteOneByte
    in Node 8 that accepts an isolate argument, the Origins constructor has been
    changed to not accept an isolate.
    
    PR-URL: nodejs#22956
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    bdaccc9 View commit details
    Browse the repository at this point in the history
  63. http2: do not falsely emit 'aborted' on push

    A push stream should have its writable side closed upon receipt,
    to avoid emitting the 'aborted' event when the readable side
    is closed.
    
    PR-URL: nodejs#22878
    Fixes: nodejs#22851
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    apapirovski authored and kjin committed Oct 16, 2018
    Copy the full SHA
    48d8766 View commit details
    Browse the repository at this point in the history
  64. http2: add ping event

    Add a `Http2Session` event whenever a non-ack `PING` is received.
    
    Fixes: nodejs#18514
    
    PR-URL: nodejs#23009
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Denys Otrishko <shishugi@gmail.com>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    40a8814 View commit details
    Browse the repository at this point in the history
  65. test: remove setImmediate from timeout test

    In test-http2-session-timeout, setImmediate() is used to wrap makeReq().
    makeReq() is asynchronous and setImmediate() is not necessary.
    
    PR-URL: nodejs#23058
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Refael Ackermann <refack@gmail.com>
    Reviewed-By: Richard Lau <riclau@uk.ibm.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
    Trott authored and kjin committed Oct 16, 2018
    Copy the full SHA
    593f8d9 View commit details
    Browse the repository at this point in the history
  66. test: improve debugging information for http2 test

    In test-http2-session-timeout, provide the number of requests that
    occurred when the test fails.
    
    PR-URL: nodejs#23058
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Refael Ackermann <refack@gmail.com>
    Reviewed-By: Richard Lau <riclau@uk.ibm.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
    Trott authored and kjin committed Oct 16, 2018
    Copy the full SHA
    4f46d4b View commit details
    Browse the repository at this point in the history
  67. http2: graduate from experimental

    PR-URL: nodejs#22466
    Reviewed-By: Gus Caplan <me@gus.host>
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
    Reviewed-By: Tobias Nießen <tniessen@tnie.de>
    Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    jasnell authored and kjin committed Oct 16, 2018
    Copy the full SHA
    19e925b View commit details
    Browse the repository at this point in the history