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

src,http2: DRY header/trailer handling code up #14688

Closed

Conversation

addaleax
Copy link
Member

@addaleax addaleax commented Aug 8, 2017

Remove duplicate code through minor refactoring.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

src/http2

Remove duplicate code through minor refactoring.
@addaleax addaleax added c++ Issues and PRs that require attention from people who are familiar with C++. http2 Issues or PRs related to the http2 subsystem. labels Aug 8, 2017
@addaleax addaleax requested a review from jasnell August 8, 2017 13:48
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Aug 8, 2017
Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

LGTM with a suggestion.

virtual void OnFreeSession() {}
virtual void AllocateSend(size_t suggested_size, uv_buf_t* buf) = 0;

virtual bool HasGetPaddingCallback() { return false; }

class SubmitTrailers {
public:
void operator ()(nghttp2_nv* trailers, size_t length) const;
Copy link
Member

Choose a reason for hiding this comment

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

Making this a normal method called .Send() or whatever is clearer, IMO. No risk of confusing method calls with plain function calls.

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

Woo! 🎈

@addaleax
Copy link
Member Author

addaleax commented Aug 9, 2017

@addaleax
Copy link
Member Author

Landed in d98606f

@addaleax addaleax closed this Aug 10, 2017
@addaleax addaleax deleted the http2-deduplicate-header-handling branch August 10, 2017 11:51
addaleax added a commit that referenced this pull request Aug 10, 2017
Remove duplicate code through minor refactoring.

PR-URL: #14688
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
jasnell pushed a commit to jasnell/node that referenced this pull request Aug 13, 2017
Remove duplicate code through minor refactoring.

PR-URL: nodejs#14688
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
addaleax added a commit that referenced this pull request Aug 14, 2017
Remove duplicate code through minor refactoring.

PR-URL: #14688
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
@addaleax addaleax mentioned this pull request Aug 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. http2 Issues or PRs related to the http2 subsystem. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants