diff options
author | Andrea Shepard <andrea@torproject.org> | 2014-04-15 21:25:49 -0700 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2014-04-15 21:25:49 -0700 |
commit | 6ee9138576ae289c4ed726ddbb7b3f547f111f70 (patch) | |
tree | 28205e4ad3ae6384ba48cded836926ff2a2255eb /src/or/connection.c | |
parent | 125c8e54680c936b9e532597372c62ac47af4fa9 (diff) | |
download | tor-6ee9138576ae289c4ed726ddbb7b3f547f111f70.tar.gz tor-6ee9138576ae289c4ed726ddbb7b3f547f111f70.zip |
Call connection_or_close_for_error() properly if write_to_buf() ever fails on an orconn
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 1be4c45dd7..5f9eecb890 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -4009,6 +4009,12 @@ connection_write_to_buf_impl_,(const char *string, size_t len, "write_to_buf failed. Closing circuit (fd %d).", (int)conn->s); circuit_mark_for_close(circuit_get_by_edge_conn(TO_EDGE_CONN(conn)), END_CIRC_REASON_INTERNAL); + } else if (conn->type == CONN_TYPE_OR) { + or_connection_t *orconn = TO_OR_CONN(conn); + log_warn(LD_NET, + "write_to_buf failed on an orconn; notifying of error " + "(fd %d)", (int)(conn->s)); + connection_or_close_for_error(orconn, 0); } else { log_warn(LD_NET, "write_to_buf failed. Closing connection (fd %d).", |