]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
fix assert: stop trying to send a socks reply to an *exit*
authorRoger Dingledine <arma@torproject.org>
Sat, 26 Mar 2005 06:27:04 +0000 (06:27 +0000)
committerRoger Dingledine <arma@torproject.org>
Sat, 26 Mar 2005 06:27:04 +0000 (06:27 +0000)
connection when we get an end cell before it's finished opening.

svn:r3886

src/or/relay.c

index f03332fbf07247211f4724fa198e5e9cd487cc9d..9425922823d27b40e28237fd4f65c1d3d980953c 100644 (file)
@@ -659,9 +659,10 @@ connection_edge_process_relay_cell_not_open(
     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;
   }