Skip to content

Fix broken connection after interrupted write - #60

Closed
suyjuris wants to merge 1 commit into
jeremycw:masterfrom
suyjuris:master
Closed

suyjuris wants to merge 1 commit into
jeremycw:masterfrom
suyjuris:master

Conversation

@suyjuris

@suyjuris suyjuris commented Dec 2, 2021

Copy link
Copy Markdown

Fixes #59.

When writing the answer to an HTTP request into the socket, the write might have to proceed in multiple parts. (E.g. if the receiver is not able to receive the data fast enough.) To deal with this situation, the server continues execution after a partial write, but changes the flag on the request's epoll object to trigger once the request's socket becomes writable again. However, once the response is fully written, the flags are not changed back, so that subsequent requests (for a keep-alive connection) do not trigger epoll, resulting in the server missing requests.

When writing the answer to an HTTP request into the socket, the write might have to proceed in multiple parts. (E.g. if the receiver is not able to receive the data fast enough.) To deal with this situation, the server continues execution after a partial write, but changes the flag on the request's epoll object to trigger once the request's socket becomes writable again. However, once the response is fully written, the flags are not changed back, so that subsequent requests (for a keep-alive connection) do not trigger epoll, resulting in the server missing requests.
@jeremycw

Copy link
Copy Markdown
Owner

I've incorporated a similar fix into the latest release.

@jeremycw jeremycw closed this Feb 16, 2023
@Arti171 Arti171 linked an issue Mar 30, 2023 that may be closed by this pull request
Open
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.

B Broken connection after interrupted write

2 participants