diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-11-28 15:44:10 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-11-28 15:44:10 -0500 |
commit | df9b76460c38936b67ef42f5b261b39e2ec7144e (patch) | |
tree | c5a47b8120a7372e61a3284a5332dc88f7d3439e /src/or/connection.h | |
parent | b5a306e82c684bdd30b832fdfd9e2b55c06b54ae (diff) | |
download | tor-df9b76460c38936b67ef42f5b261b39e2ec7144e.tar.gz tor-df9b76460c38936b67ef42f5b261b39e2ec7144e.zip |
New 'DisableNetwork' option to prevent Tor from using the network
Some controllers want this so they can mess with Tor's configuration
for a while via the control port before actually letting Tor out of
the house.
We do this with a new DisableNetwork option, that prevents Tor from
making any outbound connections or binding any non-control
listeners. Additionally, it shuts down the same functionality as
shuts down when we are hibernating, plus the code that launches
directory downloads.
To make sure I didn't miss anything, I added a clause straight to
connection_connect, so that we won't even try to open an outbound
socket when the network is disabled. In my testing, I made this an
assert, but since I probably missed something, I've turned it into a
BUG warning for testing.
Diffstat (limited to 'src/or/connection.h')
-rw-r--r-- | src/or/connection.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/connection.h b/src/or/connection.h index 9f11489727..c4b8bf8abe 100644 --- a/src/or/connection.h +++ b/src/or/connection.h @@ -66,6 +66,9 @@ int get_proxy_addrport(tor_addr_t *addr, uint16_t *port, int *proxy_type, int retry_all_listeners(smartlist_t *replaced_conns, smartlist_t *new_conns); +void connection_mark_all_noncontrol_listeners(void); +void connection_mark_all_noncontrol_connections(void); + ssize_t connection_bucket_write_limit(connection_t *conn, time_t now); int global_write_bucket_low(connection_t *conn, size_t attempt, int priority); void connection_bucket_init(void); |