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

[v8.x backport] backport 17338, 18186, 18358, 18546 #19191

Closed

Commits on May 2, 2018

  1. http2: add http fallback options to .createServer

    This adds the Http1IncomingMessage and Http1ServerReponse options
    to http2.createServer().
    
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#15752
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Evan Lucas <evanlucas@me.com>
    hekike authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    58478d8 View commit details
    Browse the repository at this point in the history
  2. http: add options to http.createServer()

    This adds the optional options argument to `http.createServer()`.
    It contains two options: the `IncomingMessage` and `ServerReponse`
    option.
    
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#15752
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Evan Lucas <evanlucas@me.com>
    Peter Marton authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    5ea29ef View commit details
    Browse the repository at this point in the history
  3. 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.
    
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#15560
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Peter Marton authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    ae2ebde View commit details
    Browse the repository at this point in the history
  4. http2: use _final instead of on('finish')

    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#18609
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    addaleax authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    28a2729 View commit details
    Browse the repository at this point in the history
  5. 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.
    
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#18762
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    addaleax authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    8b234f5 View commit details
    Browse the repository at this point in the history
  6. 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.
    
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#18815
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    danbev authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    c6a9abd View commit details
    Browse the repository at this point in the history
  7. doc: fix typo in http2.md

    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#18872
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
    vsemozhetbyt authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    d85e5f4 View commit details
    Browse the repository at this point in the history
  8. 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.
    
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#18565
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    addaleax authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    55cf145 View commit details
    Browse the repository at this point in the history
  9. http2: fix condition where data is lost

    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#18895
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    mcollina authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    b1d95ec View commit details
    Browse the repository at this point in the history
  10. 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.
    
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#18986
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Gus Caplan <me@gus.host>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    addaleax authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    1029369 View commit details
    Browse the repository at this point in the history
  11. 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.
    
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#18988
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    addaleax authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    0379350 View commit details
    Browse the repository at this point in the history
  12. http2: fix endless loop when writing empty string

    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#18924
    Fixes: nodejs#18169
    Refs: nodejs#18673
    Refs: https://github.com/nodejs/node/blob/v9.5.0/src/node_http2.cc#L1481-L1484
    Refs: https://github.com/nodejs/node/blob/v9.5.0/lib/_http_outgoing.js#L659-L661
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Khaidi Chu <i@2333.moe>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    addaleax authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    1f3ab4f View commit details
    Browse the repository at this point in the history
  13. test: check endless loop while writing empty string

    Refs: nodejs#18673
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#18924
    Refs: nodejs#18673
    Refs: https://github.com/nodejs/node/blob/v9.5.0/src/node_http2.cc#L1481-L1484
    Refs: https://github.com/nodejs/node/blob/v9.5.0/lib/_http_outgoing.js#L659-L661
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    XadillaX authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    199d9a5 View commit details
    Browse the repository at this point in the history
  14. 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
    
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#19093
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    mcollina authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    10aaa74 View commit details
    Browse the repository at this point in the history
  15. 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
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#19002
    Fixes: nodejs#18973
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    addaleax authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    f165e9f View commit details
    Browse the repository at this point in the history
  16. doc: add note about browsers and HTTP/2

    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#19476
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    styfle authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    8daddfb View commit details
    Browse the repository at this point in the history
  17. http2: remove some unnecessary next ticks

    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#19451
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    jasnell authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    0137eb7 View commit details
    Browse the repository at this point in the history
  18. 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.
    
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#19603
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Tobias Nießen <tniessen@tnie.de>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Chen Gang <gangc.cxy@foxmail.com>
    Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
    TimothyGu authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    8f55971 View commit details
    Browse the repository at this point in the history
  19. test: http2 stream.respond() error checks

    Backport-PR-URL: nodejs#19579
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#18861
    Reviewed-By: James M Snell <jasnell@gmail.com>
    trivikr authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    9c7bf7f View commit details
    Browse the repository at this point in the history
  20. http2: destroy() stream, upon errnoException

    First steps towards nodejs#19060
    
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#19389
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    SirR4T authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    519b063 View commit details
    Browse the repository at this point in the history
  21. doc: guard against md list parsing edge case

    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#19647
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: Chen Gang <gangc.cxy@foxmail.com>
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    vsemozhetbyt authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    22eddf1 View commit details
    Browse the repository at this point in the history
  22. test: http2 errors on req.close()

    Backport-PR-URL: nodejs#19579
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#18854
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    trivikr authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    f5a2cd5 View commit details
    Browse the repository at this point in the history
  23. 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
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#19061
    Fixes: nodejs#18855
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
    Reviewed-By: Tobias Nießen <tniessen@tnie.de>
    trivikr authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    af7c7cb View commit details
    Browse the repository at this point in the history
  24. 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
    
    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#19802
    Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    chrismilleruk authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    3a890a8 View commit details
    Browse the repository at this point in the history
  25. doc: add Http2Session.connecting property

    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#19842
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    pietermees authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    4dc0b3c View commit details
    Browse the repository at this point in the history
  26. http2: emit session connect on next tick

    Backport-PR-URL: nodejs#20456
    PR-URL: nodejs#19842
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    pietermees authored and MylesBorins committed May 2, 2018
    Configuration menu
    Copy the full SHA
    c83098a View commit details
    Browse the repository at this point in the history
  27. src: expose uv.errmap to binding

    Add a errno -> [error code, uv error message] map to the uv binding
    so the error message can be assembled in the JS layer.
    
    PR-URL: nodejs#17338
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    joyeecheung committed May 2, 2018
    Configuration menu
    Copy the full SHA
    1f35b8f View commit details
    Browse the repository at this point in the history
  28. util: implement util.getSystemErrorName()

    Reimplement uv.errname() as internal/util.getSystemErrorName() to
    avoid the memory leaks caused by unknown error codes
    and avoid calling into C++ for the error names. Also
    expose it as a public API for external use.
    
    PR-URL: nodejs#18186
    Refs: http://docs.libuv.org/en/v1.x/errors.html#c.uv_err_name
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    joyeecheung committed May 2, 2018
    Configuration menu
    Copy the full SHA
    d501138 View commit details
    Browse the repository at this point in the history
  29. errors: lazy load util in internal/errors.js

    PR-URL: nodejs#18358
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Jon Moss <me@jonathanmoss.me>
    joyeecheung committed May 2, 2018
    Configuration menu
    Copy the full SHA
    a3754e7 View commit details
    Browse the repository at this point in the history
  30. util: skip type checks in internal getSystemErrorName

    PR-URL: nodejs#18546
    Reviewed-By: James M Snell <jasnell@gmail.com>
    joyeecheung committed May 2, 2018
    Configuration menu
    Copy the full SHA
    2179547 View commit details
    Browse the repository at this point in the history
  31. errors: move error creation helpers to errors.js

    This commit moves error creation helpers scattered around
    under lib/ into lib/internal/errors.js in the hope of being clearer
    about the differences of errors that we throw into the user land.
    
    - Move util._errnoException and util._exceptionWithHostPort
      into internal/errors.js and simplify their logic so it's
      clearer what the properties these helpers create.
    - Move the errnoException helper in dns.js to internal/errors.js
      into internal/errors.js and rename it to dnsException. Simplify
      it's logic so it no longer calls errnoException and skips
      the unnecessary argument checks.
    
    PR-URL: nodejs#18546
    Reviewed-By: James M Snell <jasnell@gmail.com>
    joyeecheung committed May 2, 2018
    Configuration menu
    Copy the full SHA
    d8b637f View commit details
    Browse the repository at this point in the history
  32. errors: make message non-enumerable

    A error message should always be non-enumerable. This makes sure
    that is true for dns errors as well. It also adds another check
    in `common.expectsError` to make sure no other regressions are
    introduced going forward.
    
    Fixes nodejs#19716
    
    PR-URL: nodejs#19719
    Fixes: nodejs#19716
    Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    BridgeAR authored and joyeecheung committed May 2, 2018
    Configuration menu
    Copy the full SHA
    74e3b14 View commit details
    Browse the repository at this point in the history