forked from msantos/procket
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return number of bytes for partial writes
The write functions (sendto/4, sendmsg/5, write/2, writev/2) have had a long standing bug where failure to write the complete buffer was silently ignored. Return a tuple containing the number of bytes written if the complete buffer could not be sent. Writes can be continued using something like: write_exact(FD, Buf) -> case procket:write(FD, Buf) of ok -> ok; {ok, N} - > {_:N/bytes, Rest/binary} = Buf, write_exact(FD, Rest); Error -> Error end. Successful writes of the entire buffer still return 'ok'.
- Loading branch information
Showing
4 changed files
with
91 additions
and
29 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
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