summaryrefslogtreecommitdiff
path: root/nuttx/netutils/webserver/httpd.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-22 16:10:28 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-22 16:10:28 +0000
commit0554e0302db0094f60b7595ea7f8770f3a69bb27 (patch)
tree95ea97c686f649de8b709829b3b66c39db534dd1 /nuttx/netutils/webserver/httpd.c
parentbee94a4100a4e77585377441482f837a39980792 (diff)
downloadpx4-nuttx-0554e0302db0094f60b7595ea7f8770f3a69bb27.tar.gz
px4-nuttx-0554e0302db0094f60b7595ea7f8770f3a69bb27.tar.bz2
px4-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.c')
-rw-r--r--nuttx/netutils/webserver/httpd.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/nuttx/netutils/webserver/httpd.c b/nuttx/netutils/webserver/httpd.c
index 2fbc1c067..900cc3bea 100644
--- a/nuttx/netutils/webserver/httpd.c
+++ b/nuttx/netutils/webserver/httpd.c
@@ -76,9 +76,6 @@
#define ISO_slash 0x2f
#define ISO_colon 0x3a
-#undef CONFIG_NETUTILS_HTTPD_DUMPBUFFER
-#undef CONFIG_NETUTILS_HTTPD_DUMPPSTATE
-
/****************************************************************************
* Private Data
****************************************************************************/
@@ -186,7 +183,7 @@ static int handle_script(struct httpd_state *pstate)
int len;
char *ptr;
- while(pstate->ht_file.len > 0)
+ while (pstate->ht_file.len > 0)
{
/* Check if we should start executing a script */
@@ -353,8 +350,10 @@ static int httpd_sendfile(struct httpd_state *pstate)
pstate->ht_sndlen = 0;
+ nvdbg("[%d] sending file '%s'\n", pstate->ht_sockfd, pstate->ht_filename);
if (!httpd_fs_open(pstate->ht_filename, &pstate->ht_file))
{
+ ndbg("[%d] '%s' not found\n", pstate->ht_sockfd, pstate->ht_filename);
memcpy(pstate->ht_filename, g_http404path, strlen(g_http404path));
httpd_fs_open(g_http404path, &pstate->ht_file);
if (send_headers(pstate, g_httpheader404, strlen(g_httpheader404)) == OK)
@@ -466,19 +465,14 @@ static void *httpd_handler(void *arg)
if (pstate)
{
- /* Loop processing each HTTP command */
-// do
- {
- /* Re-initialize the thread state structure */
+ /* Re-initialize the thread state structure */
- memset(pstate, 0, sizeof(struct httpd_state));
- pstate->ht_sockfd = sockfd;
+ memset(pstate, 0, sizeof(struct httpd_state));
+ pstate->ht_sockfd = sockfd;
- /* Then handle the next httpd command */
+ /* Then handle the next httpd command */
- ret = httpd_cmd(pstate);
- }
-// while (ret == OK);
+ ret = httpd_cmd(pstate);
/* End of command processing -- Clean up and exit */