diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-06-18 11:51:55 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-06-18 11:51:55 -0400 |
commit | 4432fa40dda2a79da7c2d88d2fe83462ed919d7b (patch) | |
tree | 4d2ad2630e953b926d5fad2e033df289a1aef042 | |
parent | 26855fe22cc314d0f60162f6e6020aa0741a67e3 (diff) | |
parent | 1f7f10e4f3953244a1262f46b726bbe43d025c1a (diff) | |
download | tor-4432fa40dda2a79da7c2d88d2fe83462ed919d7b.tar.gz tor-4432fa40dda2a79da7c2d88d2fe83462ed919d7b.zip |
Merge remote-tracking branch 'andrea/bug6028'
-rw-r--r-- | changes/bug6028 | 4 | ||||
-rw-r--r-- | src/or/connection.c | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/changes/bug6028 b/changes/bug6028 new file mode 100644 index 0000000000..fedd02f742 --- /dev/null +++ b/changes/bug6028 @@ -0,0 +1,4 @@ + o Minor bugfixes: + - Make sure to set *socket_error in all error cases in + connection_connect(), so it can't produce a warning about errno being + zero from errno_to_orconn_end_reason(). Resolves ticket 6028. diff --git a/src/or/connection.c b/src/or/connection.c index e731a1c597..af5c011815 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1336,6 +1336,7 @@ connection_connect(connection_t *conn, const char *address, if (get_n_open_sockets() >= get_options()->_ConnLimit-1) { warn_too_many_conns(); + *socket_error = ENOBUFS; return -1; } @@ -1428,8 +1429,11 @@ connection_connect(connection_t *conn, const char *address, escaped_safe_str_client(address), port, inprogress?"in progress":"established", s); conn->s = s; - if (connection_add_connecting(conn) < 0) /* no space, forget it */ + if (connection_add_connecting(conn) < 0) { + /* no space, forget it */ + *socket_error = ENOBUFS; return -1; + } return inprogress ? 0 : 1; } |