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
@ -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 we're not blocking then return.
|
||||||
*/
|
*/
|
||||||
if (!blocking)
|
if (!blocking) {
|
||||||
|
_FD_UNLOCK(s, FD_WRITE);
|
||||||
|
_FD_UNLOCK(fd, FD_READ);
|
||||||
goto SHORT_WRITE;
|
goto SHORT_WRITE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Otherwise wait on the fd.
|
* Otherwise wait on the fd.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user