[or-cvs] some more debugging aids

Roger Dingledine arma at seul.org
Sun Nov 21 09:39:04 UTC 2004


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

Modified Files:
	connection_edge.c or.h relay.c 
Log Message:
some more debugging aids


Index: connection_edge.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection_edge.c,v
retrieving revision 1.234
retrieving revision 1.235
diff -u -d -r1.234 -r1.235
--- connection_edge.c	21 Nov 2004 07:43:12 -0000	1.234
+++ connection_edge.c	21 Nov 2004 09:39:01 -0000	1.235
@@ -52,7 +52,7 @@
     return 0;
 #else
     /* eof reached, kill it. */
-    log_fn(LOG_INFO,"conn (fd %d) reached eof. Closing.", conn->s);
+    log_fn(LOG_INFO,"conn (fd %d) reached eof (stream size %d). Closing.", conn->s, (int)conn->stream_size);
     connection_edge_end(conn, END_STREAM_REASON_DONE, conn->cpath_layer);
     if(!conn->marked_for_close) {
       /* only mark it if not already marked. it's possible to

Index: or.h
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.490
retrieving revision 1.491
diff -u -d -r1.490 -r1.491
--- or.h	21 Nov 2004 07:43:12 -0000	1.490
+++ or.h	21 Nov 2004 09:39:01 -0000	1.491
@@ -547,6 +547,7 @@
                                            * querying for? (DIR/AP only) */
 
 /* Used only by edge connections: */
+  size_t stream_size; /**< Used for debugging. */
   uint16_t stream_id;
   struct connection_t *next_stream; /**< Points to the next stream at this
                                      * edge, if any (Edge only). */

Index: relay.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/relay.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- relay.c	21 Nov 2004 07:43:12 -0000	1.22
+++ relay.c	21 Nov 2004 09:39:01 -0000	1.23
@@ -702,6 +702,10 @@
       }
 
       stats_n_data_bytes_received += rh.length;
+      if(conn->type == CONN_TYPE_AP) {
+        log_fn(LOG_DEBUG,"%d: stream size now %d.", conn->s, (int)conn->stream_size);
+        conn->stream_size += rh.length;
+      }
       connection_write_to_buf(cell->payload + RELAY_HEADER_SIZE,
                               rh.length, conn);
       connection_edge_consider_sending_sendme(conn);
@@ -713,9 +717,10 @@
         return 0;
       }
 /* XXX add to this log_fn the exit node's nickname? */
-      log_fn(LOG_INFO,"end cell (%s) for stream %d. Removing stream.",
+      log_fn(LOG_INFO,"%d: end cell (%s) for stream %d. Removing stream. Size %d.",
+        conn->s,
         connection_edge_end_reason(cell->payload+RELAY_HEADER_SIZE, rh.length),
-        conn->stream_id);
+        conn->stream_id, (int)conn->stream_size);
 
 #ifdef HALF_OPEN
       conn->done_sending = 1;
@@ -899,6 +904,10 @@
 
   log_fn(LOG_DEBUG,"(%d) Packaging %d bytes (%d waiting).", conn->s,
          (int)length, (int)buf_datalen(conn->inbuf));
+  if (conn->type == CONN_TYPE_EXIT) {
+    conn->stream_size += length;
+    log_fn(LOG_DEBUG,"%d: Stream size now %d.", conn->s, (int)conn->stream_size);
+  }
 
   if(connection_edge_send_command(conn, circ, RELAY_COMMAND_DATA,
                                payload, length, conn->cpath_layer) < 0)



More information about the tor-commits mailing list