aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2014-04-15 23:03:16 -0700
committerAndrea Shepard <andrea@torproject.org>2014-04-15 23:03:16 -0700
commit65a0f895c7dd913071bcba5f1876ccf3b1286892 (patch)
tree695b431291a1a9ea6000ec62881cda3ba513efe5 /src
parent125c8e54680c936b9e532597372c62ac47af4fa9 (diff)
downloadtor-65a0f895c7dd913071bcba5f1876ccf3b1286892.tar.gz
tor-65a0f895c7dd913071bcba5f1876ccf3b1286892.zip
Check for orconns and use connection_or_close_for_error() when appropriate in connection_handle_write_impl()
Diffstat (limited to 'src')
-rw-r--r--src/or/connection.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 1be4c45dd7..33b7d318ee 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -3705,9 +3705,15 @@ connection_handle_write_impl(connection_t *conn, int force)
if (connection_state_is_connecting(conn)) {
if (getsockopt(conn->s, SOL_SOCKET, SO_ERROR, (void*)&e, &len) < 0) {
log_warn(LD_BUG, "getsockopt() syscall failed");
- if (CONN_IS_EDGE(conn))
- connection_edge_end_errno(TO_EDGE_CONN(conn));
- connection_mark_for_close(conn);
+ if (conn->type == CONN_TYPE_OR) {
+ or_connection_t *orconn = TO_OR_CONN(conn);
+ connection_or_close_for_error(orconn, 0);
+ } else {
+ if (CONN_IS_EDGE(conn)) {
+ connection_edge_end_errno(TO_EDGE_CONN(conn));
+ }
+ connection_mark_for_close(conn);
+ }
return -1;
}
if (e) {