aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-01-16 14:35:49 -0500
committerNick Mathewson <nickm@torproject.org>2018-01-17 10:40:00 -0500
commit57eab23ea57620b6d4139f684a74cb85188c12fb (patch)
treeff38837978d7e6859cdb4a0de8b6d4743fb61c29 /src/or/connection.c
parent1efb84215e827e4fe887ea633eb39f06db285786 (diff)
downloadtor-57eab23ea57620b6d4139f684a74cb85188c12fb.tar.gz
tor-57eab23ea57620b6d4139f684a74cb85188c12fb.zip
update comment; ignore argument on non-win
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 5d9d16d372..dfb6d5bf16 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -3694,14 +3694,20 @@ connection_outbuf_too_full(connection_t *conn)
return (conn->outbuf_flushlen > 10*CELL_PAYLOAD_SIZE);
}
-/** Fix slow upload for Windows Vista and Windows 7 systems (bug #22798).
- * This achieved by tuning socket send buffer size according to hint,
- * returned by SIO_IDEAL_SEND_BACKLOG_QUERY ioctl command.
+/**
+ * On Windows Vista and Windows 7, tune the send buffer size according to a
+ * hint from the OS.
+ *
+ * This should help fix slow upload rates.
*/
static void
+
update_send_buffer_size(tor_socket_t sock)
{
#ifdef _WIN32
+ /* We only do this on Vista and 7, because earlier versions of Windows
+ * don't have the SIO_IDEAL_SEND_BACKLOG_QUERY functionality, and on
+ * later versions it isn't necessary. */
static int isVistaOr7 = -1;
if (isVistaOr7 == -1) {
isVistaOr7 = 0;
@@ -3721,6 +3727,8 @@ update_send_buffer_size(tor_socket_t sock)
&isb, sizeof(isb), &bytesReturned, NULL, NULL)) {
setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (const char*)&isb, sizeof(isb));
}
+#else
+ (void) sock;
#endif
}