diff options
author | Andrea Shepard <andrea@persephoneslair.org> | 2012-06-15 16:53:32 -0700 |
---|---|---|
committer | Andrea Shepard <andrea@persephoneslair.org> | 2012-06-15 16:53:32 -0700 |
commit | 1f7f10e4f3953244a1262f46b726bbe43d025c1a (patch) | |
tree | c532c504c04dca93c0d89fe0652e7ff2995062f1 /src/or/connection.c | |
parent | 7516b4ac99fddf05f54dadaeaee95e49c729a36c (diff) | |
download | tor-1f7f10e4f3953244a1262f46b726bbe43d025c1a.tar.gz tor-1f7f10e4f3953244a1262f46b726bbe43d025c1a.zip |
Always set *socket_error to something appropriate when returning -1 from connection_connect()
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 34e1a5cb06..8d3c7b30a9 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1331,6 +1331,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; } @@ -1423,8 +1424,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; } |