aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/connect.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/connect.c b/lib/connect.c
index 2a6b003e0..aaeee6762 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -664,6 +664,13 @@ static void nosigpipe(struct connectdata *conn,
void Curl_sndbufset(curl_socket_t sockfd)
{
int val = CURL_MAX_WRITE_SIZE + 32;
+ int curval = 0;
+ int curlen = sizeof(curval);
+
+ if (getsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char *)&curval, &curlen) == 0)
+ if (curval > val)
+ return;
+
setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (const char *)&val, sizeof(val));
}
#endif