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

Linux: Always retry with an actually smaller size on `ENOBUFS` #69

Merged
merged 1 commit into from May 6, 2016

Conversation

@antrik
Copy link
Contributor

antrik commented May 5, 2016

Previously, if we got ENOBUFS while the packet we tried to send was
already less than half the maximum send buffer size, we would end up
with a new buffer size that was still larger than the actual packet...

Aside from being nonsensical, this would actually result in buggy
behaviour if the message was smaller than half the buffer size to begin
with, as the fragmented send code works from the assumption that the
message is larger than the fragment size, and will fail otherwise.

(In my testing, I never actually got ENOBUFS with packets smaller than
half the maximum buffer size -- but let's assume we might...)

Previously, if we got `ENOBUFS` while the packet we tried to send was
already less than half the maximum send buffer size, we would end up
with a new buffer size that was still larger than the actual packet...

Aside from being nonsensical, this would actually result in buggy
behaviour if the message was smaller than half the buffer size to begin
with, as the fragmented send code works from the assumption that the
message is larger than the fragment size, and will fail otherwise.

(In my testing, I never actually got `ENOBUFS` with packets smaller than
half the maximum buffer size -- but let's assume we might...)
@antrik
Copy link
Contributor Author

antrik commented May 5, 2016

AppVeyor having a bad day?...

@metajack
Copy link

metajack commented May 5, 2016

@pcwalton
Copy link
Collaborator

pcwalton commented May 6, 2016

@bors-servo
Copy link
Contributor

bors-servo commented May 6, 2016

📌 Commit 9daada2 has been approved by pcwalton

@bors-servo
Copy link
Contributor

bors-servo commented May 6, 2016

Testing commit 9daada2 with merge 792e79f...

bors-servo added a commit that referenced this pull request May 6, 2016
Linux: Always retry with an actually smaller size on `ENOBUFS`

Previously, if we got `ENOBUFS` while the packet we tried to send was
already less than half the maximum send buffer size, we would end up
with a new buffer size that was still larger than the actual packet...

Aside from being nonsensical, this would actually result in buggy
behaviour if the message was smaller than half the buffer size to begin
with, as the fragmented send code works from the assumption that the
message is larger than the fragment size, and will fail otherwise.

(In my testing, I never actually got `ENOBUFS` with packets smaller than
half the maximum buffer size -- but let's assume we might...)
@bors-servo
Copy link
Contributor

bors-servo commented May 6, 2016

☀️ Test successful - travis

@bors-servo bors-servo merged commit 9daada2 into servo:master May 6, 2016
1 of 3 checks passed
1 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
homu Testing commit 9daada2 with merge 792e79f...
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.