summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-01-26 08:01:29 +0000
committerRoger Dingledine <arma@torproject.org>2007-01-26 08:01:29 +0000
commit99c177143270544f80d224cc8b85edf351310ff3 (patch)
tree6e737760a227c1d9cc01c874fd64e6e51a8ca9d3 /src/or/connection.c
parent45e2ea0c2819330ccf8ad3154d98ce58494806dc (diff)
downloadtor-99c177143270544f80d224cc8b85edf351310ff3.tar.gz
tor-99c177143270544f80d224cc8b85edf351310ff3.zip
never refuse directory requests from local addresses
svn:r9421
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index e80633a740..823c5d1a17 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1175,8 +1175,8 @@ connection_bucket_write_limit(connection_t *conn)
}
/** Return 1 if the global write bucket is low enough that we shouldn't
- * send <b>attempt</b> bytes of low-priority directory stuff out.
- * Else return 0.
+ * send <b>attempt</b> bytes of low-priority directory stuff out to
+ * <b>conn</b>. Else return 0.
* Priority is 1 for v1 requests (directories and running-routers),
* and 2 for v2 requests (statuses and descriptors). But see FFFF in
@@ -1194,11 +1194,14 @@ connection_bucket_write_limit(connection_t *conn)
* that's harder to quantify and harder to keep track of.
*/
int
-global_write_bucket_low(size_t attempt, int priority)
+global_write_bucket_low(connection_t *conn, size_t attempt, int priority)
{
if (authdir_mode(get_options()) && priority>1)
return 0; /* there's always room to answer v2 if we're an auth dir */
+ if (is_internal_IP(conn->addr, 0))
+ return 0; /* local conns don't get limited */
+
if (global_write_bucket < (int)attempt)
return 1; /* not enough space no matter the priority */