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

Upgrade daphne-server to http 1 #719

Merged
merged 3 commits into from
Nov 27, 2024
Merged

Upgrade daphne-server to http 1 #719

merged 3 commits into from
Nov 27, 2024

Conversation

mendess
Copy link
Collaborator

@mendess mendess commented Nov 19, 2024

Upgrades to http 1 and axum 0.7, which is a breaking change but for us means a simplification of the code as we no longer have to care about the Body of a request, it is now axum::body::Body instead of being generic.

@mendess mendess self-assigned this Nov 19, 2024
@mendess mendess marked this pull request as draft November 19, 2024 17:06
@mendess mendess force-pushed the mendess/upgrade-to-http-1 branch from 3072f17 to 2800ab7 Compare November 22, 2024 14:01
@mendess mendess marked this pull request as ready for review November 22, 2024 14:04
@mendess mendess force-pushed the mendess/upgrade-to-http-1 branch 2 times, most recently from 9572f3e to 7f43f65 Compare November 22, 2024 14:44
Copy link
Contributor

@armfazh armfazh left a comment

Choose a reason for hiding this comment

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

two nits only

crates/daphne-server/examples/service.rs Show resolved Hide resolved
@@ -177,7 +175,7 @@ where

// TODO(mendess): this allocates needlessly, if prio supported some kind of
// AsyncParameterizedDecode we could avoid this allocation
let payload = hyper::body::to_bytes(body).await;
let payload = axum::body::to_bytes(body, usize::MAX).await;
Copy link
Contributor

Choose a reason for hiding this comment

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

we may want to only accept a certain amount of bytes based on the payload we are expecting. currently this is not supported, right?

Copy link
Collaborator Author

@mendess mendess Nov 25, 2024

Choose a reason for hiding this comment

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

Yes, I'm gonna open an issue. The previous implementation didn't allow limiting this so I kept it "the same" but we should investigate if we can deduce a sane limit we can put here

#721

@mendess mendess force-pushed the mendess/upgrade-to-http-1 branch 4 times, most recently from 6c1d3d8 to 2596cf6 Compare November 27, 2024 11:52
@mendess mendess force-pushed the mendess/upgrade-to-http-1 branch from ffea5c1 to 20895c3 Compare November 27, 2024 14:12
@mendess mendess merged commit f94f8d0 into main Nov 27, 2024
3 checks passed
@mendess mendess deleted the mendess/upgrade-to-http-1 branch November 27, 2024 14:24
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.

2 participants