Use a bigger timeout when buffers are empty
This commit is contained in:
@@ -1388,9 +1388,12 @@ int main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct timeval timeout = {
|
struct timeval timeout = {
|
||||||
.tv_usec = 1000,
|
.tv_usec = 100000,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (buffer_read_size(&sock.write))
|
||||||
|
timeout.tv_usec = 1000;
|
||||||
|
|
||||||
if _0_(select(sock.fd+1, &rfds, NULL, NULL, &timeout)==-1) {
|
if _0_(select(sock.fd+1, &rfds, NULL, NULL, &timeout)==-1) {
|
||||||
if (errno==EINTR)
|
if (errno==EINTR)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user