aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-09-14 22:32:36 -0400
committerNick Mathewson <nickm@torproject.org>2010-09-14 22:32:36 -0400
commit6d8fc4eb3866122ef42f209cc51a875a3e438607 (patch)
tree89190e195c05359882d3ce2fbc282419eaa6d928 /src/or/connection_or.c
parent60e3def3ed7428b139cfd6e36517f930a84bd085 (diff)
downloadtor-6d8fc4eb3866122ef42f209cc51a875a3e438607.tar.gz
tor-6d8fc4eb3866122ef42f209cc51a875a3e438607.zip
Add a simple integer-ceiling-division macro before we get it wrong
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 0ba1bca31f..686037f2de 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -252,8 +252,7 @@ connection_or_flushed_some(or_connection_t *conn)
/* If we're under the low water mark, add cells until we're just over the
* high water mark. */
if (datalen < OR_CONN_LOWWATER) {
- ssize_t n = (OR_CONN_HIGHWATER - datalen + CELL_NETWORK_SIZE-1)
- / CELL_NETWORK_SIZE;
+ ssize_t n = CEIL_DIV(OR_CONN_HIGHWATER - datalen, CELL_NETWORK_SIZE);
time_t now = approx_time();
while (conn->active_circuits && n > 0) {
int flushed;