From 949a8d0b46d6baa9f42c2f8c3bd5e3bdc3596cbd Mon Sep 17 00:00:00 2001 From: m0gg Date: Sun, 19 Nov 2006 09:40:14 +0000 Subject: nanohttp admin patch; code cleanup --- nanohttp/nanohttp-client.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'nanohttp/nanohttp-client.c') diff --git a/nanohttp/nanohttp-client.c b/nanohttp/nanohttp-client.c index 7b9376f..10b16c2 100644 --- a/nanohttp/nanohttp-client.c +++ b/nanohttp/nanohttp-client.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-client.c,v 1.41 2006/07/09 16:24:19 snowdrop Exp $ +* $Id: nanohttp-client.c,v 1.42 2006/11/19 09:40:14 m0gg Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -25,8 +25,12 @@ #include #endif -#ifdef HAVE_TIME_H -#include +#ifdef HAVE_SYS_TIME_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include #endif #ifdef HAVE_STDIO_H @@ -45,14 +49,17 @@ #include #endif -#ifdef MEM_DEBUG -#include +#ifdef HAVE_NETINET_IN_H +#include #endif -#include "nanohttp-client.h" +#include "nanohttp-common.h" #include "nanohttp-socket.h" +#include "nanohttp-stream.h" +#include "nanohttp-response.h" #include "nanohttp-base64.h" #include "nanohttp-logging.h" +#include "nanohttp-client.h" /*-------------------------------------------------- FUNCTION: httpc_init @@ -553,8 +560,7 @@ httpc_mime_next(httpc_conn_t * conn, sprintf(buffer, "\r\n--%s\r\n", boundary); /* Send boundary */ - status = http_output_stream_write(conn->out, - (const byte_t *) buffer, strlen(buffer)); + status = http_output_stream_write(conn->out, buffer, strlen(buffer)); if (status != H_OK) return status; @@ -565,8 +571,7 @@ httpc_mime_next(httpc_conn_t * conn, HEADER_CONTENT_TRANSFER_ENCODING, transfer_encoding, HEADER_CONTENT_ID, content_id); - return http_output_stream_write(conn->out, - (const byte_t *) buffer, strlen(buffer)); + return http_output_stream_write(conn->out, buffer, strlen(buffer)); } @@ -582,8 +587,7 @@ httpc_mime_end(httpc_conn_t * conn, hresponse_t ** out) sprintf(buffer, "\r\n--%s--\r\n\r\n", boundary); /* Send boundary */ - status = http_output_stream_write(conn->out, - (const byte_t *) buffer, strlen(buffer)); + status = http_output_stream_write(conn->out, buffer, strlen(buffer)); if (status != H_OK) return status; @@ -610,7 +614,7 @@ httpc_mime_send_file(httpc_conn_t * conn, { herror_t status; FILE *fd = fopen(filename, "rb"); - byte_t buffer[MAX_FILE_BUFFER_SIZE]; + unsigned char buffer[MAX_FILE_BUFFER_SIZE]; size_t size; if (fd == NULL) -- cgit v1.1-32-gdbae