aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-07-16 16:58:41 +0200
committerNick Mathewson <nickm@torproject.org>2014-07-16 16:58:41 +0200
commitb408125288ad6943d7ed3b468ad9179a93d1359c (patch)
treea6e0169b60409a868885f4da34dcccae88dccd94 /src
parent0ef5d4d633dc40ad12eaf65608325d1e5045b812 (diff)
parent65a0f895c7dd913071bcba5f1876ccf3b1286892 (diff)
downloadtor-b408125288ad6943d7ed3b468ad9179a93d1359c.tar.gz
tor-b408125288ad6943d7ed3b468ad9179a93d1359c.zip
Merge remote-tracking branch 'andrea/bug11302'
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 4788bdf950..4d7cec7f9a 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -3715,9 +3715,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) {