summaryrefslogtreecommitdiff
path: root/nuttx/netutils/webserver/httpd.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-19 18:17:23 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-19 18:17:23 +0000
commitbefc37ada0b901ad7c315e4089976508396d496b (patch)
tree44818265dc09577601c19bf81b3576109f31a534 /nuttx/netutils/webserver/httpd.h
parent6f5479c267e1ed09e85461464ae73b4cbfd3d486 (diff)
downloadnuttx-befc37ada0b901ad7c315e4089976508396d496b.tar.gz
nuttx-befc37ada0b901ad7c315e4089976508396d496b.tar.bz2
nuttx-befc37ada0b901ad7c315e4089976508396d496b.zip
uIP webserver now uses listen/accept
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@386 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/netutils/webserver/httpd.h')
-rw-r--r--nuttx/netutils/webserver/httpd.h53
1 files changed, 39 insertions, 14 deletions
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 <spudmonkey@racsa.co.cr>
+ *
+ * Based on uIP which also has a BSD style license:
+ *
+ * Author: Adam Dunkels <adam@sics.se>
+ * 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 <nuttx/config.h>
#include <sys/types.h>
+/****************************************************************************
+ * 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 */