summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-12-23 07:42:01 +0000
committerRoger Dingledine <arma@torproject.org>2003-12-23 07:42:01 +0000
commit55a94cd497efab8b41fc7390e657d0856b557e0f (patch)
treeee64994d923a40b58b30ab205b3a1a6471ba50d8
parentad93c0a2bd655dd1e4cc0c7a922899800c8805ee (diff)
downloadtor-55a94cd497efab8b41fc7390e657d0856b557e0f.tar.gz
tor-55a94cd497efab8b41fc7390e657d0856b557e0f.zip
correct a warn message in mark_if_closed
svn:r956
-rw-r--r--src/or/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c
index a03a7379d0..99671f8d3b 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -220,8 +220,10 @@ static void conn_close_if_marked(int i) {
} else {
flush_buf(conn->s, conn->outbuf, &conn->outbuf_flushlen);
}
- if(connection_wants_to_flush(conn)) /* not done flushing */
- log_fn(LOG_WARN,"Conn (socket %d) still wants to flush. Losing %d bytes!",conn->s, (int)buf_datalen(conn->inbuf));
+ if(connection_wants_to_flush(conn) && buf_datalen(conn->outbuf)) {
+ log_fn(LOG_WARN,"Conn (socket %d) still wants to flush. Losing %d bytes!",
+ conn->s, (int)buf_datalen(conn->outbuf));
+ }
}
connection_remove(conn);
connection_free(conn);
@@ -606,11 +608,11 @@ static void dumpstats(int severity) {
if (stats_n_data_cells_packaged)
log(severity,"Average outgoing cell fullness: %2.3f%%",
100*(((double)stats_n_data_bytes_packaged) /
- (stats_n_data_cells_packaged*(CELL_PAYLOAD_SIZE-RELAY_HEADER_SIZE))) );
+ (stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)) );
if (stats_n_data_cells_received)
log(severity,"Average incoming cell fullness: %2.3f%%",
100*(((double)stats_n_data_bytes_received) /
- (stats_n_data_cells_received*(CELL_PAYLOAD_SIZE-RELAY_HEADER_SIZE))) );
+ (stats_n_data_cells_received*RELAY_PAYLOAD_SIZE)) );
if (stats_n_seconds_reading)
log(severity,"Average bandwidth used: %d bytes/sec",