summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-11-21 09:39:01 +0000
committerRoger Dingledine <arma@torproject.org>2004-11-21 09:39:01 +0000
commit671d84dc2f02d8d39f66582add2324ecb2590728 (patch)
treea5904d1fc0dfadb3f65a169d1ab24ba976808dfa
parent6a516dfdd38c05c7e535717cae766250a05b2471 (diff)
downloadtor-671d84dc2f02d8d39f66582add2324ecb2590728.tar.gz
tor-671d84dc2f02d8d39f66582add2324ecb2590728.zip
some more debugging aids
svn:r2929
-rw-r--r--src/or/connection_edge.c2
-rw-r--r--src/or/or.h1
-rw-r--r--src/or/relay.c13
3 files changed, 13 insertions, 3 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 7a79bab63e..ecd2b0d0ee 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -52,7 +52,7 @@ int connection_edge_process_inbuf(connection_t *conn, int package_partial) {
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
diff --git a/src/or/or.h b/src/or/or.h
index d5825f3b75..fdcd3200a2 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -547,6 +547,7 @@ struct connection_t {
* 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). */
diff --git a/src/or/relay.c b/src/or/relay.c
index 69ca8ce85a..01d8edf84f 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -702,6 +702,10 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ,
}
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 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ,
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 @@ repeat_connection_edge_package_raw_inbuf:
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)