summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-09-15 17:17:14 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-09-15 17:17:14 +0000
commitb6b09a6b1af770cbd3ab849fa8b974c3e6f7caae (patch)
tree9220ce3d3b4859ec2b0e08cd662d7a91d731c22c
parente2af7aac95b860422eb445bc6e85e18eff118819 (diff)
downloadpx4-nuttx-b6b09a6b1af770cbd3ab849fa8b974c3e6f7caae.tar.gz
px4-nuttx-b6b09a6b1af770cbd3ab849fa8b974c3e6f7caae.tar.bz2
px4-nuttx-b6b09a6b1af770cbd3ab849fa8b974c3e6f7caae.zip
SDCLONE was disabled
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2055 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/configs/eagle100/thttpd/defconfig2
-rw-r--r--nuttx/configs/ntosd-dm320/thttpd/defconfig2
-rw-r--r--nuttx/netutils/thttpd/config.h2
-rwxr-xr-xnuttx/netutils/thttpd/thttpd_cgi.c25
4 files changed, 19 insertions, 12 deletions
diff --git a/nuttx/configs/eagle100/thttpd/defconfig b/nuttx/configs/eagle100/thttpd/defconfig
index e6a65f5cd..c1ad521c5 100644
--- a/nuttx/configs/eagle100/thttpd/defconfig
+++ b/nuttx/configs/eagle100/thttpd/defconfig
@@ -281,7 +281,7 @@ CONFIG_SEM_PREALLOCHOLDERS=0
CONFIG_SEM_NNESTPRIO=0
CONFIG_FDCLONE_DISABLE=n
CONFIG_FDCLONE_STDIO=n
-CONFIG_SDCLONE_DISABLE=y
+CONFIG_SDCLONE_DISABLE=n
#
# Settings for examples/nxflat
diff --git a/nuttx/configs/ntosd-dm320/thttpd/defconfig b/nuttx/configs/ntosd-dm320/thttpd/defconfig
index af6dc4479..207b5922a 100644
--- a/nuttx/configs/ntosd-dm320/thttpd/defconfig
+++ b/nuttx/configs/ntosd-dm320/thttpd/defconfig
@@ -219,7 +219,7 @@ CONFIG_SEM_PREALLOCHOLDERS=0
CONFIG_SEM_NNESTPRIO=0
CONFIG_FDCLONE_DISABLE=n
CONFIG_FDCLONE_STDIO=n
-CONFIG_SDCLONE_DISABLE=y
+CONFIG_SDCLONE_DISABLE=n
#
# Settings for NXFLAT
diff --git a/nuttx/netutils/thttpd/config.h b/nuttx/netutils/thttpd/config.h
index 349c73968..213a1fa2c 100644
--- a/nuttx/netutils/thttpd/config.h
+++ b/nuttx/netutils/thttpd/config.h
@@ -52,7 +52,7 @@
#undef CONFIG_THTTPD
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP) && \
defined(CONFIG_NET_TCPBACKLOG) && !defined(CONFIG_DISABLE_ENVIRONMENT) && \
- CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+ !defined(CONFIG_SDCLONE_DISABLE) && CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
# define CONFIG_THTTPD 1
diff --git a/nuttx/netutils/thttpd/thttpd_cgi.c b/nuttx/netutils/thttpd/thttpd_cgi.c
index 1ec4831aa..cac79deb2 100755
--- a/nuttx/netutils/thttpd/thttpd_cgi.c
+++ b/nuttx/netutils/thttpd/thttpd_cgi.c
@@ -336,10 +336,12 @@ static inline int cgi_interpose_input(httpd_conn *hc, int wfd, char *buffer)
ssize_t nbytes_written;
nbytes = hc->read_idx - hc->checked_idx;
+ llvdbg("nbytes: %d contentlength: %d\n", nbytes, hc->contentlength);
if (nbytes > 0)
{
if (httpd_write(wfd, &(hc->read_buf[hc->checked_idx]), nbytes) != nbytes)
{
+ lldbg("httpd_write failed\n");
return 1;
}
}
@@ -349,10 +351,12 @@ static inline int cgi_interpose_input(httpd_conn *hc, int wfd, char *buffer)
do
{
nbytes_read = read(hc->conn_fd, buffer, MIN(sizeof(buffer), hc->contentlength - nbytes));
+ llvdbg("nbytes_read: %d\n", nbytes_read);
if (nbytes_read < 0)
{
if (errno != EINTR)
{
+ lldbg("read failed: %d\n", errno);
return 1;
}
}
@@ -362,8 +366,10 @@ static inline int cgi_interpose_input(httpd_conn *hc, int wfd, char *buffer)
if (nbytes_read > 0)
{
nbytes_written = httpd_write(wfd, buffer, nbytes_read);
+ llvdbg("nbytes_written: %d\n", nbytes_written);
if (nbytes_written != nbytes_read)
{
+ lldbg("httpd_write failed\n");
return 1;
}
}
@@ -417,6 +423,7 @@ static inline int cgi_interpose_output(httpd_conn *hc, int rfd, char *inbuffer,
/* Loop while there are things we can do without waiting for more input */
+ llvdbg("state: %d\n", hdr->state);
switch (hdr->state)
{
case CGI_OUTBUFFER_READHEADER:
@@ -430,7 +437,7 @@ static inline int cgi_interpose_output(httpd_conn *hc, int rfd, char *inbuffer,
*/
nbytes_read = read(hc->conn_fd, inbuffer, sizeof(inbuffer));
- nvdbg("Read %d bytes from fd %d\n", nbytes_read, hc->conn_fd);
+ nllvdbg("Read %d bytes from fd %d\n", nbytes_read, hc->conn_fd);
if (nbytes_read < 0)
{
@@ -438,7 +445,7 @@ static inline int cgi_interpose_output(httpd_conn *hc, int rfd, char *inbuffer,
{
if (errno != EAGAIN)
{
- ndbg("read: %d\n", errno);
+ nlldbg("read: %d\n", errno);
}
return 1;
}
@@ -450,7 +457,7 @@ static inline int cgi_interpose_output(httpd_conn *hc, int rfd, char *inbuffer,
if (nbytes_read <= 0)
{
- nvdbg("End-of-file\n");
+ nllvdbg("End-of-file\n");
br = &(hdr->buffer[hdr->len]);
hdr->state = CGI_OUTBUFFER_HEADERREAD;
}
@@ -462,14 +469,14 @@ static inline int cgi_interpose_output(httpd_conn *hc, int rfd, char *inbuffer,
(void)memcpy(&(hdr->buffer[hdr->len]), inbuffer, nbytes_read);
hdr->len += nbytes_read;
hdr->buffer[hdr->len] = '\0';
- nvdbg("Header bytes accumulated: %d\n", hdr->len);
+ nllvdbg("Header bytes accumulated: %d\n", hdr->len);
/* Check for end of header */
if ((br = strstr(hdr->buffer, "\r\n\r\n")) != NULL ||
(br = strstr(hdr->buffer, "\012\012")) != NULL)
{
- nvdbg("End-of-header\n");
+ nllvdbg("End-of-header\n");
hdr->state = CGI_OUTBUFFER_HEADERREAD;
}
else
@@ -522,7 +529,7 @@ static inline int cgi_interpose_output(httpd_conn *hc, int rfd, char *inbuffer,
/* Write the status line. */
- nvdbg("Status: %d\n", status);
+ nllvdbg("Status: %d\n", status);
switch (status)
{
case 200:
@@ -606,7 +613,7 @@ static inline int cgi_interpose_output(httpd_conn *hc, int rfd, char *inbuffer,
*/
nbytes_read = read(rfd, inbuffer, sizeof(inbuffer));
- nvdbg("Read %d bytes from fd %d\n", nbytes_read, rfd);
+ nllvdbg("Read %d bytes from fd %d\n", nbytes_read, rfd);
if (nbytes_read < 0)
{
@@ -614,7 +621,7 @@ static inline int cgi_interpose_output(httpd_conn *hc, int rfd, char *inbuffer,
{
if (errno != EAGAIN)
{
- ndbg("read: %d\n", errno);
+ nlldbg("read: %d\n", errno);
}
return 1;
}
@@ -626,7 +633,7 @@ static inline int cgi_interpose_output(httpd_conn *hc, int rfd, char *inbuffer,
if (nbytes_read == 0)
{
- nvdbg("End-of-file\n");
+ nllvdbg("End-of-file\n");
close(hc->conn_fd);
close(rfd);
hdr->state = CGI_OUTBUFFER_DONE;