sockets were left open if connection could not be
established resulting in a mass of unusable open file descriptors Signed-off-by: Tobias Maier <tobias.maier@netplace.com>
This commit is contained in:
parent
e59d477c07
commit
d1db83c650
1 changed files with 5 additions and 0 deletions
|
@ -80,6 +80,11 @@ struct libwebsocket *__libwebsocket_client_connect_2(
|
|||
if (connect(wsi->sock, (struct sockaddr *)&server_addr,
|
||||
sizeof(struct sockaddr)) == -1) {
|
||||
fprintf(stderr, "Connect failed\n");
|
||||
#ifdef WIN32
|
||||
closesocket(wsi->sock);
|
||||
#else
|
||||
close(wsi->sock);
|
||||
#endif
|
||||
goto oom4;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue