diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-08-24 17:18:25 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-08-24 17:31:37 -0400 |
commit | f186e16241f7d6a0090260f87ce412a0fb7ec47a (patch) | |
tree | 037d21da44eac33eed3e9ed290e17a8b596b6605 /src | |
parent | 59d0f750c972011372febefbee958b37a17a0569 (diff) | |
download | tor-f186e16241f7d6a0090260f87ce412a0fb7ec47a.tar.gz tor-f186e16241f7d6a0090260f87ce412a0fb7ec47a.zip |
Add write watermarks to filtered bufferevents.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/tortls.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index 2aaa2c49b5..1bb9c74efa 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -51,6 +51,7 @@ #ifdef USE_BUFFEREVENTS #include <event2/bufferevent_ssl.h> #include <event2/buffer.h> +#include <event2/event.h> #include "compat_libevent.h" #endif @@ -1905,6 +1906,10 @@ tor_tls_init_bufferevent(tor_tls_t *tls, struct bufferevent *bufev_in, state, BEV_OPT_DEFER_CALLBACKS| BEV_OPT_CLOSE_ON_FREE); + /* Tell the underlying bufferevent when to accept more data from the SSL + filter (only when it's got less than 32K to write), and when to notify + the SSL filter that it could write more (when it drops under 24K). */ + bufferevent_setwatermark(bufev_in, EV_WRITE, 24*1024, 32*1024); } else { if (bufev_in) { evutil_socket_t s = bufferevent_getfd(bufev_in); |