diff options
author | irungentoo <irungentoo@gmail.com> | 2014-08-15 12:06:13 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-08-15 12:06:13 -0400 |
commit | bb1bb583524cc2a955b2492d0f0dbc2dc570fe4c (patch) | |
tree | aeb47b5553053efccd61ad16d5b10214d662df51 /toxcore/TCP_client.c | |
parent | 7557b92fc9699e0c762e627f97b4d997506ddedf (diff) |
Set socket family to family of proxy when using proxy.
Diffstat (limited to 'toxcore/TCP_client.c')
-rw-r--r-- | toxcore/TCP_client.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/toxcore/TCP_client.c b/toxcore/TCP_client.c index 06a5c394..f7b208e0 100644 --- a/toxcore/TCP_client.c +++ b/toxcore/TCP_client.c | |||
@@ -544,7 +544,12 @@ TCP_Client_Connection *new_TCP_connection(IP_Port ip_port, const uint8_t *public | |||
544 | if (ip_port.ip.family != AF_INET && ip_port.ip.family != AF_INET6) | 544 | if (ip_port.ip.family != AF_INET && ip_port.ip.family != AF_INET6) |
545 | return NULL; | 545 | return NULL; |
546 | 546 | ||
547 | sock_t sock = socket(ip_port.ip.family, SOCK_STREAM, IPPROTO_TCP); | 547 | uint8_t family = ip_port.ip.family; |
548 | |||
549 | if (proxy_info) | ||
550 | family = proxy_info->ip_port.ip.family; | ||
551 | |||
552 | sock_t sock = socket(family, SOCK_STREAM, IPPROTO_TCP); | ||
548 | 553 | ||
549 | if (!sock_valid(sock)) { | 554 | if (!sock_valid(sock)) { |
550 | return NULL; | 555 | return NULL; |