aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-02-20 02:17:41 +0000
committerRoger Dingledine <arma@torproject.org>2008-02-20 02:17:41 +0000
commit1c8bd320beed5379ab3b755d41cb2fd051858a67 (patch)
tree1113c8a64b15cd4dc16821ce7515443eb69423a0 /src
parentf2ed011813014a45953bef8da04b24ccfc7d9e29 (diff)
downloadtor-1c8bd320beed5379ab3b755d41cb2fd051858a67.tar.gz
tor-1c8bd320beed5379ab3b755d41cb2fd051858a67.zip
pass bucket sizes num_read and num_written around as size_ts
rather than ints svn:r13610
Diffstat (limited to 'src')
-rw-r--r--src/or/connection.c2
-rw-r--r--src/or/or.h4
-rw-r--r--src/or/rephist.c9
3 files changed, 8 insertions, 7 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 5f80872c0f..ef352f958e 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1571,7 +1571,7 @@ global_write_bucket_low(connection_t *conn, size_t attempt, int priority)
* 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 */
diff --git a/src/or/or.h b/src/or/or.h
index ab07cd2996..f4427089c3 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3556,8 +3556,8 @@ void rep_hist_note_extend_succeeded(const char *from_name,
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);
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 90198cb43a..76b14247aa 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1056,7 +1056,8 @@ advance_obs(bw_array_t *b)
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 @@ bw_arrays_init(void)
* 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 @@ rep_hist_note_bytes_written(int num_bytes, time_t when)
* (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_largest_max(bw_array_t *b)
/** 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.
*/