[or-cvs] r8774: r9298 at dhcp-18-188-67-85: nickm | 2006-10-20 11:25:07 -0400 W (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Fri Oct 20 15:26:05 UTC 2006


Author: nickm
Date: 2006-10-20 11:26:02 -0400 (Fri, 20 Oct 2006)
New Revision: 8774

Modified:
   tor/trunk/
   tor/trunk/src/or/connection_edge.c
   tor/trunk/src/or/relay.c
Log:
 r9298 at dhcp-18-188-67-85:  nickm | 2006-10-20 11:25:07 -0400
 Weasel correctly notes that we should not discard the return value from connection_exit_begin_con.  Right now, the return value is always discardable, so this does not actually cause a bug, but it might later. So fix it.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r9298] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c	2006-10-20 15:03:49 UTC (rev 8773)
+++ tor/trunk/src/or/connection_edge.c	2006-10-20 15:26:02 UTC (rev 8774)
@@ -1829,7 +1829,8 @@
  * Note that we don't call connection_add() on the new stream! We wait
  * for connection_exit_connect() to do that.
  *
- * Return -1 if we want to tear down <b>circ</b>. Else return 0.
+ * Return -(some circuit end reason) if we want to tear down <b>circ</b>.
+ * Else return 0.
  */
 int
 connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
@@ -2168,8 +2169,9 @@
 /** Given an exit conn that should attach to us as a directory server, open a
  * bridge connection with a socketpair, create a new directory conn, and join
  * them together.  Return 0 on success (or if there was an error we could send
- * back an end cell for).  Return -1 if the circuit needs to be torn down.
- * Either connects exit_conn, frees it, or marks it, as appropriate.
+ * back an end cell for).  Return -(some circuit end reason) if the circuit
+ * needs to be torn down.  Either connects exit_conn, frees it, or marks it,
+ * as appropriate.
  */
 static int
 connection_exit_connect_dir(edge_connection_t *exit_conn)

Modified: tor/trunk/src/or/relay.c
===================================================================
--- tor/trunk/src/or/relay.c	2006-10-20 15:03:49 UTC (rev 8773)
+++ tor/trunk/src/or/relay.c	2006-10-20 15:26:02 UTC (rev 8774)
@@ -984,8 +984,7 @@
                "Begin cell for known stream. Dropping.");
         return 0;
       }
-      connection_exit_begin_conn(cell, circ);
-      return 0;
+      return connection_exit_begin_conn(cell, circ);
     case RELAY_COMMAND_DATA:
       ++stats_n_data_cells_received;
       if (( layer_hint && --layer_hint->deliver_window < 0) ||



More information about the tor-commits mailing list