]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
since we don't support truncateds much, don't bother sending them;
authorRoger Dingledine <arma@torproject.org>
Mon, 26 Apr 2004 04:32:01 +0000 (04:32 +0000)
committerRoger Dingledine <arma@torproject.org>
Mon, 26 Apr 2004 04:32:01 +0000 (04:32 +0000)
just close the circ.

(this wasn't relevant before, because we were mis-handling destroys.)

svn:r1711

src/or/circuit.c
src/or/command.c
src/or/connection.c

index 3964ac1b695f43c8e384cdb6229f8bbead5dc07e..f2a94d8a107149fc10cbd1de3f3ef2f3cc017d16 100644 (file)
@@ -1573,9 +1573,12 @@ int circuit_extend(cell_t *cell, circuit_t *circ) {
     struct in_addr in;
     in.s_addr = htonl(circ->n_addr);
     log_fn(LOG_INFO,"Next router (%s:%d) not connected. Closing.", inet_ntoa(in), circ->n_port);
+#if 0 /* if we do truncateds, no need to kill circ */
     connection_edge_send_command(NULL, circ, RELAY_COMMAND_TRUNCATED,
                                  NULL, 0, NULL);
     return 0;
+#endif
+    return -1;
   }
 
   circ->n_addr = n_conn->addr; /* these are different if we found a twin instead */
index 0a6ec559bb7e43a46b8bcdf423468ffac180ae06..8f0769c42402a8fc6498a1e2a45bbd4d0ba1bb61 100644 (file)
@@ -200,15 +200,20 @@ static void command_process_destroy_cell(cell_t *cell, connection_t *conn) {
     onion_pending_remove(circ);
   }
 
-  if(cell->circ_id == circ->p_circ_id || CIRCUIT_IS_ORIGIN(circ)) {
-    /* either the destroy came from behind, or we're the AP */
+  if(cell->circ_id == circ->p_circ_id) {
+    /* the destroy came from behind */
     circ->p_conn = NULL;
     circuit_mark_for_close(circ);
   } else { /* the destroy came from ahead */
     circ->n_conn = NULL;
-    log_fn(LOG_DEBUG, "Delivering 'truncated' back.");
-    connection_edge_send_command(NULL, circ, RELAY_COMMAND_TRUNCATED,
-                                 NULL, 0, NULL);
+#if 0
+    if(!CIRCUIT_IS_ORIGIN(circ)) {
+      log_fn(LOG_DEBUG, "Delivering 'truncated' back.");
+      connection_edge_send_command(NULL, circ, RELAY_COMMAND_TRUNCATED,
+                                   NULL, 0, NULL);
+    }
+#endif
+    circuit_mark_for_close(circ);
   }
 }
 
index 4c33f68ebf12c360eda4396c8c4095b0ff8ae65d..f56acdf244481dab6e1ff1a34ba53f70ae03bdca 100644 (file)
@@ -635,7 +635,7 @@ int connection_read_to_buf(connection_t *conn) {
       case TOR_TLS_ERROR:
       case TOR_TLS_CLOSE:
         log_fn(LOG_INFO,"tls error. breaking (nickname %s).",
-               conn->nickname ? conn->nickname : "not set yet");
+               conn->nickname ? conn->nickname : "not set");
         return -1; /* XXX deal with close better */
       case TOR_TLS_WANTWRITE:
         connection_start_writing(conn);