From 889a90340eec29e63cb7b8b8095442d5858ad7ce Mon Sep 17 00:00:00 2001 From: snowdrop Date: Tue, 3 Feb 2004 08:59:22 +0000 Subject: develop --- nanohttp/nanohttp-common.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'nanohttp/nanohttp-common.c') diff --git a/nanohttp/nanohttp-common.c b/nanohttp/nanohttp-common.c index 55a9f7f..1d00d42 100644 --- a/nanohttp/nanohttp-common.c +++ b/nanohttp/nanohttp-common.c @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: nanohttp-common.c,v 1.7 2004/01/21 12:28:20 snowdrop Exp $ + * $Id: nanohttp-common.c,v 1.8 2004/02/03 08:59:23 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -255,6 +255,17 @@ void hpairnode_free(hpair_t *pair) } +void hpairnode_free_deep(hpair_t *pair) +{ + hpair_t *tmp; + + while (pair != NULL) { + tmp = pair->next; + hpairnode_free(pair); + pair=tmp; + } +} + char *hpairnode_get_ignore_case(hpair_t *pair, const char* key) { if (key == NULL) { @@ -565,7 +576,15 @@ hrequest_t *hrequest_new_from_buffer(char *data) void hrequest_free(hrequest_t *req) { - log_warn1("hrequest_free() not implemented!"); + if (req == NULL) return; + + free(req->method); + free(req->path); + free(req->spec); + + hpairnode_free_deep(req->header); + hpairnode_free_deep(req->query); + } /* response stuff */ -- cgit v1.1-32-gdbae