Skip to content

http: PRI upgrade should return PAUSED_H2_UPGRADE#95

Closed
indutny wants to merge 1 commit intomasterfrom
fix/pri-upgrade
Closed

http: PRI upgrade should return PAUSED_H2_UPGRADE#95
indutny wants to merge 1 commit intomasterfrom
fix/pri-upgrade

Conversation

@indutny
Copy link
Copy Markdown
Member

@indutny indutny commented Apr 4, 2021

PAUSED_UPGRADE is a recoverable error and should not be returned when
parsing HTTP/2 PRI /... preambule, which is the last message that can
be parsed on the stream.


@pallas could you give this a quick review when you'll get a chance? I've tried updating llhttp in Node.js and quickly ran into this issue. Basically, our documentation says that llhttp_resume_after_upgrade should be called after PAUSED_UPGRADE, and it resets the .error to 0, but in reality the parser is in non-recoverable state! This is a breaking change, but I'm going to treat it as a bugfix and do a minor release for all branches once landed.

cc @nodejs/http @nodejs/http2 as well

`PAUSED_UPGRADE` is a recoverable error and should not be returned when
parsing HTTP/2 `PRI /...` preambule, which is the last message that can
be parsed on the stream.
Copy link
Copy Markdown
Contributor

@dnlup dnlup left a comment

Choose a reason for hiding this comment

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

So, if I understood these changes correctly, ERROR.PAUSED_H2_UPGRADE is returned instead of ERROR.PAUSED_UPGRADE in http2, which is not a recoverable error. ERROR.PAUSED_UPGRADE behavior is unchanged in http/1.1. Thanks for the heads up

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

indutny added a commit that referenced this pull request Apr 6, 2021
`PAUSED_UPGRADE` is a recoverable error and should not be returned when
parsing HTTP/2 `PRI /...` preambule, which is the last message that can
be parsed on the stream.

PR-URL: #95
Reviewed-By: Daniele Belardi <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@indutny
Copy link
Copy Markdown
Member Author

indutny commented Apr 6, 2021

Landed in 374434d, thank you.

indutny added a commit that referenced this pull request Apr 6, 2021
`PAUSED_UPGRADE` is a recoverable error and should not be returned when
parsing HTTP/2 `PRI /...` preambule, which is the last message that can
be parsed on the stream.

PR-URL: #95
Reviewed-By: Daniele Belardi <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@indutny
Copy link
Copy Markdown
Member Author

indutny commented Apr 6, 2021

Released v4.1.0 and v5.1.0

@indutny indutny closed this Apr 6, 2021
@indutny indutny deleted the fix/pri-upgrade branch April 6, 2021 16:13
@pallas
Copy link
Copy Markdown
Contributor

pallas commented Apr 6, 2021

Sorry I missed this, LGTM as well

elijah-charbel added a commit to elijah-charbel/llhttp that referenced this pull request Jul 29, 2025
`PAUSED_UPGRADE` is a recoverable error and should not be returned when
parsing HTTP/2 `PRI /...` preambule, which is the last message that can
be parsed on the stream.

PR-URL: nodejs/llhttp#95
Reviewed-By: Daniele Belardi <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants