diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-11-29 17:06:09 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-11-29 17:08:29 -0500 |
commit | aba25a6939a5907d40dbcff7433a8c130ffd12ad (patch) | |
tree | 5182d775e7e9e2fb1dea57d861cce7a22a7486db /src/common/tortls.c | |
parent | b5a306e82c684bdd30b832fdfd9e2b55c06b54ae (diff) | |
download | tor-aba25a6939a5907d40dbcff7433a8c130ffd12ad.tar.gz tor-aba25a6939a5907d40dbcff7433a8c130ffd12ad.zip |
Make pending libevent actions cancelable
This avoids a dangling pointer issue in the 3412 code, and should
fix bug 4599.
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r-- | src/common/tortls.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index b4d81de2f3..a6947c87d8 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -1339,16 +1339,9 @@ tor_tls_got_client_hello(tor_tls_t *tls) tls->excess_renegotiations_callback) { /* We got more than one renegotiation requests. The Tor protocol needs just one renegotiation; more than that probably means - They are trying to DoS us and we have to stop them. We can't - close their connection from in here since it's an OpenSSL - callback, so we set a libevent timer that triggers in the next - event loop and closes the connection. */ - - if (tor_run_in_libevent_loop(tls->excess_renegotiations_callback, - tls->callback_arg) < 0) { - log_warn(LD_GENERAL, "Didn't manage to set a renegotiation " - "limiting callback."); - } + They are trying to DoS us and we have to stop them. */ + + tls->excess_renegotiations_callback(tls->callback_arg); } /* Now check the cipher list. */ |