summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar snowdrop2004-10-18 11:42:00 +0000
committerGravatar snowdrop2004-10-18 11:42:00 +0000
commit1f7fec810c2a39f061e7dad804440709a6c55fbc (patch)
tree1ff2e9fb8c9ddc159a3b7c76175f6972a3c58ea0
parentf3b223de3d9dcc89df3f4900c8e9cf978ea914d5 (diff)
downloadcsoap-1f7fec810c2a39f061e7dad804440709a6c55fbc.tar.gz
csoap-1f7fec810c2a39f061e7dad804440709a6c55fbc.tar.bz2
hsocket_close() shutdown ported to non win32
-rw-r--r--nanohttp/nanohttp-socket.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/nanohttp/nanohttp-socket.c b/nanohttp/nanohttp-socket.c
index 1807e67..a8fff76 100644
--- a/nanohttp/nanohttp-socket.c
+++ b/nanohttp/nanohttp-socket.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: nanohttp-socket.c,v 1.26 2004/10/18 11:35:27 snowdrop Exp $
+* $Id: nanohttp-socket.c,v 1.27 2004/10/18 11:42:00 snowdrop Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -299,16 +299,18 @@ hsocket_close (hsocket_t sock)
_linger.l_linger = 30000;
setsockopt(sock, SOL_SOCKET, SO_LINGER, (const char*)&_linger, sizeof(struct linger));
*/
- shutdown(sock, SD_SEND);
- while (recv(sock, junk, sizeof(junk), 0)>0) { };
#ifdef WIN32
/*shutdown(sock,SD_RECEIVE);*/
+ shutdown(sock, SD_SEND);
+ while (recv(sock, junk, sizeof(junk), 0)>0) { };
closesocket(sock);
log_verbose1 ("closed");
#else
+ shutdown(sock, 1);
+ while (recv(sock, junk, sizeof(junk), 0)>0) { };
close (sock);
#endif
}