Skip to content

Commit

Permalink
Set socket family to family of proxy when using proxy.
Browse files Browse the repository at this point in the history
  • Loading branch information
irungentoo committed Aug 15, 2014
1 parent 7557b92 commit bb1bb58
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion toxcore/TCP_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,12 @@ TCP_Client_Connection *new_TCP_connection(IP_Port ip_port, const uint8_t *public
if (ip_port.ip.family != AF_INET && ip_port.ip.family != AF_INET6)
return NULL;

sock_t sock = socket(ip_port.ip.family, SOCK_STREAM, IPPROTO_TCP);
uint8_t family = ip_port.ip.family;

if (proxy_info)
family = proxy_info->ip_port.ip.family;

sock_t sock = socket(family, SOCK_STREAM, IPPROTO_TCP);

if (!sock_valid(sock)) {
return NULL;
Expand Down

0 comments on commit bb1bb58

Please sign in to comment.