summaryrefslogtreecommitdiff
path: root/src/common/compat_libevent.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-08-24 17:09:56 -0400
committerNick Mathewson <nickm@torproject.org>2011-08-24 17:31:32 -0400
commit59d0f750c972011372febefbee958b37a17a0569 (patch)
treebb8da76fc73ba427afd23f54f7465a469cd3ba11 /src/common/compat_libevent.h
parentede9cd4f99e4cd1c0c4bcf1a3ac994e87054cc2d (diff)
downloadtor-59d0f750c972011372febefbee958b37a17a0569.tar.gz
tor-59d0f750c972011372febefbee958b37a17a0569.zip
Apply rate-limiting to the lowest bufferevent in the stack.
When we're doing filtering ssl bufferevents, we want the rate-limits to apply to the lowest level of the bufferevent stack, so that we're actually limiting bytes sent on the network. Otherwise, we'll read from the network aggressively, and only limit stuff as we process it.
Diffstat (limited to 'src/common/compat_libevent.h')
-rw-r--r--src/common/compat_libevent.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/compat_libevent.h b/src/common/compat_libevent.h
index bbe105bf40..15b0fc273b 100644
--- a/src/common/compat_libevent.h
+++ b/src/common/compat_libevent.h
@@ -10,6 +10,8 @@ struct event;
struct event_base;
#ifdef USE_BUFFEREVENTS
struct bufferevent;
+struct ev_token_bucket_cfg;
+struct bufferevent_rate_limit_group;
#endif
#ifdef HAVE_EVENT2_EVENT_H
@@ -74,6 +76,10 @@ const char *tor_libevent_get_version_str(void);
#define TOR_LIBEVENT_TICKS_PER_SECOND 3
const struct timeval *tor_libevent_get_one_tick_timeout(void);
int tor_libevent_using_iocp_bufferevents(void);
+int tor_set_bufferevent_rate_limit(struct bufferevent *bev,
+ struct ev_token_bucket_cfg *cfg);
+int tor_add_bufferevent_to_rate_limit_group(struct bufferevent *bev,
+ struct bufferevent_rate_limit_group *g);
#endif
#endif