cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-2783090 ] Uploads slow on Windows - nonblocking send issue

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Tue, 28 Apr 2009 20:27:27 +0000

Bugs item #2783090, was opened at 2009-04-28 20:51
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2783090&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: http
>Group: bad behaviour
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Constantine Sapuntzakis (csapuntz)
Assigned to: Daniel Stenberg (bagder)
Summary: Uploads slow on Windows - nonblocking send issue

Initial Comment:
Upload speeds are capped at 80kb/sec due to a Windows Sockets API behavior w/non-blocking sockets and send.

The issue and an incorrect fix are described in Microsoft KB article: http://support.microsoft.com/kb/823764

Setting the setsockopt handler below fixed the problem:

static int set_sockopts(void * clientp, curl_socket_t sockfd, curlsocktype purpose) {
    // See http://support.microsoft.com/kb/823764
#ifdef _WIN32
    int val = CURL_MAX_WRITE_SIZE * 2 + 32;
    setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (const char *)&val, sizeof(val));
#endif

    return 0;
}

I suggest this setsockopt logic be integrated into libcurl to save others from spending a day or more tracking down the issue.

----------------------------------------------------------------------

>Comment By: Daniel Stenberg (bagder)
Date: 2009-04-28 22:27

Message:
Thanks for the report and details. I've now committed a fix, but I made the
buffer only 32 bytes larger as friends at MS confirmed that to be enough.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2783090&group_id=976
Received on 2009-04-28

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET