mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Set socket family to family of proxy when using proxy.
This commit is contained in:
parent
7557b92fc9
commit
bb1bb58352
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user