From c28397f760d22a1e8be126725ff7784b2d8fec23 Mon Sep 17 00:00:00 2001 From: snowdrop Date: Mon, 1 Nov 2004 15:16:22 +0000 Subject: added soap_ctx_add_file() --- nanohttp/nanohttp-common.h | 50 ++++++++++++++++++++++++---------------------- nanohttp/nanohttp-mime.c | 9 +++++++-- 2 files changed, 33 insertions(+), 26 deletions(-) (limited to 'nanohttp') diff --git a/nanohttp/nanohttp-common.h b/nanohttp/nanohttp-common.h index 1d89d30..e633ab4 100644 --- a/nanohttp/nanohttp-common.h +++ b/nanohttp/nanohttp-common.h @@ -1,25 +1,25 @@ -/****************************************************************** - * $Id: nanohttp-common.h,v 1.15 2004/10/29 09:27:05 snowdrop Exp $ - * - * CSOAP Project: A http client/server library in C - * Copyright (C) 2003-2004 Ferhat Ayaz - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Email: ferhatayaz@yahoo.com +/****************************************************************** + * $Id: nanohttp-common.h,v 1.16 2004/11/01 15:16:26 snowdrop Exp $ + * + * CSOAP Project: A http client/server library in C + * Copyright (C) 2003-2004 Ferhat Ayaz + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Email: ferhatayaz@yahoo.com ******************************************************************/ #ifndef NANO_HTTP_COMMON_H #define NANO_HTTP_COMMON_H @@ -29,7 +29,8 @@ #define HEADER_CONTENT_LENGTH "Content-Length" #define HEADER_CONTENT_TYPE "Content-Type" -#define HEADER_CONTENT_ID "Content-Id" +#define HEADER_CONTENT_ID "Content-Id" +#define HEADER_CONTENT_LOCATION "Content-Location" #define HEADER_CONTENT_TRANSFER_ENCODING "Content-Transfer-Encoding" #define HEADER_TRANSFER_ENCODING "Transfer-Encoding" #define HEADER_CONNECTION "Connection" @@ -412,7 +413,8 @@ void content_type_free(content_type_t *ct); */ typedef struct _part { - char id[250]; + char id[250]; + char location[250]; hpair_t *header; char content_type[128]; char transfer_encoding[128]; diff --git a/nanohttp/nanohttp-mime.c b/nanohttp/nanohttp-mime.c index 5b8a5f4..2089348 100755 --- a/nanohttp/nanohttp-mime.c +++ b/nanohttp/nanohttp-mime.c @@ -3,7 +3,7 @@ * | \/ | | | | \/ | | _/ * |_''_| |_| |_''_| |_'/ PARSER * -* $Id: nanohttp-mime.c,v 1.4 2004/10/29 09:27:05 snowdrop Exp $ +* $Id: nanohttp-mime.c,v 1.5 2004/11/01 15:16:26 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003-2004 Ferhat Ayaz @@ -664,7 +664,7 @@ static void _mime_received_bytes(void *data, const unsigned char* bytes, int size) { int i=0; - char *id, *type; + char *id, *type, *location; mime_callback_data_t *cbdata = (mime_callback_data_t*)data; if (!cbdata ) { @@ -737,6 +737,11 @@ void _mime_received_bytes(void *data, const unsigned char* bytes, int size) if (!strcmp(id, cbdata->root_id)) cbdata->message->root_part = cbdata->current_part; } + location = hpairnode_get(cbdata->current_part->header, HEADER_CONTENT_LOCATION); + if (location != NULL) + { + strcpy(cbdata->current_part->location, location); + } type = hpairnode_get(cbdata->current_part->header, HEADER_CONTENT_TYPE); if (type != NULL) { -- cgit v1.1-32-gdbae