summaryrefslogtreecommitdiffstats
path: root/nanohttp/nanohttp-response.c
diff options
context:
space:
mode:
authorGravatar snowdrop2004-10-29 09:27:02 +0000
committerGravatar snowdrop2004-10-29 09:27:02 +0000
commit7b58a8fb0b95d6809fbe3e8c7dc7a05729b6c828 (patch)
treeebd31f5db83e2f94329dd25067cdc856feaf76f6 /nanohttp/nanohttp-response.c
parentd24d6ab7bbfda8e302af3a5cf8be62299d543c1a (diff)
downloadcsoap-7b58a8fb0b95d6809fbe3e8c7dc7a05729b6c828.tar.gz
csoap-7b58a8fb0b95d6809fbe3e8c7dc7a05729b6c828.tar.bz2
added hoption feature
Diffstat (limited to 'nanohttp/nanohttp-response.c')
-rwxr-xr-xnanohttp/nanohttp-response.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/nanohttp/nanohttp-response.c b/nanohttp/nanohttp-response.c
index f2e13c5..3883950 100755
--- a/nanohttp/nanohttp-response.c
+++ b/nanohttp/nanohttp-response.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: nanohttp-response.c,v 1.2 2004/10/28 10:30:46 snowdrop Exp $
+* $Id: nanohttp-response.c,v 1.3 2004/10/29 09:27:05 snowdrop Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003-2004 Ferhat Ayaz
@@ -186,8 +186,15 @@ read_header: /* for errorcode: 100 (continue) */
}
else
{
- res->attachments = mimeMessage;
- res->in = http_input_stream_new_from_file(mimeMessage->root_part->filename);
+ res->attachments = mimeMessage;
+ http_input_stream_free(res->in);
+ res->in = http_input_stream_new_from_file(mimeMessage->root_part->filename);
+ if (!res->in) {
+ /* TODO (#1#): Handle error */
+
+ } else {
+ /*res->in->deleteOnExit = 1;*/
+ }
}
}
*out = res;
@@ -195,9 +202,9 @@ read_header: /* for errorcode: 100 (continue) */
}
-
-void
-hresponse_free(hresponse_t * res)
+
+void
+hresponse_free(hresponse_t * res)
{
if (res == NULL)
return;
@@ -210,7 +217,9 @@ hresponse_free(hresponse_t * res)
if (res->content_type)
content_type_free(res->content_type);
-
+
+ if (res->attachments)
+ attachments_free(res->attachments);
free(res);
}