diff options
author | Daniel Stenberg <daniel@haxx.se> | 2009-10-01 07:05:07 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2009-10-01 07:05:07 +0000 |
commit | 5ed274d0b7483085d5d8642daddace93b41316e7 (patch) | |
tree | 60d07f1fb3d30d6218945f5b40e262931f6b5c14 /lib | |
parent | 4271f44a9ec2d505bdf506e1959850c35ee756a6 (diff) |
- Constantine Sapuntzakis: The current implementation will always set
SO_SNDBUF to CURL_WRITE_SIZE even if the SO_SNDBUF starts out larger. The
patch doesn't do a setsockopt if SO_SNDBUF is already greater than
CURL_WRITE_SIZE. This should help folks who have set up their computer with
large send buffers.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/connect.c | 7 |
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 |