mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Change proxy-address type to tor_addr_t to allow ipv6 proxies.
This commit is contained in:
+6
-6
@@ -3386,7 +3386,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
|
||||
REJECT("Failed to parse accounting options. See logs for details.");
|
||||
|
||||
if (options->HttpProxy) { /* parse it now */
|
||||
if (parse_addr_port(LOG_WARN, options->HttpProxy, NULL,
|
||||
if (tor_addr_port_parse(options->HttpProxy,
|
||||
&options->HttpProxyAddr, &options->HttpProxyPort) < 0)
|
||||
REJECT("HttpProxy failed to parse or resolve. Please fix.");
|
||||
if (options->HttpProxyPort == 0) { /* give it a default */
|
||||
@@ -3400,7 +3400,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
|
||||
}
|
||||
|
||||
if (options->HttpsProxy) { /* parse it now */
|
||||
if (parse_addr_port(LOG_WARN, options->HttpsProxy, NULL,
|
||||
if (tor_addr_port_parse(options->HttpsProxy,
|
||||
&options->HttpsProxyAddr, &options->HttpsProxyPort) <0)
|
||||
REJECT("HttpsProxy failed to parse or resolve. Please fix.");
|
||||
if (options->HttpsProxyPort == 0) { /* give it a default */
|
||||
@@ -3414,7 +3414,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
|
||||
}
|
||||
|
||||
if (options->Socks4Proxy) { /* parse it now */
|
||||
if (parse_addr_port(LOG_WARN, options->Socks4Proxy, NULL,
|
||||
if (tor_addr_port_parse(options->Socks4Proxy,
|
||||
&options->Socks4ProxyAddr,
|
||||
&options->Socks4ProxyPort) <0)
|
||||
REJECT("Socks4Proxy failed to parse or resolve. Please fix.");
|
||||
@@ -3424,9 +3424,9 @@ options_validate(or_options_t *old_options, or_options_t *options,
|
||||
}
|
||||
|
||||
if (options->Socks5Proxy) { /* parse it now */
|
||||
if (parse_addr_port(LOG_WARN, options->Socks5Proxy, NULL,
|
||||
&options->Socks5ProxyAddr,
|
||||
&options->Socks5ProxyPort) <0)
|
||||
if (tor_addr_port_parse(options->Socks5Proxy,
|
||||
&options->Socks5ProxyAddr,
|
||||
&options->Socks5ProxyPort) <0)
|
||||
REJECT("Socks5Proxy failed to parse or resolve. Please fix.");
|
||||
if (options->Socks5ProxyPort == 0) { /* give it a default */
|
||||
options->Socks5ProxyPort = 1080;
|
||||
|
||||
@@ -721,15 +721,15 @@ connection_or_connect(const tor_addr_t *_addr, uint16_t port,
|
||||
/* use a proxy server if available */
|
||||
if (options->HttpsProxy) {
|
||||
using_proxy = 1;
|
||||
tor_addr_from_ipv4h(&addr, options->HttpsProxyAddr);
|
||||
tor_addr_copy(&addr, &options->HttpsProxyAddr);
|
||||
port = options->HttpsProxyPort;
|
||||
} else if (options->Socks4Proxy) {
|
||||
using_proxy = 1;
|
||||
tor_addr_from_ipv4h(&addr, options->Socks4ProxyAddr);
|
||||
tor_addr_copy(&addr, &options->Socks4ProxyAddr);
|
||||
port = options->Socks4ProxyPort;
|
||||
} else if (options->Socks5Proxy) {
|
||||
using_proxy = 1;
|
||||
tor_addr_from_ipv4h(&addr, options->Socks5ProxyAddr);
|
||||
tor_addr_copy(&addr, &options->Socks5ProxyAddr);
|
||||
port = options->Socks5ProxyPort;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -781,7 +781,7 @@ directory_initiate_command_rend(const char *address, const tor_addr_t *_addr,
|
||||
/* then we want to connect to dirport directly */
|
||||
|
||||
if (options->HttpProxy) {
|
||||
tor_addr_from_ipv4h(&addr, options->HttpProxyAddr);
|
||||
tor_addr_copy(&addr, &options->HttpProxyAddr);
|
||||
dir_port = options->HttpProxyPort;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -2349,21 +2349,21 @@ typedef struct {
|
||||
char *ContactInfo; /**< Contact info to be published in the directory. */
|
||||
|
||||
char *HttpProxy; /**< hostname[:port] to use as http proxy, if any. */
|
||||
uint32_t HttpProxyAddr; /**< Parsed IPv4 addr for http proxy, if any. */
|
||||
tor_addr_t HttpProxyAddr; /**< Parsed IPv4 addr for http proxy, if any. */
|
||||
uint16_t HttpProxyPort; /**< Parsed port for http proxy, if any. */
|
||||
char *HttpProxyAuthenticator; /**< username:password string, if any. */
|
||||
|
||||
char *HttpsProxy; /**< hostname[:port] to use as https proxy, if any. */
|
||||
uint32_t HttpsProxyAddr; /**< Parsed IPv4 addr for https proxy, if any. */
|
||||
tor_addr_t HttpsProxyAddr; /**< Parsed addr for https proxy, if any. */
|
||||
uint16_t HttpsProxyPort; /**< Parsed port for https proxy, if any. */
|
||||
char *HttpsProxyAuthenticator; /**< username:password string, if any. */
|
||||
|
||||
char *Socks4Proxy;
|
||||
uint32_t Socks4ProxyAddr;
|
||||
tor_addr_t Socks4ProxyAddr;
|
||||
uint16_t Socks4ProxyPort;
|
||||
|
||||
char *Socks5Proxy;
|
||||
uint32_t Socks5ProxyAddr;
|
||||
tor_addr_t Socks5ProxyAddr;
|
||||
uint16_t Socks5ProxyPort;
|
||||
char *Socks5ProxyUsername;
|
||||
char *Socks5ProxyPassword;
|
||||
|
||||
Reference in New Issue
Block a user