aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-07-18 10:14:40 -0400
committerNick Mathewson <nickm@torproject.org>2012-07-18 10:14:40 -0400
commitf8c9cc713d608fcd37d25730e91a88d4a1081f28 (patch)
tree66511f361dc9eb1915a7cc469f1001cf57337dbb /src/or/connection.c
parentec8bdc5da81a27fd0d382db689addd8114347e1e (diff)
parentb355ddb20f534d772dcb42737ceb1d0264e2c3f1 (diff)
downloadtor-f8c9cc713d608fcd37d25730e91a88d4a1081f28.tar.gz
tor-f8c9cc713d608fcd37d25730e91a88d4a1081f28.zip
Merge remote-tracking branch 'origin/maint-0.2.3'
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 6c9b03b0b6..777162ca70 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -707,8 +707,7 @@ connection_expire_held_open(void)
now = time(NULL);
- SMARTLIST_FOREACH(conns, connection_t *, conn,
- {
+ SMARTLIST_FOREACH_BEGIN(conns, connection_t *, conn) {
/* If we've been holding the connection open, but we haven't written
* for 15 seconds...
*/
@@ -730,7 +729,7 @@ connection_expire_held_open(void)
conn->hold_open_until_flushed = 0;
}
}
- });
+ } SMARTLIST_FOREACH_END(conn);
}
#if defined(HAVE_SYS_UN_H) || defined(RUNNING_DOXYGEN)
@@ -2478,8 +2477,7 @@ connection_bucket_refill(int milliseconds_elapsed, time_t now)
"global_relayed_write_bucket");
/* refill the per-connection buckets */
- SMARTLIST_FOREACH(conns, connection_t *, conn,
- {
+ SMARTLIST_FOREACH_BEGIN(conns, connection_t *, conn) {
if (connection_speaks_cells(conn)) {
or_connection_t *or_conn = TO_OR_CONN(conn);
int orbandwidthrate = or_conn->bandwidthrate;
@@ -2526,7 +2524,7 @@ connection_bucket_refill(int milliseconds_elapsed, time_t now)
conn->write_blocked_on_bw = 0;
connection_start_writing(conn);
}
- });
+ } SMARTLIST_FOREACH_END(conn);
}
/** Is the <b>bucket</b> for connection <b>conn</b> low enough that we
@@ -3975,8 +3973,7 @@ connection_dump_buffer_mem_stats(int severity)
memset(alloc_by_type, 0, sizeof(alloc_by_type));
memset(n_conns_by_type, 0, sizeof(n_conns_by_type));
- SMARTLIST_FOREACH(conns, connection_t *, c,
- {
+ SMARTLIST_FOREACH_BEGIN(conns, connection_t *, c) {
int tp = c->type;
++n_conns_by_type[tp];
if (c->inbuf) {
@@ -3987,7 +3984,7 @@ connection_dump_buffer_mem_stats(int severity)
used_by_type[tp] += buf_datalen(c->outbuf);
alloc_by_type[tp] += buf_allocation(c->outbuf);
}
- });
+ } SMARTLIST_FOREACH_END(c);
for (i=0; i <= _CONN_TYPE_MAX; ++i) {
total_used += used_by_type[i];
total_alloc += alloc_by_type[i];