mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-02 08:42:48 +00:00
Fix a bug where a short write to a non-blocking socket would
leave the descriptor locked, causing other threads to hang if they happened to access the socket. MFC after: 5 days
This commit is contained in:
parent
9e68b78882
commit
9db56888ee
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91045
@ -139,8 +139,11 @@ _sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr,
|
||||
/*
|
||||
* If we're not blocking then return.
|
||||
*/
|
||||
if (!blocking)
|
||||
if (!blocking) {
|
||||
_FD_UNLOCK(s, FD_WRITE);
|
||||
_FD_UNLOCK(fd, FD_READ);
|
||||
goto SHORT_WRITE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Otherwise wait on the fd.
|
||||
|
Loading…
Reference in New Issue
Block a user