From befc37ada0b901ad7c315e4089976508396d496b Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 19 Nov 2007 18:17:23 +0000 Subject: uIP webserver now uses listen/accept git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@386 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/netutils/webserver/httpd.h | 53 +++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 14 deletions(-) (limited to 'nuttx/netutils/webserver/httpd.h') diff --git a/nuttx/netutils/webserver/httpd.h b/nuttx/netutils/webserver/httpd.h index b256c1dd1..cf067f807 100644 --- a/nuttx/netutils/webserver/httpd.h +++ b/nuttx/netutils/webserver/httpd.h @@ -1,11 +1,19 @@ -/* httpd.h +/**************************************************************************** + * netutils/webserver/httpd.h * - * Copyright (c) 2001-2005, Adam Dunkels. - * All rights reserved. + * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Based on uIP which also has a BSD style license: + * + * Author: Adam Dunkels + * Copyright (c) 2001-2005, Adam Dunkels. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright @@ -26,15 +34,33 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ + * + ****************************************************************************/ #ifndef _NETUTILS_WEBSERVER_HTTPD_H #define _NETUTILS_WEBSERVER_HTTPD_H +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include #include +/**************************************************************************** + * Definitions + ****************************************************************************/ + #define HTTPD_FS_STATISTICS 1 -#define HTTPD_INBUFFER_SIZE 50 +#define HTTPD_IOBUFFER_SIZE 512 + +#ifndef CONFIG_EXAMPLES_UIP_HTTPDSTACKSIZE +# define CONFIG_EXAMPLES_UIP_HTTPDSTACKSIZE 4096 +#endif + +/**************************************************************************** + * Public Types + ****************************************************************************/ struct httpd_fs_file { @@ -44,13 +70,10 @@ struct httpd_fs_file struct httpd_state { - unsigned char timer; - int sockin; - int sockout; - char inputbuf[HTTPD_INBUFFER_SIZE]; + char ht_buffer[HTTPD_IOBUFFER_SIZE]; char filename[20]; - char state; struct httpd_fs_file file; + int sockfd; /* The socket descriptor from accept() */ int len; char *scriptptr; int scriptlen; @@ -58,17 +81,19 @@ struct httpd_state unsigned short count; }; +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + #ifdef HTTPD_FS_STATISTICS #if HTTPD_FS_STATISTICS == 1 extern uint16 httpd_fs_count(char *name); #endif /* HTTPD_FS_STATISTICS */ #endif /* HTTPD_FS_STATISTICS */ -/* file must be allocated by caller and will be filled in - * by the function. - */ +/* file must be allocated by caller and will be filled in by the function. */ -int httpd_fs_open(const char *name, struct httpd_fs_file *file); +int httpd_fs_open(const char *name, struct httpd_fs_file *file); void httpd_fs_init(void); #endif /* _NETUTILS_WEBSERVER_HTTPD_H */ -- cgit v1.2.3