[or-cvs] Fix bug in last commit when no circid can be found

Nick Mathewson nickm at seul.org
Wed Apr 6 05:45:09 UTC 2005


Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv4626/src/or

Modified Files:
	circuitbuild.c 
Log Message:
Fix bug in last commit when no circid can be found

Index: circuitbuild.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/circuitbuild.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- circuitbuild.c	6 Apr 2005 05:33:32 -0000	1.105
+++ circuitbuild.c	6 Apr 2005 05:45:07 -0000	1.106
@@ -385,19 +385,20 @@
 static int
 circuit_deliver_create_cell(circuit_t *circ, char *payload) {
   cell_t cell;
+  uint16_t id;
 
   tor_assert(circ);
   tor_assert(circ->n_conn);
   tor_assert(circ->n_conn->type == CONN_TYPE_OR);
   tor_assert(payload);
 
-  circuit_set_circid_orconn(circ, get_unique_circ_id_by_conn(circ->n_conn),
-                            circ->n_conn, N_CONN_CHANGED);
-  if (!circ->n_circ_id) {
+  id = get_unique_circ_id_by_conn(circ->n_conn);
+  if (!id) {
     log_fn(LOG_WARN,"failed to get unique circID.");
     return -1;
   }
-  log_fn(LOG_DEBUG,"Chosen circID %u.",circ->n_circ_id);
+  log_fn(LOG_DEBUG,"Chosen circID %u.", id);
+  circuit_set_circid_orconn(circ, id, circ->n_conn, N_CONN_CHANGED);
 
   memset(&cell, 0, sizeof(cell_t));
   cell.command = CELL_CREATE;



More information about the tor-commits mailing list