diff options
author | Robert Ransom <rransom.8774@gmail.com> | 2011-08-06 13:42:32 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-08-08 09:42:48 -0400 |
commit | cab3641638540834a0867f26eb5b432fd793fd5e (patch) | |
tree | bf0fa42ab38e0657f25baf23eb00485fa3a3b544 /src | |
parent | 52421e91014ee8c1d105bb07b336c95a64dc557f (diff) | |
download | tor-cab3641638540834a0867f26eb5b432fd793fd5e.tar.gz tor-cab3641638540834a0867f26eb5b432fd793fd5e.zip |
Fix handling of ISO_STREAM
Now we track *which* stream with ISO_STREAM set is associated to a
particular circuit, so that we won't think that stream is incompatible
with its circuit and launch another one a second later, and we use that
same field to mark circuits which have had an ISO_STREAM stream attached
to them, so that we won't ever put a second stream on that circuit.
Fixes bug 3695.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/connection_edge.c | 9 | ||||
-rw-r--r-- | src/or/or.h | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 971cee2d6b..37a695cfb1 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -3432,9 +3432,9 @@ connection_edge_compatible_with_circuit(const edge_connection_t *conn, tor_strdup(conn->socks_request->address); } - /* If isolation_values_set, then the circuit is not compatible with - * any new ISO_STREAM stream. */ - if (iso & ISO_STREAM) + if ((iso & ISO_STREAM) && + (circ->associated_isolated_stream_global_id != + TO_CONN(conn)->global_identifier)) return 0; if ((iso & ISO_DESTPORT) && conn->socks_request->port != circ->dest_port) @@ -3487,6 +3487,8 @@ connection_edge_update_circuit_isolation(const edge_connection_t *conn, if (!circ->isolation_values_set) { if (dry_run) return -1; + circ->associated_isolated_stream_global_id = + TO_CONN(conn)->global_identifier; circ->dest_port = conn->socks_request->port; circ->dest_address = tor_strdup(conn->original_dest_address); circ->client_proto_type = conn->socks_request->listener_type; @@ -3562,6 +3564,7 @@ circuit_clear_isolation(origin_circuit_t *circ) circ->isolation_values_set = 0; circ->isolation_flags_mixed = 0; + circ->associated_isolated_stream_global_id = 0; circ->client_proto_type = 0; circ->client_proto_socksver = 0; circ->dest_port = 0; diff --git a/src/or/or.h b/src/or/or.h index eb271b5ee4..9c5d354c78 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2530,6 +2530,9 @@ typedef struct origin_circuit_t { socks_username_len and socks_password_len for their lengths. */ char *socks_username; char *socks_password; + /** Global identifier for the first stream attached here; used by + * ISO_STREAM. */ + uint64_t associated_isolated_stream_global_id; /**@}*/ } origin_circuit_t; |