From 1f7fec810c2a39f061e7dad804440709a6c55fbc Mon Sep 17 00:00:00 2001 From: snowdrop Date: Mon, 18 Oct 2004 11:42:00 +0000 Subject: hsocket_close() shutdown ported to non win32 --- nanohttp/nanohttp-socket.c | 8 +++++--- 1 file 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 } -- cgit v1.1-32-gdbae