-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Refactor QUIC new connection handler function #26855
Conversation
0103c74
to
06b6e0f
Compare
Generally, it is a good idea to simplify original code by extracting functions. |
06b6e0f
to
6366cde
Compare
@KirillLykov, thanks for reviewing this PR. I have tried to functionally split the PR into three commits. Hopefully it makes it easier to view the code diff. The first two commits contain the most relevant diffs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked through it and didn't found any suspicious changes. Yet I would ask contributors to this part of code to check it as well
|
||
let remote_addr = connection.remote_address(); | ||
let remote_addr = new_connection.connection.remote_address(); | ||
let mut remote_pubkey = None; | ||
|
||
let table_and_stake = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A note: looks like table_and_stake
is not used and will be removed in the next commits
@@ -217,6 +217,94 @@ impl NewConnectionHandlerParams { | |||
} | |||
} | |||
|
|||
fn handle_and_cache_new_connection( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this commit just moves functions a bit up in the code, no changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* Refactor QUIC new connection handler function * cleanup setup_connection * more cleanup
* Refactor QUIC new connection handler function * cleanup setup_connection * more cleanup
* Refactor QUIC new connection handler function * cleanup setup_connection * more cleanup
Problem
setup_connection
function has gotten convoluted over time, and could use a refactor.Summary of Changes
Refactored the function into smaller blocks and also improve the code reuse.
Fixes #