summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2012-06-07 19:16:18 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2012-09-05 18:04:34 +0300
commitcd05f35d2cdf50d31108428cf5c19549d468dbc0 (patch)
treedc9379c4e24762af4d5fda709a145adf2b6a6dfe /src/or
parent64b2a64310a66a3e22403917ecdef38263ba0483 (diff)
downloadtor-cd05f35d2cdf50d31108428cf5c19549d468dbc0.tar.gz
tor-cd05f35d2cdf50d31108428cf5c19549d468dbc0.zip
Refactor tor to support the new tor-fw-helper protocol.
Add handle_fw_helper_output(), a function responsible for parsing the output of tor-fw-helper. Refactor tor_check_port_forwarding() and run_scheduled_events() accordingly too. We now issue warnings when we get control output from tor-fw-helper, and we log the verbose output of tor-fw-helper in LOG_INFO. Conflicts: src/common/util.c
Diffstat (limited to 'src/or')
-rw-r--r--src/or/main.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/or/main.c b/src/or/main.c
index f3624f6cfb..7b750ba753 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1547,11 +1547,15 @@ run_scheduled_events(time_t now)
options->PortForwarding &&
is_server) {
#define PORT_FORWARDING_CHECK_INTERVAL 5
- /* XXXXX this should take a list of ports, not just two! */
- tor_check_port_forwarding(options->PortForwardingHelper,
- get_primary_dir_port(),
- get_primary_or_port(),
- now);
+ smartlist_t *ports_to_forward = NULL;//get_list_of_ports_to_forward();
+ if (ports_to_forward) {
+ tor_check_port_forwarding(options->PortForwardingHelper,
+ ports_to_forward,
+ now);
+
+ SMARTLIST_FOREACH(ports_to_forward, char *, cp, tor_free(cp));
+ smartlist_free(ports_to_forward);
+ }
time_to_check_port_forwarding = now+PORT_FORWARDING_CHECK_INTERVAL;
}