diff options
Diffstat (limited to 'nanohttp')
-rw-r--r-- | nanohttp/nanohttp-client.c | 15 | ||||
-rw-r--r-- | nanohttp/nanohttp-client.h | 7 | ||||
-rw-r--r-- | nanohttp/nanohttp-socket.c | 4 |
3 files changed, 22 insertions, 4 deletions
diff --git a/nanohttp/nanohttp-client.c b/nanohttp/nanohttp-client.c index b1d101f..fc1d8f5 100644 --- a/nanohttp/nanohttp-client.c +++ b/nanohttp/nanohttp-client.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-client.c,v 1.27 2005/05/27 19:28:15 snowdrop Exp $ +* $Id: nanohttp-client.c,v 1.28 2005/07/27 07:45:56 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -92,6 +92,19 @@ httpc_new() return res; } +/*-------------------------------------------------- +FUNCTION: httpc_close_free +DESC: Close and free the given http client object. +----------------------------------------------------*/ +void +httpc_close_free(httpc_conn_t * conn) +{ + if (conn == NULL) + return; + + hsocket_close(conn->sock); + httpc_free(conn); +} /*-------------------------------------------------- FUNCTION: httpc_free diff --git a/nanohttp/nanohttp-client.h b/nanohttp/nanohttp-client.h index 06c0fcd..020f7e3 100644 --- a/nanohttp/nanohttp-client.h +++ b/nanohttp/nanohttp-client.h @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: nanohttp-client.h,v 1.14 2004/11/02 23:09:26 snowdrop Exp $ + * $Id: nanohttp-client.h,v 1.15 2005/07/27 07:45:57 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -71,6 +71,11 @@ void httpc_destroy(); httpc_conn_t* httpc_new(); /** + Close and release a connection +*/ +void httpc_close_free(httpc_conn_t* conn); + +/** Release a connections */ void httpc_free(httpc_conn_t* conn); diff --git a/nanohttp/nanohttp-socket.c b/nanohttp/nanohttp-socket.c index 468f3b9..69b17f3 100644 --- a/nanohttp/nanohttp-socket.c +++ b/nanohttp/nanohttp-socket.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-socket.c,v 1.33 2005/05/27 19:28:16 snowdrop Exp $ +* $Id: nanohttp-socket.c,v 1.34 2005/07/27 07:45:57 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -322,7 +322,7 @@ hsocket_close (hsocket_t sock) closesocket(sock); #else - shutdown(sock, 1); + shutdown(sock, SHUT_RDWR); while (recv(sock, junk, sizeof(junk), 0)>0) { }; close (sock); #endif |