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 9.x #20456

Closed
wants to merge 77 commits into from
Closed

Commits on Apr 27, 2018

  1. src: minor refactoring to StreamBase writes

    Instead of having per-request callbacks, always call a callback
    on the `StreamBase` instance itself for `WriteWrap` and `ShutdownWrap`.
    
    This makes `WriteWrap` cleanup consistent for all stream classes,
    since the after-write callback is always the same now.
    
    If special handling is needed for writes that happen to a sub-class,
    `AfterWrite` can be overridden by that class, rather than that
    class providing its own callback (e.g. updating the write
    queue size for libuv streams).
    
    If special handling is needed for writes that happen on another
    stream instance, the existing `after_write_cb()` callback
    is used for that (e.g. custom code after writing to the
    transport from a TLS stream).
    
    As a nice bonus, this also makes `WriteWrap` and `ShutdownWrap`
    instances slightly smaller.
    
    PR-URL: nodejs#17564
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    addaleax authored and kjin committed Apr 27, 2018
    Configuration menu
    Copy the full SHA
    0d7ce68 View commit details
    Browse the repository at this point in the history
  2. src: replace SetAccessor w/ SetAccessorProperty

    PR-URL: nodejs#17665
    Fixes: nodejs#17636
    Refs: nodejs#16482
    Refs: nodejs#16860
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Timothy Gu <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Ben Noordhuis <[email protected]>
    jure authored and kjin committed Apr 27, 2018
    Configuration menu
    Copy the full SHA
    16a3ad0 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2018

  1. test: add hasCrypto when using binding('crypto')

    Currently, when configured --without-ssl tests that use
    process.binding('crypto') fail with the following error:
    
    === release test-accessor-properties ===
    Path: parallel/test-accessor-properties
    node/test/parallel/test-accessor-properties.js:16
    const crypto = process.binding('crypto');
                           ^
    
    Error: No such module: crypto
        at Object.<anonymous> (test-accessor-properties.js:16:24)
        at Module._compile (module.js:660:30)
        at Object.Module._extensions..js (module.js:671:10)
        at Module.load (module.js:577:32)
        at tryModuleLoad (module.js:517:12)
        at Function.Module._load (module.js:509:3)
        at Function.Module.runMain (module.js:701:10)
        at startup (bootstrap_node.js:194:16)
        at bootstrap_node.js:645:3
    
    This commit adds a hasCrypto check.
    
    PR-URL: nodejs#17867
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    danbev authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    c4572cc View commit details
    Browse the repository at this point in the history
  2. test: make test-tls-external-accessor agnostic

    Remove reliance on V8-specific error messages in
    test/parallel/test-tls-external-accessor.js.
    
    Check that the error is a `TypeError`.
    
    The test should now be successful without modification using ChakraCore.
    
    PR-URL: nodejs#16272
    Reviewed-By: Michaël Zasso <[email protected]>
    Reviewed-By: Refael Ackermann <[email protected]>
    Reviewed-By: Yuta Hiroto <[email protected]>
    Reviewed-By: Joyee Cheung <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Benjamin Gruenbaum <[email protected]>
    Reviewed-By: Tobias Nießen <[email protected]>
    Trott authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    9557fb9 View commit details
    Browse the repository at this point in the history
  3. perf_hooks: refactor internals

    Refactor and simplify the perf_hooks native internals.
    
    PR-URL: nodejs#17822
    Reviewed-By: Anna Henningsen <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    d5ddbd9 View commit details
    Browse the repository at this point in the history
  4. http2: simplify onSelectPadding

    `OnCallbackPadding` on the native side already clamps
    the return value into the right range, so there’s not need
    to also do that on the JS side.
    
    Also, use `>>> 0` instead of `| 0` to get an uint32, since
    the communication with C++ land happens through an Uint32Array.
    
    PR-URL: nodejs#17717
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    ed53cb7 View commit details
    Browse the repository at this point in the history
  5. deps: update nghttp2 to 1.29.0

    PR-URL: nodejs#17908
    Refs: nodejs#17746
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    14d0bab View commit details
    Browse the repository at this point in the history
  6. src: add optional keep-alive object to SetImmediate

    Adds the possibility to keep a strong persistent reference to
    a JS object while a `SetImmediate()` call is in effect.
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17183
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Franziska Hinkelmann <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    584379f View commit details
    Browse the repository at this point in the history
  7. http2: don't call into JS from GC

    Calling into JS land from GC is not allowed, so delay
    the resolution of pending pings when a session is destroyed.
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17183
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Franziska Hinkelmann <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    e725a4a View commit details
    Browse the repository at this point in the history
  8. http2: only schedule write when necessary

    Introduce an `Http2Scope` class that, when it goes out of scope,
    checks whether a write to the network is desired by nghttp2.
    If that is the case, schedule a write using `SetImmediate()`
    rather than a custom per-session libuv handle.
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17183
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Franziska Hinkelmann <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    2d389f9 View commit details
    Browse the repository at this point in the history
  9. http2: be sure to destroy the Http2Stream

    PR-URL: nodejs#17406
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    
    Backport-PR-URL: nodejs#18050
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    367b848 View commit details
    Browse the repository at this point in the history
  10. http2: cleanup Http2Stream/Http2Session destroy

    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17406
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    
    This is a significant cleanup and refactoring of the
    cleanup/close/destroy logic for Http2Stream and Http2Session.
    There are significant changes here in the timing and ordering
    of cleanup logic, JS apis. and various related necessary edits.
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    988f11f View commit details
    Browse the repository at this point in the history
  11. http2: remove redundant write indirection

    `nghttp2_stream_write_t` was not a necessary redirection layer
    and came with the cost of one additional allocation per stream write.
    
    Also, having both `nghttp2_stream_write` and `nghttp2_stream_write_t`
    as identifiers did not help with readability.
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17718
    Reviewed-By: James M Snell <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    10e9b9d View commit details
    Browse the repository at this point in the history
  12. http2: refactor outgoing write mechanism

    - Only finish outgoing `WriteWrap`s once data has actually been
      passed to the underlying socket.
      - This makes HTTP2 streams respect backpressure
    - Use `DoTryWrite` as a shortcut for sending out as much of
      the data synchronously without blocking as possible
    - Use `NGHTTP2_DATA_FLAG_NO_COPY` to avoid copying DATA frame
      contents into nghttp2’s buffers before sending them out.
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17718
    Reviewed-By: James M Snell <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    93d00ab View commit details
    Browse the repository at this point in the history
  13. http2: convert Http2Settings to an AsyncWrap

    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17763
    Refs: nodejs#17746
    Reviewed-By: Matteo Collina <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    f68325c View commit details
    Browse the repository at this point in the history
  14. http2: fix compiling with --debug-http2

    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17863
    Fixes: nodejs#17840
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    5036d0f View commit details
    Browse the repository at this point in the history
  15. http2: keep session objects alive during Http2Scope

    Keep a local handle as a reference to the JS `Http2Session`
    object so that it will not be garbage collected
    when inside an `Http2Scope`, because the presence of the
    latter usually indicates that further actions on
    the session object are expected.
    
    Strictly speaking, storing the `session_handle_` as a
    property on the scope object is not necessary, but
    this is not very costly and makes the code more
    obviously correct.
    
    Fixes: nodejs#17840
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17863
    Fixes: nodejs#17840
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    3490359 View commit details
    Browse the repository at this point in the history
  16. http2: implement ref() and unref() on client sessions

    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17620
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    3bf3eb8 View commit details
    Browse the repository at this point in the history
  17. http2: perf_hooks integration

    Collect and report basic timing information about `Http2Session`
    and `Http2Stream` instances.
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17906
    Refs: nodejs#17746
    Reviewed-By: Matteo Collina <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    e92be6a View commit details
    Browse the repository at this point in the history
  18. http2,perf_hooks: perf state using AliasedBuffer

    This is the portion of be2cbcc that is not in dea44b9.
    
    Update performance_state to use AliasedBuffer and update usage sites.
    
    PR-URL: nodejs#18300
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    kfarnung authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    7767aaa View commit details
    Browse the repository at this point in the history
  19. http2: strictly limit number on concurrent streams

    Strictly limit the number of concurrent streams based on the
    current setting of the MAX_CONCURRENT_STREAMS setting
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#16766
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: Sebastiaan Deckers <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    936337a View commit details
    Browse the repository at this point in the history
  20. http2: add altsvc support

    This commit also includes prerequisite error definitions
    from c75f87c and 1698c8e.
    
    Add support for sending and receiving ALTSVC frames.
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17917
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    644bd5f View commit details
    Browse the repository at this point in the history
  21. tls: set servername on client side too

    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17935
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: Sebastiaan Deckers <[email protected]>
    Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    6466ac1 View commit details
    Browse the repository at this point in the history
  22. http2: add initial support for originSet

    Add new properties to `Http2Session` to identify alpnProtocol,
    and indicator about whether the session is TLS or not, and
    initial support for origin set (preparinng for `ORIGIN` frame
    support and the client-side `Pool` implementation.
    
    The `originSet` is the set of origins for which an `Http2Session`
    may be considered authoritative. Per the `ORIGIN` frame spec,
    the originSet is only valid on TLS connections, so this is only
    exposed when using a `TLSSocket`.
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17935
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: Sebastiaan Deckers <[email protected]>
    Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    fc97666 View commit details
    Browse the repository at this point in the history
  23. http2: add aligned padding strategy

    Add a padding strategy option that makes a best attempt to ensure
    that total frame length for DATA and HEADERS frames are aligned
    on multiples of 8-bytes.
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17938
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    08f599b View commit details
    Browse the repository at this point in the history
  24. http2: properly handle already closed stream error

    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17942
    Reviewed-By: Matteo Collina <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    3601bc4 View commit details
    Browse the repository at this point in the history
  25. doc: add docs for common/http2.js utility

    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17942
    Reviewed-By: Matteo Collina <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    21c0a8c View commit details
    Browse the repository at this point in the history
  26. src: silence http2 -Wunused-result warnings

    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17954
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    cjihrig authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    098d052 View commit details
    Browse the repository at this point in the history
  27. http2: implement maxSessionMemory

    The maxSessionMemory is a cap for the amount of memory an
    Http2Session is permitted to consume. If exceeded, new
    `Http2Stream` sessions will be rejected with an
    `ENHANCE_YOUR_CALM` error and existing `Http2Stream`
    instances that are still receiving headers will be
    terminated with an `ENHANCE_YOUR_CALM` error.
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17967
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    3a5e97f View commit details
    Browse the repository at this point in the history
  28. http2: verify that a dependency cycle may exist

    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17968
    Reviewed-By: Anna Henningsen <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    b3d09de View commit details
    Browse the repository at this point in the history
  29. doc: grammar fixes in http2.md

    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17972
    Reviewed-By: Weijia Wang <[email protected]>
    Reviewed-By: Jon Moss <[email protected]>
    Reviewed-By: Evan Lucas <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    Reviewed-By: Tobias Nießen <[email protected]>
    Trott authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    26c8b3c View commit details
    Browse the repository at this point in the history
  30. http2: verify flood error and unsolicited frames

    * verify protections against ping and settings flooding
    * Strictly handle and verify handling of unsolicited ping and
      settings frame acks.
    
    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17969
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    0954785 View commit details
    Browse the repository at this point in the history
  31. doc: correct spelling

    Backport-PR-URL: nodejs#18050
    PR-URL: nodejs#17911
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Rich Trott <[email protected]>
    Reviewed-By: Daniel Bevenius <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Gibson Fahnestock <[email protected]>
    Reviewed-By: Tobias Nießen <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    Reviewed-By: Gireesh Punathil <[email protected]>
    Reviewed-By: Weijia Wang <[email protected]>
    sreepurnajasti authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    5fe065b View commit details
    Browse the repository at this point in the history
  32. doc: fix code nits in common/README

    1. Sync comments and code
    2. Fix typos
    
    PR-URL: nodejs#17971
    Reviewed-By: Rich Trott <[email protected]>
    Reviewed-By: Khaidi Chu <[email protected]>
    Reviewed-By: Jon Moss <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    vsemozhetbyt authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    ea21157 View commit details
    Browse the repository at this point in the history
  33. doc: re-alphabetise sections in common/README.md

    PR-URL: nodejs#17971
    Reviewed-By: Rich Trott <[email protected]>
    Reviewed-By: Khaidi Chu <[email protected]>
    Reviewed-By: Jon Moss <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    vsemozhetbyt authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    b768f6f View commit details
    Browse the repository at this point in the history
  34. doc: compact eslint directives in common/README

    PR-URL: nodejs#17971
    Reviewed-By: Rich Trott <[email protected]>
    Reviewed-By: Khaidi Chu <[email protected]>
    Reviewed-By: Jon Moss <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    vsemozhetbyt authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    4eb9cca View commit details
    Browse the repository at this point in the history
  35. http2: use aliased buffer for perf stats, add stats

    Add an aliased buffer for session and stream statistics,
    add a few more metrics
    
    PR-URL: nodejs#18020
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    39a0d35 View commit details
    Browse the repository at this point in the history
  36. doc: update pushStream docs to use err first

    Refs: nodejs#17406 (comment)
    
    PR-URL: nodejs#18088
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Daniel Bevenius <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    3d13a16 View commit details
    Browse the repository at this point in the history
  37. doc: fix s/rstStream/close in example

    PR-URL: nodejs#18088
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Daniel Bevenius <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    de1e52e View commit details
    Browse the repository at this point in the history
  38. perf_hooks,http2: add performance.clear()

    Add missing clear() method to `perf_hooks.performance` to
    remove the entries from the master timeline to prevent
    that from being a memory leak.
    
    PR-URL: nodejs#18046
    Reviewed-By: Matteo Collina <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    6a24afd View commit details
    Browse the repository at this point in the history
  39. http2: remember sent headers

    Add sentHeaders, sentTrailers, and sentInfoHeaders properties
    on `Http2Stream`.
    
    PR-URL: nodejs#18045
    Fixes: nodejs#16619
    Reviewed-By: Matteo Collina <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    1d5ab00 View commit details
    Browse the repository at this point in the history
  40. src: remove declarations for missing functions

    PR-URL: nodejs#18134
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Jon Moss <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Tobias Nießen <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
    Reviewed-By: Franziska Hinkelmann <[email protected]>
    Reviewed-By: Daniel Bevenius <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    39e27fd View commit details
    Browse the repository at this point in the history
  41. src,doc,test: Fix common misspellings

    PR-URL: nodejs#18151
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Tobias Nießen <[email protected]>
    Reviewed-By: Richard Lau <[email protected]>
    Reviewed-By: Gireesh Punathil <[email protected]>
    Reviewed-By: Michael Dawson <[email protected]>
    silverwind authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    dcb986e View commit details
    Browse the repository at this point in the history
  42. doc: fix typo in http2stream.close param default

    PR-URL: nodejs#18166
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Tobias Nießen <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    maritz authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    3535f6f View commit details
    Browse the repository at this point in the history
  43. src: introduce internal buffer slice constructor

    Add a C++ variant of `Buffer.from(arrayBuffer, offset, length)`.
    
    PR-URL: nodejs#18030
    Reviewed-By: James M Snell <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    f494635 View commit details
    Browse the repository at this point in the history
  44. http2: refactor read mechanism

    Refactor the read mechanism to completely avoid copying.
    
    Instead of copying individual `DATA` frame contents into buffers,
    create `ArrayBuffer` instances for all socket reads and emit
    slices of those `ArrayBuffer`s to JS.
    
    PR-URL: nodejs#18030
    Reviewed-By: James M Snell <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    cf46b95 View commit details
    Browse the repository at this point in the history
  45. http2: add checks for server close callback

    Verify that server close callbacks are being called
    
    PR-URL: nodejs#18182
    Refs: nodejs#18176
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    jasnell authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    9ff0e8c View commit details
    Browse the repository at this point in the history
  46. doc: fix documentation of http2Stream.pushstream()

    Improve documentation of callback signature of
    http2Stream.pushStream() function to align with
    the changes made in nodejs#17406.
    
    PR-URL: nodejs#18258
    Fixes: nodejs#18198
    Refs: nodejs#17406
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    nephross authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    4d7549b View commit details
    Browse the repository at this point in the history
  47. doc: unify type linkification

    PR-URL: nodejs#18407
    Reviewed-By: Joyee Cheung <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Jon Moss <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    vsemozhetbyt authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    c8a6d8a View commit details
    Browse the repository at this point in the history
  48. doc: remove removed apis from http2 docs

    PR-URL: nodejs#18439
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    bcfef86 View commit details
    Browse the repository at this point in the history
  49. doc: fix typo in http2.md

    PR-URL: nodejs#18602
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    vsemozhetbyt authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    b83c03e View commit details
    Browse the repository at this point in the history
  50. http2: add http fallback options to .createServer

    This adds the Http1IncomingMessage and Http1ServerReponse options
    to http2.createServer().
    
    PR-URL: nodejs#15752
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Evan Lucas <[email protected]>
    hekike authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    7e26992 View commit details
    Browse the repository at this point in the history
  51. http: add options to http.createServer()

    This adds the optional options argument to `http.createServer()`.
    It contains two options: the `IncomingMessage` and `ServerReponse`
    option.
    
    PR-URL: nodejs#15752
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Evan Lucas <[email protected]>
    Peter Marton authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    740d445 View commit details
    Browse the repository at this point in the history
  52. http2: add req and res options to server creation

    Add optional Http2ServerRequest and Http2ServerResponse options
    to createServer and createSecureServer. Allows custom req & res
    classes that extend the default ones to be used without
    overriding the prototype.
    
    PR-URL: nodejs#15560
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    Peter Marton authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    7e2181a View commit details
    Browse the repository at this point in the history
  53. http2: use _final instead of on('finish')

    PR-URL: nodejs#18609
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    7b03c17 View commit details
    Browse the repository at this point in the history
  54. doc: warn against concurrent http2stream.respondWithFD

    Upcoming changes to move away from synchronous I/O on the main
    thread will imply that using the same file descriptor to
    respond on multiple HTTP/2 streams at the same time is invalid,
    because at least on Windows `uv_fs_read()` is race-y.
    
    Therefore, warn against such usage.
    
    PR-URL: nodejs#18762
    Reviewed-By: Benjamin Gruenbaum <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    a10b365 View commit details
    Browse the repository at this point in the history
  55. src: add nullptr check for session in DEBUG macro

    Currenlty when configuring --debug-http2
    /test/parallel/test-http2-getpackedsettings.js will segment fault:
    
    $ out/Debug/node test/parallel/test-http2-getpackedsettings.js
    Segmentation fault: 11
    
    This is happening because the settings is created with the Environment in
    PackSettings:
    Http2Session::Http2Settings settings(env);
    This will cause the session to be set to nullptr. When the init
    function is later called the expanded DEBUG_HTTP2SESSION macro will
    cause the segment fault when the session is dereferenced.
    
    PR-URL: nodejs#18815
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    danbev authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    c32ac60 View commit details
    Browse the repository at this point in the history
  56. doc: fix typo in http2.md

    PR-URL: nodejs#18872
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Michael Dawson <[email protected]>
    vsemozhetbyt authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    7c2bc72 View commit details
    Browse the repository at this point in the history
  57. deps,src: align ssize_t ABI between Node & nghttp2

    Previously, we performed casts that are considered undefined behavior.
    Instead, just define `ssize_t` for nghttp2 the same way we define it
    for the rest of Node.
    
    Also, remove a TODO comment that would probably also be *technically*
    correct but shouldn’t matter as long as nobody is complaining.
    
    PR-URL: nodejs#18565
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Ben Noordhuis <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    addaleax authored and kjin committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    ab416d7 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2018

  1. http2: fix condition where data is lost

    PR-URL: nodejs#18895
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    mcollina authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    0cdcd58 View commit details
    Browse the repository at this point in the history
  2. http2: send error text in case of ALPN mismatch

    Send a human-readable HTTP/1 response in case of an unexpected
    ALPN protocol. This helps with debugging this condition,
    since previously the only result of it would be a closed socket.
    
    PR-URL: nodejs#18986
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Gus Caplan <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    addaleax authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    265baaf View commit details
    Browse the repository at this point in the history
  3. http2: use original error for cancelling pending streams

    Previously, if `session.destroy()` was called with an error object,
    the information contained in it would be discarded and a generic
    `ERR_HTTP2_STREAM_CANCEL` would be used for all pending streams.
    
    Instead, make the information from the original error object
    available.
    
    PR-URL: nodejs#18988
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    addaleax authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    78b6542 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c46ee1f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    74212aa View commit details
    Browse the repository at this point in the history
  6. http2: fix flaky test-http2-https-fallback

    The test was flaky because it relied on a specific order of
    asynchronous operation that were fired paralellely. This was true
    on most platform and conditions, but not all the time.
    
    See: nodejs#18986
    
    PR-URL: nodejs#19093
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    mcollina authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    16e9b8d View commit details
    Browse the repository at this point in the history
  7. http2: no stream destroy while its data is on the wire

    This fixes a crash that occurred when a `Http2Stream` write
    is completed after it is already destroyed.
    
    Instead, don’t destroy the stream in that case and wait for
    GC to take over.
    
    Backport-PR-URL: nodejs#19185
    PR-URL: nodejs#19002
    Fixes: nodejs#18973
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    addaleax authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    4188136 View commit details
    Browse the repository at this point in the history
  8. doc: add note about browsers and HTTP/2

    PR-URL: nodejs#19476
    Reviewed-By: Trivikram Kamat <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Vse Mozhet Byt <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    styfle authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    89c42a3 View commit details
    Browse the repository at this point in the history
  9. http2: remove some unnecessary next ticks

    PR-URL: nodejs#19451
    Reviewed-By: Matteo Collina <[email protected]>
    jasnell authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    c0c9664 View commit details
    Browse the repository at this point in the history
  10. doc: rename HTTP2 to HTTP/2

    Previously, "HTTP/2" was strictly used to describe the protocol, and
    HTTP2 the module. This distinction is deemed unnecessary, and
    consistency between the two terms is enforced.
    
    PR-URL: nodejs#19603
    Reviewed-By: Vse Mozhet Byt <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Tobias Nießen <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Trivikram Kamat <[email protected]>
    Reviewed-By: Chen Gang <[email protected]>
    Reviewed-By: Shingo Inoue <[email protected]>
    TimothyGu authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    f6387a4 View commit details
    Browse the repository at this point in the history
  11. test: http2 stream.respond() error checks

    Backport-PR-URL: nodejs#19579
    PR-URL: nodejs#18861
    Reviewed-By: James M Snell <[email protected]>
    trivikr authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    3ba1beb View commit details
    Browse the repository at this point in the history
  12. http2: destroy() stream, upon errnoException

    First steps towards nodejs#19060
    
    PR-URL: nodejs#19389
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    SirR4T authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    d932237 View commit details
    Browse the repository at this point in the history
  13. doc: guard against md list parsing edge case

    PR-URL: nodejs#19647
    Reviewed-By: Trivikram Kamat <[email protected]>
    Reviewed-By: Rich Trott <[email protected]>
    Reviewed-By: Chen Gang <[email protected]>
    Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    vsemozhetbyt authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    0682140 View commit details
    Browse the repository at this point in the history
  14. test: http2 errors on req.close()

    Backport-PR-URL: nodejs#19579
    PR-URL: nodejs#18854
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    trivikr authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    9d885b9 View commit details
    Browse the repository at this point in the history
  15. http2: callback valid check before closing request

    Do not close the request if callback is not a function, and
    throw ERR_INVALID_CALLBACK TypeError
    
    Backport-PR-URL: nodejs#19229
    PR-URL: nodejs#19061
    Fixes: nodejs#18855
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Ruben Bridgewater <[email protected]>
    Reviewed-By: Shingo Inoue <[email protected]>
    Reviewed-By: Tobias Nießen <[email protected]>
    trivikr authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    dedf0c0 View commit details
    Browse the repository at this point in the history
  16. doc, http2: add sections for server.close()

    Clarify current behavior of http2server.close() and
    http2secureServer.close() w.r.t. perceived differences
    when compared with httpServer.close().
    
    Fixes: nodejs#19711
    
    PR-URL: nodejs#19802
    Reviewed-By: Vse Mozhet Byt <[email protected]>
    Reviewed-By: Trivikram Kamat <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    chrismilleruk authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    7d3ff81 View commit details
    Browse the repository at this point in the history
  17. doc: add Http2Session.connecting property

    PR-URL: nodejs#19842
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    pietermees authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    c53bc0f View commit details
    Browse the repository at this point in the history
  18. http2: emit session connect on next tick

    PR-URL: nodejs#19842
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    pietermees authored and kjin committed May 1, 2018
    Configuration menu
    Copy the full SHA
    b2fd504 View commit details
    Browse the repository at this point in the history