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

Move non-conn code out of conn.rs #2775

Merged
merged 3 commits into from
Apr 9, 2022

Conversation

SabrinaJewson
Copy link
Contributor

The actual code for Server was previously organized very confusingly: it was thrice layered with SpawnAll and Serve which both appeared in conn.rs despite not having anything to do with the lower-level conn API. This PR changes that, removing all layering and having the code for the higher-level Server appear inside server.rs only.

The actual code for `Server` was previously organized very confusingly:
it was thrice layered with `SpawnAll` and `Serve` which both appeared in
conn.rs despite not having anything to do with the lower-level conn API.
This commit changes that, removing all layering and having the code for
the higher-level `Server` appear inside `server.rs` only.
`server.rs` is currently littered with `cfg`s for `http1` or `http2`,
since the majority of server behaviour is only available with either one
of those feature flags active. This is hard to maintain and confusing to
read, so this commit extracts the two implementations into their own
files, since there is very little benefit in sharing code between the
two.
@seanmonstar
Copy link
Member

Oh thanks for doing this! Yea, the server module didn't used to have separate files, and so some parts didn't get moved cleanly. I like this!

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

Sorry it took so long to get back to review. Wow, this is quality stuff! And I appreciate that it likely was rather tedious, thanks for cleaning this up!

@seanmonstar seanmonstar merged commit e3ee1de into hyperium:master Apr 9, 2022
@SabrinaJewson SabrinaJewson deleted the server-refactor branch April 9, 2022 10:39
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.

None yet

2 participants