diff options
author | Roger Dingledine <arma@torproject.org> | 2007-05-10 08:57:57 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-05-10 08:57:57 +0000 |
commit | f294708f7f2cdd0f5635e40291691322b8569083 (patch) | |
tree | 54d3bd44a199d8b8a1642d7660e743d474cda7f2 | |
parent | f8cccdbe50a9a0e01193ca915fa2eb1c286c7995 (diff) | |
download | tor-f294708f7f2cdd0f5635e40291691322b8569083.tar.gz tor-f294708f7f2cdd0f5635e40291691322b8569083.zip |
backport r10154
svn:r10155
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/or/connection_edge.c | 13 |
2 files changed, 16 insertions, 5 deletions
@@ -1,3 +1,11 @@ +Changes in version 0.1.2.14 - 2007-0?-?? + o Crash fixes: + - If a directory server runs out of space in the connection table + as it's processing a begin_dir request, it will free the exit stream + but leave it attached to the circuit, leading to unpredictable + behavior. (Reported by seeess, fixes bug 425.) + + Changes in version 0.1.2.13 - 2007-04-24 o Minor fixes: - Fix a memory leak when we ask for "all" networkstatuses and we diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 14140f0075..e2632689f6 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -29,7 +29,8 @@ static smartlist_t *redirect_exit_list = NULL; static int connection_ap_handshake_process_socks(edge_connection_t *conn); static int connection_ap_process_natd(edge_connection_t *conn); -static int connection_exit_connect_dir(edge_connection_t *exit_conn); +static int connection_exit_connect_dir(edge_connection_t *exit_conn, + or_circuit_t *circ); static int hostname_is_noconnect_address(const char *address); /** An AP stream has failed/finished. If it hasn't already sent back @@ -2239,10 +2240,8 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ) if (rh.command == RELAY_COMMAND_BEGIN_DIR) { if (or_circ && or_circ->p_conn && or_circ->p_conn->_base.addr) n_stream->_base.addr = or_circ->p_conn->_base.addr; - n_stream->next_stream = TO_OR_CIRCUIT(circ)->n_streams; n_stream->on_circuit = circ; - TO_OR_CIRCUIT(circ)->n_streams = n_stream; - return connection_exit_connect_dir(n_stream); + return connection_exit_connect_dir(n_stream, TO_OR_CIRCUIT(circ)); } /* send it off to the gethostbyname farm */ @@ -2424,7 +2423,8 @@ connection_exit_connect(edge_connection_t *edge_conn) * as appropriate. */ static int -connection_exit_connect_dir(edge_connection_t *exit_conn) +connection_exit_connect_dir(edge_connection_t *exit_conn, + or_circuit_t *circ) { int fd[2]; int err; @@ -2470,6 +2470,9 @@ connection_exit_connect_dir(edge_connection_t *exit_conn) return 0; } + exit_conn->next_stream = circ->n_streams; + circ->n_streams = exit_conn; + if (connection_add(TO_CONN(dir_conn))<0) { connection_edge_end(exit_conn, END_STREAM_REASON_RESOURCELIMIT, exit_conn->cpath_layer); |