Skip to content
Snippets Groups Projects
Commit d1db83c6 authored by Tobias Maier's avatar Tobias Maier Committed by Andy Green
Browse files

sockets were left open if connection could not be

 established resulting in a mass of unusable open file
 descriptors

Signed-off-by: default avatarTobias Maier <tobias.maier@netplace.com>
parent e59d477c
Branches
Tags
No related merge requests found
...@@ -80,6 +80,11 @@ struct libwebsocket *__libwebsocket_client_connect_2( ...@@ -80,6 +80,11 @@ struct libwebsocket *__libwebsocket_client_connect_2(
if (connect(wsi->sock, (struct sockaddr *)&server_addr, if (connect(wsi->sock, (struct sockaddr *)&server_addr,
sizeof(struct sockaddr)) == -1) { sizeof(struct sockaddr)) == -1) {
fprintf(stderr, "Connect failed\n"); fprintf(stderr, "Connect failed\n");
#ifdef WIN32
closesocket(wsi->sock);
#else
close(wsi->sock);
#endif
goto oom4; goto oom4;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment