[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 61/153: windows: implement send buffer tuning
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 61/153: windows: implement send buffer tuning |
Date: |
Tue, 11 Sep 2018 12:52:12 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 1ba1dba76a8898d1de4dfbc9f1910a352d8a9dab
Author: Daniel Jelinski <address@hidden>
AuthorDate: Thu Jul 19 14:07:59 2018 +0200
windows: implement send buffer tuning
Significantly enhances upload performance on modern Windows versions.
Bug: https://curl.haxx.se/mail/lib-2018-07/0080.html
Closes #2762
Fixes #2224
---
lib/transfer.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/lib/transfer.c b/lib/transfer.c
index 43f567c4f..1d33e861a 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -869,6 +869,22 @@ static CURLcode done_sending(struct connectdata *conn,
return CURLE_OK;
}
+#if defined(WIN32) && defined(SIO_IDEAL_SEND_BACKLOG_QUERY)
+static void win_update_buffer_size(curl_socket_t sockfd)
+{
+ int result;
+ ULONG ideal;
+ DWORD ideallen;
+ result = WSAIoctl(sockfd, SIO_IDEAL_SEND_BACKLOG_QUERY, 0, 0,
+ &ideal, sizeof(ideal), &ideallen, 0, 0);
+ if(result == 0) {
+ setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF,
+ (const char *)&ideal, sizeof(ideal));
+ }
+}
+#else
+#define win_update_buffer_size(x)
+#endif
/*
* Send data to upload to the server, when the socket is writable.
@@ -1020,10 +1036,11 @@ static CURLcode readwrite_upload(struct Curl_easy *data,
k->upload_fromhere, /* buffer pointer */
k->upload_present, /* buffer size */
&bytes_written); /* actually sent */
-
if(result)
return result;
+ win_update_buffer_size(conn->writesockfd);
+
if(data->set.verbose)
/* show the data before we change the pointer upload_fromhere */
Curl_debug(data, CURLINFO_DATA_OUT, k->upload_fromhere,
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 68/153: http_proxy: Remove unused macro SELECT_TIMEOUT, (continued)
- [GNUnet-SVN] [gnurl] 68/153: http_proxy: Remove unused macro SELECT_TIMEOUT, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 90/153: ssh-libssh: reduce excessive verbose output about pubkey auth, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 94/153: RELEASE-NOTES: synced, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 87/153: http: fix for tiny "HTTP/0.9" response, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 88/153: travis: update to GCC 8, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 80/153: Silence GCC 8 cast-function-type warnings, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 84/153: Split non-portable part off test 1133, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 63/153: RELEASE-NOTES: synced, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 85/153: .travis.yml: verify that man pages can be regenerated, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 79/153: CURLINFO_SIZE_UPLOAD: fix missing counter update, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 61/153: windows: implement send buffer tuning,
gnunet <=
- [GNUnet-SVN] [gnurl] 77/153: RELEASE-NOTES: synced, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 83/153: projects: Improve Windows perl detection in batch scripts, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 78/153: Documentation: fix CURLOPT_SSH_COMPRESSION copy/paste bug, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 55/153: DEPRECATE: remove release date from 7.62.0, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 82/153: docs: Improve the manual pages of some callbacks, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 81/153: GCC: silence -Wcast-function-type uniformly, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 52/153: test1307: disabled, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 76/153: openssl: fix potential NULL pointer deref in is_pkcs11_uri, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 67/153: formdata: Remove unused macro HTTPPOST_CONTENTTYPE_DEFAULT, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 49/153: RELEASE-NOTES: synced, gnunet, 2018/09/11