[go: nahoru, domu]

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

Simplify HTTP request body sending logic #671

Open
martinthomson opened this issue May 28, 2020 · 0 comments
Open

Simplify HTTP request body sending logic #671

martinthomson opened this issue May 28, 2020 · 0 comments
Labels
p3 Backlog

Comments

@martinthomson
Copy link
Member

I don't think that we need to be as careful with framing at this layer. If we get blocked, that only prevents us from sending other frames on the stream, which boils down to trailers (which we don't send) and control frames (which don't currently exist).

So I would suggest sending everything we have as possible. Then you only have to track how much data you have left to send in the current frame (i.e., SendMessageState::SendingData now has a usize parameter). The only probing you would then need to do is to work out whether the header of the frame fits in the available space, but you can do that with the atomic write.

An application that does have other things to send than data (in the future perhaps) might withhold data from the stack to make space, or we can revise this code and cap the size of writes in some way.

That should make this a lot less complex: Encode a DATA frame header, write it atomically then send whatever data from the provided buffer you can using the non-atomic send.

That also means that an application that attempts to send X bytes and only is able to send X-Y bytes must later send at least Y bytes or bad things will happen because we will otherwise be unable to fill the frame. It's worth documenting that constraint.

Originally posted by @martinthomson in https://github.com/mozilla/neqo/diffs

@agrover agrover added this to Needs triage in 2H 2020 bug triage Jun 1, 2020
@agrover agrover moved this from Needs triage to Medium Priority in 2H 2020 bug triage Jun 1, 2020
@ddragana ddragana added the p3 Backlog label Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3 Backlog
Projects
2H 2020 bug triage
Medium Priority
Development

No branches or pull requests

2 participants