projects
/
profile
/
ivi
/
libwebsockets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e59d477
)
sockets were left open if connection could not be
author
Tobias Maier
<tobias.maier@netplace.com>
Wed, 30 May 2012 04:46:42 +0000
(12:46 +0800)
committer
Andy Green
<andy.green@linaro.org>
Wed, 30 May 2012 04:46:42 +0000
(12:46 +0800)
established resulting in a mass of unusable open file
descriptors
Signed-off-by: Tobias Maier <tobias.maier@netplace.com>
lib/client-handshake.c
patch
|
blob
|
history
diff --git
a/lib/client-handshake.c
b/lib/client-handshake.c
index
f8d0b69
..
d3d3daa
100644
(file)
--- a/
lib/client-handshake.c
+++ b/
lib/client-handshake.c
@@
-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;
}