summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2020-09-16 15:02:42 +0200
committerGravatar Nikias Bassen2020-09-16 15:02:42 +0200
commit73cb5c182e36e7aafcff8a8932b21c6ab5cae5a6 (patch)
treeb7209184bf4d236765c862342676f866ce0f279d
parentc7d7d1a03f65a27be2eddb13d1f2b0c0e7a60ec6 (diff)
downloadlibusbmuxd-73cb5c182e36e7aafcff8a8932b21c6ab5cae5a6.tar.gz
libusbmuxd-73cb5c182e36e7aafcff8a8932b21c6ab5cae5a6.tar.bz2
common: Increase timeout for socket_send() to reasonable value
The short timeout of 1000 ms might cause problems in different situations like a firmware restore, where 1000 ms can easily be hit. Increasing this to a higher value will mitigate it for this case, but actually the error handling at a higher level needs to be improved.
-rw-r--r--common/socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/socket.c b/common/socket.c
index fd89c56..47c0903 100644
--- a/common/socket.c
+++ b/common/socket.c
@@ -51,6 +51,7 @@ static int wsa_init = 0;
#include "socket.h"
#define RECV_TIMEOUT 20000
+#define SEND_TIMEOUT 10000
#define CONNECT_TIMEOUT 5000
#ifndef EAFNOSUPPORT
@@ -852,7 +853,7 @@ int socket_receive_timeout(int fd, void *data, size_t length, int flags,
int socket_send(int fd, void *data, size_t length)
{
int flags = 0;
- int res = socket_check_fd(fd, FDM_WRITE, 1000);
+ int res = socket_check_fd(fd, FDM_WRITE, SEND_TIMEOUT);
if (res <= 0) {
return res;
}