[or-cvs] r13610: pass bucket sizes num_read and num_written around as size_ts (tor/trunk/src/or)

arma at seul.org arma at seul.org
Wed Feb 20 02:17:41 UTC 2008


Author: arma
Date: 2008-02-19 21:17:41 -0500 (Tue, 19 Feb 2008)
New Revision: 13610

Modified:
   tor/trunk/src/or/connection.c
   tor/trunk/src/or/or.h
   tor/trunk/src/or/rephist.c
Log:
pass bucket sizes num_read and num_written around as size_ts
rather than ints


Modified: tor/trunk/src/or/connection.c
===================================================================
--- tor/trunk/src/or/connection.c	2008-02-20 02:05:28 UTC (rev 13609)
+++ tor/trunk/src/or/connection.c	2008-02-20 02:17:41 UTC (rev 13610)
@@ -1571,7 +1571,7 @@
  * Decrement buckets appropriately. */
 static void
 connection_buckets_decrement(connection_t *conn, time_t now,
-                             int num_read, int num_written)
+                             size_t num_read, size_t num_written)
 {
   if (!connection_is_rate_limited(conn))
     return; /* local IPs are free */

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2008-02-20 02:05:28 UTC (rev 13609)
+++ tor/trunk/src/or/or.h	2008-02-20 02:17:41 UTC (rev 13610)
@@ -3556,8 +3556,8 @@
                                     const char *to_name);
 void rep_hist_note_extend_failed(const char *from_name, const char *to_name);
 void rep_hist_dump_stats(time_t now, int severity);
-void rep_hist_note_bytes_read(int num_bytes, time_t when);
-void rep_hist_note_bytes_written(int num_bytes, time_t when);
+void rep_hist_note_bytes_read(size_t num_bytes, time_t when);
+void rep_hist_note_bytes_written(size_t num_bytes, time_t when);
 int rep_hist_bandwidth_assess(void);
 char *rep_hist_get_bandwidth_lines(int for_extrainfo);
 void rep_hist_update_state(or_state_t *state);

Modified: tor/trunk/src/or/rephist.c
===================================================================
--- tor/trunk/src/or/rephist.c	2008-02-20 02:05:28 UTC (rev 13609)
+++ tor/trunk/src/or/rephist.c	2008-02-20 02:17:41 UTC (rev 13610)
@@ -1056,7 +1056,8 @@
     commit_max(b);
 }
 
-/** Add 'n' bytes to the number of bytes in b for second 'when'. */
+/** Add <b>n</b> bytes to the number of bytes in <b>b</b> for second
+ * <b>when</b>. */
 static INLINE void
 add_obs(bw_array_t *b, time_t when, uint64_t n)
 {
@@ -1106,7 +1107,7 @@
  * earlier than the latest <b>when</b> you've heard of.
  */
 void
-rep_hist_note_bytes_written(int num_bytes, time_t when)
+rep_hist_note_bytes_written(size_t num_bytes, time_t when)
 {
 /* Maybe a circular array for recent seconds, and step to a new point
  * every time a new second shows up. Or simpler is to just to have
@@ -1123,7 +1124,7 @@
  * (like rep_hist_note_bytes_written() above)
  */
 void
-rep_hist_note_bytes_read(int num_bytes, time_t when)
+rep_hist_note_bytes_read(size_t num_bytes, time_t when)
 {
 /* if we're smart, we can make this func and the one above share code */
   add_obs(read_array, when, num_bytes);
@@ -1148,7 +1149,7 @@
 
 /** Find the largest sums in the past NUM_SECS_BW_SUM_IS_VALID (roughly)
  * seconds. Find one sum for reading and one for writing. They don't have
- * to be at the same time).
+ * to be at the same time.
  *
  * Return the smaller of these sums, divided by NUM_SECS_ROLLING_MEASURE.
  */



More information about the tor-commits mailing list