diff --git a/toxcore/TCP_connection.c b/toxcore/TCP_connection.c index df0c24af..4da4c9b9 100644 --- a/toxcore/TCP_connection.c +++ b/toxcore/TCP_connection.c @@ -978,7 +978,7 @@ unsigned int tcp_copy_connected_relays(TCP_Connections *tcp_c, Node_format *tcp_ return copied; } -TCP_Connections *new_tcp_connections(DHT *dht) +TCP_Connections *new_tcp_connections(DHT *dht, TCP_Proxy_Info *proxy_info) { if (dht == NULL) return NULL; @@ -989,6 +989,8 @@ TCP_Connections *new_tcp_connections(DHT *dht) return NULL; temp->dht = dht; + temp->proxy_info = *proxy_info; + return temp; } diff --git a/toxcore/TCP_connection.h b/toxcore/TCP_connection.h index 9b82e575..0b7aae64 100644 --- a/toxcore/TCP_connection.h +++ b/toxcore/TCP_connection.h @@ -185,7 +185,7 @@ int add_tcp_relay_global(TCP_Connections *tcp_c, IP_Port ip_port, const uint8_t */ unsigned int tcp_copy_connected_relays(TCP_Connections *tcp_c, Node_format *tcp_relays, uint16_t max_num); -TCP_Connections *new_tcp_connections(DHT *dht); +TCP_Connections *new_tcp_connections(DHT *dht, TCP_Proxy_Info *proxy_info); void do_tcp_connections(TCP_Connections *tcp_c); void kill_tcp_connections(TCP_Connections *tcp_c); diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 784e8102..bd9969f5 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c @@ -2346,7 +2346,7 @@ Net_Crypto *new_net_crypto(DHT *dht, TCP_Proxy_Info *proxy_info) if (temp == NULL) return NULL; - temp->tcp_c = new_tcp_connections(dht); + temp->tcp_c = new_tcp_connections(dht, proxy_info); if (temp->tcp_c == NULL) { free(temp); @@ -2377,8 +2377,6 @@ Net_Crypto *new_net_crypto(DHT *dht, TCP_Proxy_Info *proxy_info) bs_list_init(&temp->ip_port_list, sizeof(IP_Port), 8); - temp->proxy_info = *proxy_info; - return temp; } diff --git a/toxcore/net_crypto.h b/toxcore/net_crypto.h index 2b107f20..c525c0c5 100644 --- a/toxcore/net_crypto.h +++ b/toxcore/net_crypto.h @@ -200,8 +200,6 @@ typedef struct { uint32_t current_sleep_time; BS_LIST ip_port_list; - - TCP_Proxy_Info proxy_info; } Net_Crypto;