From 73cb5c182e36e7aafcff8a8932b21c6ab5cae5a6 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 16 Sep 2020 15:02:42 +0200 Subject: 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. --- common/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- cgit v1.1-32-gdbae