summaryrefslogtreecommitdiffstats
path: root/nanohttp/nanohttp-response.c
diff options
context:
space:
mode:
authorGravatar m0gg2006-12-10 19:21:05 +0000
committerGravatar m0gg2006-12-10 19:21:05 +0000
commitf4c29af542bbded2fe36d9bdc80808c3a7f5d92b (patch)
tree4e131c9e14555cce9dcb9af7298d88953a230e7a /nanohttp/nanohttp-response.c
parenta1267cdc17db793dbd3d960d1da0b6cf397e2b3e (diff)
downloadcsoap-f4c29af542bbded2fe36d9bdc80808c3a7f5d92b.tar.gz
csoap-f4c29af542bbded2fe36d9bdc80808c3a7f5d92b.tar.bz2
nhttp client fix and documentation update
Diffstat (limited to 'nanohttp/nanohttp-response.c')
-rwxr-xr-xnanohttp/nanohttp-response.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/nanohttp/nanohttp-response.c b/nanohttp/nanohttp-response.c
index 707b07b..5741683 100755
--- a/nanohttp/nanohttp-response.c
+++ b/nanohttp/nanohttp-response.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: nanohttp-response.c,v 1.16 2006/12/01 10:56:00 m0gg Exp $
+* $Id: nanohttp-response.c,v 1.17 2006/12/10 19:21:07 m0gg Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003-2004 Ferhat Ayaz
@@ -54,13 +54,12 @@
#include "nanohttp-response.h"
static hresponse_t *
-hresponse_new(void)
+_hresponse_new(void)
{
hresponse_t *res;
if (!(res = (hresponse_t *) malloc(sizeof(hresponse_t))))
{
-
log_error2("malloc failed (%s)", strerror(errno));
return NULL;
}
@@ -83,7 +82,7 @@ _hresponse_parse_header(const char *buffer)
char *s1, *s2, *str;
/* create response object */
- res = hresponse_new();
+ res = _hresponse_new();
/* *** parse spec *** */
/* [HTTP/1.1 | 1.2] [CODE] [DESC] */
@@ -154,7 +153,6 @@ _hresponse_parse_header(const char *buffer)
return res;
}
-
herror_t
hresponse_new_from_socket(struct hsocket_t *sock, hresponse_t ** out)
{
@@ -239,24 +237,24 @@ read_header: /* for errorcode: 100 (continue) */
return H_OK;
}
-
-
void
hresponse_free(hresponse_t * res)
{
- if (res == NULL)
- return;
+ if (res)
+ {
+ if (res->header)
+ hpairnode_free_deep(res->header);
- if (res->header)
- hpairnode_free_deep(res->header);
+ if (res->in)
+ http_input_stream_free(res->in);
- if (res->in)
- http_input_stream_free(res->in);
+ if (res->content_type)
+ content_type_free(res->content_type);
- if (res->content_type)
- content_type_free(res->content_type);
+ if (res->attachments)
+ attachments_free(res->attachments);
- if (res->attachments)
- attachments_free(res->attachments);
- free(res);
+ free(res);
+ }
+ return;
}