[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] since we don"t support truncateds much, don"t bother sendin...



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	circuit.c command.c connection.c 
Log Message:
since we don't support truncateds much, don't bother sending them;
just close the circ.

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


Index: circuit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuit.c,v
retrieving revision 1.220
retrieving revision 1.221
diff -u -d -r1.220 -r1.221
--- circuit.c	26 Apr 2004 03:42:41 -0000	1.220
+++ circuit.c	26 Apr 2004 04:32:01 -0000	1.221
@@ -1573,9 +1573,12 @@
     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: command.c
===================================================================
RCS file: /home/or/cvsroot/src/or/command.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- command.c	26 Apr 2004 03:00:33 -0000	1.60
+++ command.c	26 Apr 2004 04:32:01 -0000	1.61
@@ -200,15 +200,20 @@
     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: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -d -r1.201 -r1.202
--- connection.c	26 Apr 2004 01:50:08 -0000	1.201
+++ connection.c	26 Apr 2004 04:32:01 -0000	1.202
@@ -635,7 +635,7 @@
       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);