summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-11-18 17:43:03 -0500
committerNick Mathewson <nickm@torproject.org>2011-11-18 17:43:03 -0500
commit6e6a6612966d7ea9ad3d89bb5073ef400539b2a7 (patch)
tree41fb91c01c4ddb324f40d6714fa94dd453e6c5ff /src/or/or.h
parent6a6233b70b4b496834196960aef896da33d13331 (diff)
downloadtor-6e6a6612966d7ea9ad3d89bb5073ef400539b2a7.tar.gz
tor-6e6a6612966d7ea9ad3d89bb5073ef400539b2a7.zip
New UserspaceIOCPBuffers option to set SO_{SND,RCV}BUF to zero
When running with IOCP, we are in theory able to use userspace- allocated buffers to avoid filling up the stingy amount of kernel space allocated for sockets buffers. The bufferevent_async implementation in Libevent provides this ability, in theory. (There are likely to be remaining bugs). This patch adds a new option that, when using IOCP bufferevents, sets each socket's send and receive buffers to 0, so that we should use this ability. When all the bugs are worked out here, if we are right about bug 98, this might solve or mitigate bug 98. This option is experimental and will likely require lots of testing and debugging.
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h
index e4f9b9b2b6..7fb7e9cb22 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3424,6 +3424,11 @@ typedef struct {
* never use it. If -1, we do what the consensus says. */
int OptimisticData;
+ /** If 1, and we are using IOCP, we set the kernel socket SNDBUF and RCVBUF
+ * to 0 to try to save kernel memory and avoid the dread "Out of buffers"
+ * issue. */
+ int UserspaceIOCPBuffers;
+
} or_options_t;
/** Persistent state for an onion router, as saved to disk. */