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

quic: implement various utilities classes to be used by the quic impl #47263

Closed
wants to merge 11 commits into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Mar 27, 2023

In an attempt to make #44325 easier to review, I'm going to start pulling chunks of it out into separate PRs. This PR adds implementations for a number of utility classes used in the implementation. Unfortunately, breaking things up like this makes it a bit more difficult to review for correct usage since these are not yet being used, but my hope is that by splitting things up like this folks can actually give reasonable review for the individual pieces. I anticipate opening several more smaller PRs before we get to the primary chunk of the actual implementation.

This PR is split into several individual commits. It will be easiest to review each commit individually.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp

@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. needs-ci PRs that need a full CI run. labels Mar 27, 2023
@jasnell jasnell mentioned this pull request Mar 27, 2023
@jasnell
Copy link
Member Author

jasnell commented Mar 27, 2023

@jasnell jasnell changed the title quic: add the CID implementation quic: implement various utilities classes to be used by the quic impl Mar 27, 2023
@jasnell jasnell added dont-land-on-v14.x dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. quic Issues and PRs related to the QUIC implementation / HTTP/3. labels Mar 27, 2023
src/quic/cid.h Outdated Show resolved Hide resolved
src/quic/cid.h Outdated Show resolved Hide resolved
src/quic/data.cc Outdated Show resolved Hide resolved
src/quic/cid.h Outdated Show resolved Hide resolved
src/quic/data.cc Outdated Show resolved Hide resolved
src/quic/cid.cc Outdated Show resolved Hide resolved
src/quic/cid.h Show resolved Hide resolved
src/quic/data.cc Outdated Show resolved Hide resolved
src/quic/preferredaddress.cc Show resolved Hide resolved
src/quic/preferredaddress.cc Outdated Show resolved Hide resolved
src/quic/preferredaddress.cc Show resolved Hide resolved
src/quic/preferredaddress.h Show resolved Hide resolved
@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 27, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 27, 2023
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Mar 28, 2023

Copy link
Member

@Qard Qard 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 some suggestions. One inline and another is: I see a bunch of use of both std::optional and Maybe. Is there a reason we can't (or should not) just use Maybe everywhere? 🤔

src/quic/cid.cc Outdated Show resolved Hide resolved
@RaisinTen
Copy link
Contributor

Is there a reason we can't (or should not) just use Maybe everywhere?

A Maybe should be used if a function needs to propagate info about whether a V8 exception is being thrown. Using Maybe instead of optional would make it look like an exception has been thrown when a function returns a nullopt but that's not true for the functions that are using optionals in this PR.

@jasnell
Copy link
Member Author

jasnell commented Mar 28, 2023

Definitely agree that having both v8::Maybe and std::optional is annoying but the semantics for v8::Maybe are pretty clear. It's not what I'd want ideally but I think the current code is the currently better approach.

@jasnell jasnell added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed needs-ci PRs that need a full CI run. labels Mar 28, 2023
@nodejs-github-bot

This comment was marked as outdated.

@jasnell
Copy link
Member Author

jasnell commented Mar 28, 2023

CI passed. Made one additional edit as suggested by @Qard so running CI again. The plan is to squash all the commits down into one when this lands. Started preparing the second PR. lol...

update: sigh, forgot to actually push the new commit.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@Qard
Copy link
Member

Qard commented Mar 28, 2023

Generally speaking, it's more MaybeLocal that the Nothing could represent a pending exception. That's usually not the case with Maybe. It's quite often used in V8 as a direct replacement for std::optional only. I'm fine if we want to keep V8 things distinct from our own stuff though. :)

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Mar 28, 2023

jasnell added a commit that referenced this pull request Mar 29, 2023
* add the CID implementation
* add the PreferredAddress implementation
* add Path and PathStorage implementations
* add Store implementation
* add QuicError implementation

PR-URL: #47263
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@jasnell
Copy link
Member Author

jasnell commented Mar 29, 2023

Landed in 09a4bb1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. lib / src Issues and PRs related to general changes in the lib or src directory. quic Issues and PRs related to the QUIC implementation / HTTP/3.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants