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

[or-cvs] Log contents of bw_accounting when we read it; fix memory l...



Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv10611/src/or

Modified Files:
	hibernate.c 
Log Message:
Log contents of bw_accounting when we read it; fix memory leak.

Index: hibernate.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/hibernate.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- hibernate.c	5 Dec 2004 13:02:18 -0000	1.37
+++ hibernate.c	7 Dec 2004 23:20:10 -0000	1.38
@@ -605,6 +605,16 @@
   interval_start_time = t1;
   expected_bandwidth_usage = expected_bw;
 
+  log_fn(LOG_INFO, "Successfully read bandwidth accounting file written at %s for interval starting at %s.  We have been active for %lu seconds in this interval.  At the start of the interval, we expected to use about %lu KB per second. ("U64_FORMAT" bytes read so far, "U64_FORMAT" bytes written so far)",
+         (char*)smartlist_get(elts,2),
+         (char*)smartlist_get(elts,1),
+         (unsigned long)n_seconds_active_in_interval,
+         (unsigned long)((uint64_t)expected_bandwidth_usage*1024/60),
+         n_bytes_read_in_interval,
+         n_bytes_written_in_interval);
+  SMARTLIST_FOREACH(elts, char *, cp, tor_free(cp));
+  smartlist_free(elts);
+
   return 0;
  err:
   SMARTLIST_FOREACH(elts, char *, cp, tor_free(cp));