aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/tcpserver.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/tcpserver.c b/net/tcpserver.c
index 48f55a1..9b7ef4e 100644
--- a/net/tcpserver.c
+++ b/net/tcpserver.c
@@ -415,6 +415,7 @@ static size_t tcpserver_send_buf(int client, int sockfd, char *byte_buf, size_t
bp += result;
}
}
+ else return sent;/* abandon any further attempts to send so we don't block */
}
return sent;
}
@@ -607,11 +608,15 @@ static int tcpserver_set_socket_send_buf_size(int sockfd, int size)
int optLen = sizeof(int);
#ifdef MSW
if (setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char*)&optVal, optLen) == SOCKET_ERROR)
+ {
post("%s_set_socket_send_buf_size: setsockopt returned %d\n", objName, WSAGetLastError());
#else
if (setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char*)&optVal, optLen) == -1)
+ {
post("%s_set_socket_send_buf_size: setsockopt returned %d\n", objName, errno);
#endif
+ return 0;
+ }
else return (tcpserver_get_socket_send_buf_size(sockfd));
}