summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-09-27 13:02:11 -0400
committerNick Mathewson <nickm@torproject.org>2010-09-27 14:29:42 -0400
commitb7ae108e187b8396315287de0177e11bb4733545 (patch)
tree96052c0f8c618e364c7e4f97598da9fa6da7ff1b /src
parent89e8f31c42400e39e6bc8dfa2bc8735d7d5b5bf0 (diff)
downloadtor-b7ae108e187b8396315287de0177e11bb4733545.tar.gz
tor-b7ae108e187b8396315287de0177e11bb4733545.zip
Always defer bufferevent_openssl callbacks to avoid reentrant invocations
Diffstat (limited to 'src')
-rw-r--r--src/common/tortls.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index d9f1d875d2..bd6840af70 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -1710,12 +1710,16 @@ tor_tls_init_bufferevent(tor_tls_t *tls, struct bufferevent *bufev_in,
bufferevent_free(bufev_in);
}
tls->state = TOR_TLS_ST_BUFFEREVENT;
+
+ /* Current versions (as of 2.0.7-rc) of Libevent need to defer
+ * bufferevent_openssl callbacks, or else our callback functions will
+ * get called reentrantly, which is bad for us.
+ */
out = bufferevent_openssl_socket_new(tor_libevent_get_base(),
socket,
tls->ssl,
state,
- 0);
- //BEV_OPT_DEFER_CALLBACKS);
+ BEV_OPT_DEFER_CALLBACKS);
#endif
return out;
}