diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-06-21 10:22:54 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-06-21 10:22:54 -0400 |
commit | e617a34d589ac8ef26203ae90443a0e98f7032b1 (patch) | |
tree | c3e07e9d9e30f016c3bc87d390d19c7278ec09b0 /src/or/connection.h | |
parent | 8b265543eb0f5fdda15fca882028fa95983fa919 (diff) | |
download | tor-e617a34d589ac8ef26203ae90443a0e98f7032b1.tar.gz tor-e617a34d589ac8ef26203ae90443a0e98f7032b1.zip |
Add, use a bufferevent-safe connection_flush()
A couple of places in control.c were using connection_handle_write()
to flush important stuff (the response to a SIGNAL command, an
ERR-level status event) before Tor went down. But
connection_handle_write() isn't meaningful for bufferevents, so we'd
crash.
This patch adds a new connection_flush() that works for all connection
backends, and makes control.c use that instead.
Fix for bug 3367; bugfix on 0.2.3.1-alpha.
Diffstat (limited to 'src/or/connection.h')
-rw-r--r-- | src/or/connection.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/connection.h b/src/or/connection.h index 94ae64591f..8dc0112098 100644 --- a/src/or/connection.h +++ b/src/or/connection.h @@ -79,6 +79,8 @@ int connection_fetch_from_buf_http(connection_t *conn, int connection_wants_to_flush(connection_t *conn); int connection_outbuf_too_full(connection_t *conn); int connection_handle_write(connection_t *conn, int force); +int connection_flush(connection_t *conn); + void _connection_write_to_buf_impl(const char *string, size_t len, connection_t *conn, int zlib); static void connection_write_to_buf(const char *string, size_t len, |