From 232ff6e28d1fce08472a2f7a965d83d3e008d84c Mon Sep 17 00:00:00 2001 From: snowdrop Date: Fri, 27 May 2005 19:28:04 +0000 Subject: patch from mailinglist --- nanohttp/nanohttp-server.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'nanohttp/nanohttp-server.c') diff --git a/nanohttp/nanohttp-server.c b/nanohttp/nanohttp-server.c index d50c434..742ecc3 100644 --- a/nanohttp/nanohttp-server.c +++ b/nanohttp/nanohttp-server.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-server.c,v 1.31 2004/11/02 23:09:27 snowdrop Exp $ +* $Id: nanohttp-server.c,v 1.32 2005/05/27 19:28:15 snowdrop Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -26,6 +26,7 @@ #include #include #include +#include #ifdef HAVE_CONFIG_H #include @@ -41,6 +42,10 @@ #include #include +#ifdef HAVE_SOCKET +#include +#endif + #else #include @@ -51,6 +56,8 @@ #include #endif +#include + typedef struct _conndata { hsocket_t sock; @@ -71,7 +78,9 @@ typedef struct _conndata */ static int _httpd_port = 10000; static int _httpd_max_connections = 20; +#ifdef WIN32 static int _httpd_max_idle = 120; +#endif static hsocket_t _httpd_socket; static hservice_t *_httpd_services_head = NULL; static hservice_t *_httpd_services_tail = NULL; @@ -267,7 +276,7 @@ httpd_send_header (httpd_conn_t * res, int code, const char *text) /* set date */ nw = time (NULL); localtime_r (&nw, &stm); - strftime (buffer, 255, "Date: %a, %d %b %y %T GMT", &stm); + strftime (buffer, 255, "Date: %a, %d %b %Y %T GMT", &stm); strcat (header, buffer); strcat (header, "\r\n"); @@ -386,11 +395,9 @@ httpd_session_main (void *data) int len = strlen (msg); char buffer[256]; /* temp buffer for recv() */ char header[4064]; /* received header */ - int headerreached = 0; /* whether reach header * "\n\n" */ hrequest_t *req = NULL; /* only for test */ httpd_conn_t *rconn; hservice_t *service = NULL; - long content_length = 0; herror_t status; header[0] = '\0'; @@ -754,7 +761,6 @@ httpd_get_postdata (httpd_conn_t * conn, hrequest_t * req, long *received, { char *content_length_str; long content_length = 0; - long total = 0; unsigned char *postdata = NULL; if (req->method == HTTP_REQUEST_POST) -- cgit v1.1-32-gdbae