diff options
author | teor <teor@torproject.org> | 2019-03-27 09:36:55 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-03-27 09:36:55 +1000 |
commit | c72526f16870226379c64fbed9e7b25351723c53 (patch) | |
tree | 1d19ba3a14daf6aaa72c027541fcc17f1e5966da /src/core/mainloop | |
parent | 7502e5467b5b22bee118616d393ace5d67b3607f (diff) | |
parent | 9ae8d663ea9006c9e20f48868d96877984652e16 (diff) | |
download | tor-c72526f16870226379c64fbed9e7b25351723c53.tar.gz tor-c72526f16870226379c64fbed9e7b25351723c53.zip |
Merge branch 'maint-0.4.0'
Diffstat (limited to 'src/core/mainloop')
-rw-r--r-- | src/core/mainloop/connection.c | 16 | ||||
-rw-r--r-- | src/core/mainloop/connection.h | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index 40e548a135..a56e7f9e0a 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -5379,17 +5379,20 @@ assert_connection_ok(connection_t *conn, time_t now) } /** Fills <b>addr</b> and <b>port</b> with the details of the global - * proxy server we are using. - * <b>conn</b> contains the connection we are using the proxy for. + * proxy server we are using. Store a 1 to the int pointed to by + * <b>is_put_out</b> if the connection is using a pluggable + * transport; store 0 otherwise. <b>conn</b> contains the connection + * we are using the proxy for. * * Return 0 on success, -1 on failure. */ int get_proxy_addrport(tor_addr_t *addr, uint16_t *port, int *proxy_type, - const connection_t *conn) + int *is_pt_out, const connection_t *conn) { const or_options_t *options = get_options(); + *is_pt_out = 0; /* Client Transport Plugins can use another proxy, but that should be hidden * from the rest of tor (as the plugin is responsible for dealing with the * proxy), check it first, then check the rest of the proxy types to allow @@ -5405,6 +5408,7 @@ get_proxy_addrport(tor_addr_t *addr, uint16_t *port, int *proxy_type, tor_addr_copy(addr, &transport->addr); *port = transport->port; *proxy_type = transport->socks_version; + *is_pt_out = 1; return 0; } @@ -5441,11 +5445,13 @@ log_failed_proxy_connection(connection_t *conn) { tor_addr_t proxy_addr; uint16_t proxy_port; - int proxy_type; + int proxy_type, is_pt; - if (get_proxy_addrport(&proxy_addr, &proxy_port, &proxy_type, conn) != 0) + if (get_proxy_addrport(&proxy_addr, &proxy_port, &proxy_type, &is_pt, + conn) != 0) return; /* if we have no proxy set up, leave this function. */ + (void)is_pt; log_warn(LD_NET, "The connection to the %s proxy server at %s just failed. " "Make sure that the proxy server is up and running.", diff --git a/src/core/mainloop/connection.h b/src/core/mainloop/connection.h index de6473251d..c93f1ef8e8 100644 --- a/src/core/mainloop/connection.h +++ b/src/core/mainloop/connection.h @@ -187,7 +187,7 @@ int connection_proxy_connect(connection_t *conn, int type); int connection_read_proxy_handshake(connection_t *conn); void log_failed_proxy_connection(connection_t *conn); int get_proxy_addrport(tor_addr_t *addr, uint16_t *port, int *proxy_type, - const connection_t *conn); + int *is_pt_out, const connection_t *conn); int retry_all_listeners(smartlist_t *new_conns, int close_all_noncontrol); |