]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
send truncates AP-ward in a circuit, not destroys
authorRoger Dingledine <arma@torproject.org>
Fri, 13 Jun 2003 09:20:23 +0000 (09:20 +0000)
committerRoger Dingledine <arma@torproject.org>
Fri, 13 Jun 2003 09:20:23 +0000 (09:20 +0000)
svn:r313

src/or/command.c

index f9b3ba3557bad59fc3ebd5955f49bf1e6516d489..3ed153f7fe4f344a563add053b62cc4192fa05e4 100644 (file)
@@ -204,11 +204,15 @@ void command_process_destroy_cell(cell_t *cell, connection_t *conn) {
     onion_pending_remove(circ);
   }
 
-  if(cell->aci == circ->p_aci) /* the destroy came from behind */
+  if(cell->aci == circ->p_aci || circ->cpath) {
+    /* either the destroy came from behind, or we're the AP */
     circ->p_conn = NULL;
-  if(cell->aci == circ->n_aci) /* the destroy came from ahead */
+    circuit_close(circ);
+  } else { /* the destroy came from ahead */
     circ->n_conn = NULL;
-  circuit_close(circ);
+    log(LOG_DEBUG, "command_process_destroy_cell(): Delivering 'truncated' back.");
+    connection_edge_send_command(NULL, circ, RELAY_COMMAND_TRUNCATED);
+  }
 }
 
 /*