From d7c4593ff2b4c55fdc33676e20ecafff1c87e62c Mon Sep 17 00:00:00 2001 From: snowdrop Date: Wed, 27 Jul 2005 07:45:40 +0000 Subject: Changes of Menzo nanohttp/nanohttp-client.c and nanohttp/nanohttp-client.h added httpc_close_free, a variant of httpc_free which explicitly asks to close the socket. Otherwise after a number of client/server interactions we get socket error 24 (Too many open files). libcsoap/soap-client.c call httpc_close_free instead of httpc_free nanohttp/nanohttp-socket.c in hsocket_close call shutdown with SHUT_RDWR instead of 1 (SHUT_WR). Otherwise after a number of client/server interactions the shutdown call doesn't return anymore. --- nanohttp/nanohttp-client.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'nanohttp/nanohttp-client.c') 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 -- cgit v1.1-32-gdbae