When reading or writing multiple iovecs, if an error occurs after the first one, the byte count of the previous successful operation is discarded.
In the case of EWOULDBLOCK, the application will try again, and will end up sending duplicate output or discarding valid input. It is safer to return -1 only if nothing was transmitted.
Just noticed this potential bug.
When reading or writing multiple iovecs, if an error occurs after the first one, the byte count of the previous successful operation is discarded. In the case of
EWOULDBLOCK
, the application will try again, and will end up sending duplicate output or discarding valid input. It is safer to return -1 only if nothing was transmitted.