Skip to content

http: free the parser before emitting 'upgrade' - #18209

Closed
lpinca wants to merge 1 commit into
nodejs:masterfrom
lpinca:free/parser-asap
Closed

http: free the parser before emitting 'upgrade'#18209
lpinca wants to merge 1 commit into
nodejs:masterfrom
lpinca:free/parser-asap

Conversation

@lpinca

@lpincalpinca commented Jan 17, 2018

Copy link
Copy Markdown
Member

The reason for this change is mainly to be consistent with the server but also to prevent an error from being thrown in the unlikely case where the user assigns something to the parser property when the 'upgrade' event is emitted.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

http

Ensure that the parser is freed before emitting the 'connect' or
'upgrade' event.
@nodejs-github-botnodejs-github-bot added the http Issues or PRs related to the http subsystem. label Jan 17, 2018
@maclover7

Copy link
Copy Markdown
Contributor

Would you be able to add a test case for the server-freeing-the-parser behavior as well? Otherwise LGTM

@maclover7

Copy link
Copy Markdown
Contributor

cc @nodejs/http

@lpinca

Copy link
Copy Markdown
MemberAuthor

@maclover7 the included test does that.

@addaleax

Copy link
Copy Markdown
Member

@indutnyindutny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good catch.

@maclover7maclover7 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 20, 2018
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Jan 21, 2018
Ensure that the parser is freed before emitting the 'connect' or
'upgrade' event.
PR-URL: nodejs#18209
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@BridgeAR

Copy link
Copy Markdown
Member

Landed in 93f1d9e

@lpinca
lpinca deleted the free/parser-asap branch January 24, 2018 15:45
evanlucas pushed a commit that referenced this pull request Jan 30, 2018
Ensure that the parser is freed before emitting the 'connect' or
'upgrade' event.
PR-URL: #18209
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@evanlucasevanlucas mentioned this pull request Jan 30, 2018
evanlucas pushed a commit that referenced this pull request Jan 30, 2018
Ensure that the parser is freed before emitting the 'connect' or
'upgrade' event.
PR-URL: #18209
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@MylesBorins

Copy link
Copy Markdown
Contributor

should this land on v6.x or v8.x? It lands cleanly for both

@lpinca

Copy link
Copy Markdown
MemberAuthor

@MylesBorins yes it should imho.

MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
Ensure that the parser is freed before emitting the 'connect' or
'upgrade' event.
PR-URL: #18209
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
Ensure that the parser is freed before emitting the 'connect' or
'upgrade' event.
PR-URL: #18209
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request Mar 28, 2018
Ensure that the parser is freed before emitting the 'connect' or
'upgrade' event.
PR-URL: #18209
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request Mar 28, 2018
Ensure that the parser is freed before emitting the 'connect' or
'upgrade' event.
PR-URL: #18209
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request Mar 30, 2018
Ensure that the parser is freed before emitting the 'connect' or
'upgrade' event.
PR-URL: #18209
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request Mar 30, 2018
Ensure that the parser is freed before emitting the 'connect' or
'upgrade' event.
PR-URL: #18209
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@MylesBorinsMylesBorins mentioned this pull request Apr 13, 2018
@MylesBorinsMylesBorins mentioned this pull request May 2, 2018
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
Ensure that the parser is freed before emitting the 'connect' or
'upgrade' event.
PR-URL: nodejs#18209
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.httpIssues or PRs related to the http subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@lpinca@maclover7@addaleax@BridgeAR@MylesBorins@indutny@jasnell@nodejs-github-bot