aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES6
-rw-r--r--RELEASE-NOTES3
-rw-r--r--lib/connect.c23
3 files changed, 31 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 744422a43..605c8def4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,12 @@
Changelog
Daniel Stenberg (28 Apr 2009)
+- Constantine Sapuntzakis filed bug report #2783090
+ (http://curl.haxx.se/bug/view.cgi?id=2783090) pointing out that on windows
+ we need to grow the SO_SNDBUF buffer somewhat to get really good upload
+ speeds. http://support.microsoft.com/kb/823764 has the details. Friends
+ confirmed that simply adding 32 to CURL_MAX_WRITE_SIZE is enough.
+
- Bug report #2709004 (http://curl.haxx.se/bug/view.cgi?id=2709004) by Tim
Chen pointed out how curl couldn't upload with resume when reading from a
pipe.
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 77ad07fad..93b4855bd 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -34,6 +34,7 @@ This release includes the following bugfixes:
o --libcurl bogus strings where other data was pointed to
o crash related to FTP and "Re-used connection seems dead, get a new one"
o CURLINFO_APPCONNECT_TIME with the multi interface
+ o Enhanced upload speeds on Windows
This release includes the following known bugs:
@@ -46,6 +47,6 @@ advice from friends like these:
Andre Guibert de Bruet, Andreas Farber, Frank Hempel, Pierre Brico,
Kamil Dudka, Jim Freeman, Daniel Johnson, Toshio Kuratomi, Martin Storsjo,
Pramod Sharma, Gisle Vanem, Leanic Lefever, Rainer Koenig, Sven Wegener,
- Tim Chen
+ Tim Chen, Constantine Sapuntzakis
Thanks! (and sorry if I forgot to mention someone)
diff --git a/lib/connect.c b/lib/connect.c
index c1206cee5..7727bf017 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -704,6 +704,27 @@ static void nosigpipe(struct connectdata *conn,
#define nosigpipe(x,y)
#endif
+#ifdef WIN32
+/* When you run a program that uses the Windows Sockets API, you may
+ experience slow performance when you copy data to a TCP server.
+
+ http://support.microsoft.com/kb/823764
+
+ Work-around: Make the Socket Send Buffer Size Larger Than the Program Send
+ Buffer Size
+
+*/
+static void sndbufset(struct connectdata *conn,
+ curl_socket_t sockfd)
+{
+ int val = CURL_MAX_WRITE_SIZE + 32;
+ setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (const char *)&val, sizeof(val));
+}
+#else
+#define sndbufset(x,y)
+#endif
+
+
/* singleipconnect() connects to the given IP only, and it may return without
having connected if used from the multi interface. */
static curl_socket_t
@@ -807,6 +828,8 @@ singleipconnect(struct connectdata *conn,
nosigpipe(conn, sockfd);
+ sndbufset(conn, sockfd);
+
if(data->set.fsockopt) {
/* activate callback for setting socket options */
error = data->set.fsockopt(data->set.sockopt_client,