[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Must detach before attaching, or else we infinite-loop
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv32487/src/or
Modified Files:
connection_edge.c
Log Message:
Must detach before attaching, or else we infinite-loop
Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_edge.c,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -d -r1.164 -r1.165
--- connection_edge.c 15 Apr 2004 01:08:59 -0000 1.164
+++ connection_edge.c 15 Apr 2004 03:48:26 -0000 1.165
@@ -232,6 +232,7 @@
addr = ntohl(get_uint32(cell->payload+RELAY_HEADER_SIZE+1));
client_dns_set_entry(conn->socks_request->address, addr);
conn->state = AP_CONN_STATE_CIRCUIT_WAIT;
+ circuit_detach_stream(circ,conn);
if(connection_ap_handshake_attach_circuit(conn) >= 0)
return 0;
/* else, conn will get closed below */
@@ -240,6 +241,7 @@
< MAX_RESOLVE_FAILURES) {
/* We haven't retried too many times; reattach the connection. */
conn->state = AP_CONN_STATE_CIRCUIT_WAIT;
+ circuit_detach_stream(circ,conn);
if(connection_ap_handshake_attach_circuit(conn) >= 0)
return 0;
/* else, conn will get closed below */
@@ -256,7 +258,6 @@
return 0;
}
-
if(conn->type == CONN_TYPE_AP && rh->command == RELAY_COMMAND_CONNECTED) {
if(conn->state != AP_CONN_STATE_CONNECT_WAIT) {
log_fn(LOG_WARN,"Got 'connected' while not in state connect_wait. Dropping.");