[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] fix assert: stop trying to send a socks reply to an *exit*



Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	relay.c 
Log Message:
fix assert: stop trying to send a socks reply to an *exit*
connection when we get an end cell before it's finished opening.


Index: relay.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/relay.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- relay.c	25 Mar 2005 11:12:14 -0000	1.55
+++ relay.c	26 Mar 2005 06:27:04 -0000	1.56
@@ -659,9 +659,10 @@
     if (CIRCUIT_IS_ORIGIN(circ))
       circuit_log_path(LOG_INFO,circ);
     conn->has_sent_end = 1; /* we just got an 'end', don't need to send one */
-    connection_ap_handshake_socks_reply(conn, NULL, 0,
-      connection_edge_end_reason_socks5_response(*(char *)
-        (cell->payload+RELAY_HEADER_SIZE)));
+    if (conn->type == CONN_TYPE_AP)
+      connection_ap_handshake_socks_reply(conn, NULL, 0,
+        connection_edge_end_reason_socks5_response(*(char *)
+          (cell->payload+RELAY_HEADER_SIZE)));
     connection_mark_for_close(conn);
     return 0;
   }