-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
socket.c: Return -1 in poll_read if read returns 0.
Currently, bbs_poll_read and bbs_node_poll_read both return the return value from poll and read unmodified. However, this can lead to callers misinterpreting the return value when read returns 0, and this is treated as a poll timeout, since these cannot be differentiated. We could expand the return values to differentiate better (e.g. return -2 for poll failure), but most existing usage of these APIs already assume a return value of 0 is from poll and treats negative return values as failure, so just return -1 if read returns 0 to make everything "just work". In particular, this now ensures that the SMTP server does not try to send a "451 timeout" message when a client disconnects.
- Loading branch information
1 parent
8d3f6cf
commit a1725e4
Showing
3 changed files
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters