Use a bigger timeout when buffers are empty

This commit is contained in:
angt
2016-04-12 14:11:16 +00:00
parent 4246b510d2
commit c154a00358

View File

@@ -1388,9 +1388,12 @@ int main (int argc, char **argv)
}
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 (errno==EINTR)
continue;