mirror of
https://github.com/curl/curl.git
synced 2026-08-25 00:13:34 +03:00
- 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.
This commit is contained in:
parent
4271f44a9e
commit
5ed274d0b7
3 changed files with 17 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue