diff options
author | George Kadianakis <desnacked@riseup.net> | 2012-08-21 20:56:30 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2012-09-05 18:23:29 +0300 |
commit | b9551fd0741434e9d0917355d67164775eb25fbe (patch) | |
tree | 291054f841776c08cc5140b3f54d8c74acdb0623 /src/tools/tor-fw-helper | |
parent | 44fe717524408d247ab10e3794438232d81d66dc (diff) | |
download | tor-b9551fd0741434e9d0917355d67164775eb25fbe.tar tor-b9551fd0741434e9d0917355d67164775eb25fbe.tar.gz |
Fix some bugs that did not allow compilation on Windows.
Diffstat (limited to 'src/tools/tor-fw-helper')
-rw-r--r-- | src/tools/tor-fw-helper/tor-fw-helper.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/tools/tor-fw-helper/tor-fw-helper.c b/src/tools/tor-fw-helper/tor-fw-helper.c index d02b75791..4efe515cc 100644 --- a/src/tools/tor-fw-helper/tor-fw-helper.c +++ b/src/tools/tor-fw-helper/tor-fw-helper.c @@ -353,28 +353,18 @@ parse_port(const char *arg) /** Report a failure of epic proportions: We didn't manage to * initialize any port forwarding backends. */ static void -report_full_fail(const smartlist_t *ports_to_forward, backends_t *backends) +report_full_fail(const smartlist_t *ports_to_forward) { - char *list_of_backends_str = NULL; - char *fail_msg = NULL; - if (!ports_to_forward) return; - list_of_backends_str = get_list_of_backends_string(backends); - tor_asprintf(&fail_msg, - "Port forwarding backends (%s) could not be initialized.", - list_of_backends_str); - SMARTLIST_FOREACH_BEGIN(ports_to_forward, const port_to_forward_t *, port_to_forward) { tor_fw_helper_report_port_fw_fail(port_to_forward->internal_port, port_to_forward->external_port, - fail_msg); + "All backends (NAT-PMP, UPnP) failed " + "to initialize!"); /* XXX hardcoded */ } SMARTLIST_FOREACH_END(port_to_forward); - - tor_free(list_of_backends_str); - tor_free(fail_msg); } int @@ -481,8 +471,8 @@ main(int argc, char **argv) r = init_backends(&tor_fw_options, &backend_state); if (!r) { // all backends failed: // report our failure - report_full_fail(tor_fw_options.ports_to_forward, &backend_state); - fprintf(stderr, "V: tor-fw-helper: All backends failed.\n"); + report_full_fail(tor_fw_options.ports_to_forward); + fprintf(stderr, "tor-fw-helper: All backends failed.\n"); exit(1); } else { // some backends succeeded: fprintf(stderr, "tor-fw-helper: %i NAT traversal helper(s) loaded\n", r); |