From 8684b8cf790b76fc68e2cc2b7f797c505c70ee2f Mon Sep 17 00:00:00 2001 From: snowdrop Date: Mon, 19 Dec 2005 14:18:26 +0000 Subject: pathed stuf from mailinglist after 1.0.4rc1 --- nanohttp/nanohttp-client.c | 16 +++++++++++++++- nanohttp/nanohttp-client.h | 10 ++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'nanohttp') diff --git a/nanohttp/nanohttp-client.c b/nanohttp/nanohttp-client.c index 79d6b0a..cd13af8 100644 --- a/nanohttp/nanohttp-client.c +++ b/nanohttp/nanohttp-client.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-client.c,v 1.29 2005/12/19 14:06:16 snowdrop Exp $ +* $Id: nanohttp-client.c,v 1.30 2005/12/19 14:18:26 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -126,6 +126,20 @@ httpc_free(httpc_conn_t * conn) } +/*-------------------------------------------------- + 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_set_header diff --git a/nanohttp/nanohttp-client.h b/nanohttp/nanohttp-client.h index 020f7e3..395b29a 100644 --- a/nanohttp/nanohttp-client.h +++ b/nanohttp/nanohttp-client.h @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: nanohttp-client.h,v 1.15 2005/07/27 07:45:57 snowdrop Exp $ + * $Id: nanohttp-client.h,v 1.16 2005/12/19 14:18:26 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -76,10 +76,16 @@ httpc_conn_t* httpc_new(); void httpc_close_free(httpc_conn_t* conn); /** - Release a connections + Release a connection + (use httpc_close_free() instead) */ void httpc_free(httpc_conn_t* conn); +/** + * Close and release a connection + */ +void httpc_close_free(httpc_conn_t* conn); + /** Set header element (key,value) pair. */ -- cgit v1.1-32-gdbae