diff options
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 9c6003ae..18f63c5f 100644 --- a/toxcore/TCP_client.c +++ b/toxcore/TCP_client.c | |||
@@ -253,6 +253,11 @@ TCP_Client_Connection *new_TCP_connection(IP_Port ip_port, uint8_t *public_key, | |||
253 | return NULL; | 253 | return NULL; |
254 | } | 254 | } |
255 | 255 | ||
256 | if (!set_socket_nosigpipe(sock)) { | ||
257 | kill_sock(sock); | ||
258 | return 0; | ||
259 | } | ||
260 | |||
256 | if (!(set_socket_nonblock(sock) && connect_sock_to(sock, ip_port))) { | 261 | if (!(set_socket_nonblock(sock) && connect_sock_to(sock, ip_port))) { |
257 | kill_sock(sock); | 262 | kill_sock(sock); |
258 | return NULL; | 263 | return NULL; |
@@ -433,4 +438,4 @@ void kill_TCP_connection(TCP_Client_Connection *TCP_connection) | |||
433 | kill_sock(TCP_connection->sock); | 438 | kill_sock(TCP_connection->sock); |
434 | memset(TCP_connection, 0, sizeof(TCP_Client_Connection)); | 439 | memset(TCP_connection, 0, sizeof(TCP_Client_Connection)); |
435 | free(TCP_connection); | 440 | free(TCP_connection); |
436 | } \ No newline at end of file | 441 | } |