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

Fix Unix socket EOF handling #1218

Merged
merged 1 commit into from
Nov 10, 2017
Merged

Conversation

benagricola
Copy link
Contributor

Hi @lukego, It looks like during the unix socket rewrite to remove select() a couple of months ago, the check for local bytes = S.read() returning 0 (EOF) was removed, and changed to if not bytes, which only catches errors, as ljsyscall converts -1 to a nil return value, and 0 is true.

This means EOF is not caught, so when the socket is terminated from the remote side, the app goes into a loop returning empty allocated packets.

This PR keeps handling for errors (not bytes) which includes EAGAIN and re-adds the bytes == 0 check for EOF - resetting the socket.

Signed-off-by: Ben Agricola <bagricola@squiz.co.uk>
@lukego
Copy link
Member

lukego commented Sep 8, 2017

Thanks Ben! Merged. cc @alexandergall who I know has been working on related apps recently and may need to cover this case too.

@eugeneia eugeneia merged commit 0508572 into snabbco:master Nov 10, 2017
dpino pushed a commit to dpino/snabb that referenced this pull request Apr 3, 2019
Bump snabb-softwire-v2 revision date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants