[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] update comment; ignore argument on non-win
commit 57eab23ea57620b6d4139f684a74cb85188c12fb
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Tue Jan 16 14:35:49 2018 -0500
update comment; ignore argument on non-win
---
src/or/connection.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/or/connection.c b/src/or/connection.c
index 5d9d16d37..dfb6d5bf1 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
}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits