diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-03-22 16:10:28 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-03-22 16:10:28 +0000 |
commit | 0554e0302db0094f60b7595ea7f8770f3a69bb27 (patch) | |
tree | 95ea97c686f649de8b709829b3b66c39db534dd1 /nuttx/netutils/webserver/httpd_fs.c | |
parent | bee94a4100a4e77585377441482f837a39980792 (diff) | |
download | nuttx-0554e0302db0094f60b7595ea7f8770f3a69bb27.tar.gz nuttx-0554e0302db0094f60b7595ea7f8770f3a69bb27.tar.bz2 nuttx-0554e0302db0094f60b7595ea7f8770f3a69bb27.zip |
Fix various issues, bad ages, etc. with ez80+uIP webserver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1638 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/netutils/webserver/httpd_fs.c')
-rw-r--r-- | nuttx/netutils/webserver/httpd_fs.c | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/nuttx/netutils/webserver/httpd_fs.c b/nuttx/netutils/webserver/httpd_fs.c index 0528f6ed2..0fe93c849 100644 --- a/nuttx/netutils/webserver/httpd_fs.c +++ b/nuttx/netutils/webserver/httpd_fs.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/webserver/httpd_fs.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Based on uIP which also has a BSD style license: @@ -38,7 +38,7 @@ ****************************************************************************/ /**************************************************************************** - * Included Files + * Included Header Files ****************************************************************************/ #include <sys/types.h> @@ -48,15 +48,27 @@ #include "httpd.h" #include "httpd_fsdata.h" +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + #ifndef NULL #define NULL 0 #endif /* NULL */ +/**************************************************************************** + * Private Data + ****************************************************************************/ + #include "httpd_fsdata.c" -#if HTTPD_FS_STATISTICS +#if CONFIG_NETUTILS_HTTPDFSSTATS static uint16 count[HTTPD_FS_NUMFILES]; -#endif /* HTTPD_FS_STATISTICS */ +#endif /* CONFIG_NETUTILS_HTTPDFSSTATS */ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ static uint8 httpd_fs_strcmp(const char *str1, const char *str2) { @@ -79,11 +91,15 @@ static uint8 httpd_fs_strcmp(const char *str1, const char *str2) } } +/**************************************************************************** + * Public Functions + ****************************************************************************/ + int httpd_fs_open(const char *name, struct httpd_fs_file *file) { -#if HTTPD_FS_STATISTICS +#if CONFIG_NETUTILS_HTTPDFSSTATS uint16 i = 0; -#endif /* HTTPD_FS_STATISTICS */ +#endif /* CONFIG_NETUTILS_HTTPDFSSTATS */ struct httpd_fsdata_file_noconst *f; for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT; @@ -94,30 +110,30 @@ int httpd_fs_open(const char *name, struct httpd_fs_file *file) { file->data = f->data; file->len = f->len; -#if HTTPD_FS_STATISTICS +#if CONFIG_NETUTILS_HTTPDFSSTATS ++count[i]; -#endif /* HTTPD_FS_STATISTICS */ +#endif /* CONFIG_NETUTILS_HTTPDFSSTATS */ return 1; } -#if HTTPD_FS_STATISTICS +#if CONFIG_NETUTILS_HTTPDFSSTATS ++i; -#endif /* HTTPD_FS_STATISTICS */ +#endif /* CONFIG_NETUTILS_HTTPDFSSTATS */ } return 0; } void httpd_fs_init(void) { -#if HTTPD_FS_STATISTICS +#if CONFIG_NETUTILS_HTTPDFSSTATS uint16 i; for(i = 0; i < HTTPD_FS_NUMFILES; i++) { count[i] = 0; } -#endif /* HTTPD_FS_STATISTICS */ +#endif /* CONFIG_NETUTILS_HTTPDFSSTATS */ } -#if HTTPD_FS_STATISTICS +#if CONFIG_NETUTILS_HTTPDFSSTATS uint16 httpd_fs_count(char *name) { struct httpd_fsdata_file_noconst *f; @@ -136,4 +152,4 @@ uint16 httpd_fs_count(char *name) } return 0; } -#endif /* HTTPD_FS_STATISTICS */ +#endif /* CONFIG_NETUTILS_HTTPDFSSTATS */ |