summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-09-16 20:30:12 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-09-16 20:30:12 +0000
commite1d5a777198225cb6213d483bcb2479bda5091dc (patch)
tree7a5b8f563e64ea6ea7e44e6d9cbe9f9dca2927be /nuttx
parent28ac0618357cd777265cff69fc7ec196b7ec51de (diff)
downloadpx4-nuttx-e1d5a777198225cb6213d483bcb2479bda5091dc.tar.gz
px4-nuttx-e1d5a777198225cb6213d483bcb2479bda5091dc.tar.bz2
px4-nuttx-e1d5a777198225cb6213d483bcb2479bda5091dc.zip
Fix debug output; remove redundanct close()
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2071 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rwxr-xr-xnuttx/netutils/thttpd/thttpd_cgi.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/nuttx/netutils/thttpd/thttpd_cgi.c b/nuttx/netutils/thttpd/thttpd_cgi.c
index 3e8db7391..d6d8eab09 100755
--- a/nuttx/netutils/thttpd/thttpd_cgi.c
+++ b/nuttx/netutils/thttpd/thttpd_cgi.c
@@ -363,19 +363,19 @@ static inline int cgi_interpose_input(struct cgi_conn_s *cc)
ssize_t nbytes_read;
ssize_t nbytes_written;
- llvdbg("nbytes: %d contentlength: %d\n", cc->inbuf.nbytes, cc->inbuf.contentlength);
+ nllvdbg("nbytes: %d contentlength: %d\n", cc->inbuf.nbytes, cc->inbuf.contentlength);
if (cc->inbuf.nbytes < cc->inbuf.contentlength)
{
do
{
nbytes_read = read(cc->connfd, cc->inbuf.buffer,
MIN(CONFIG_THTTPD_CGIINBUFFERSIZE, cc->inbuf.contentlength - cc->inbuf.nbytes));
- llvdbg("nbytes_read: %d\n", nbytes_read);
+ nllvdbg("nbytes_read: %d\n", nbytes_read);
if (nbytes_read < 0)
{
if (errno != EINTR)
{
- lldbg("read failed: %d\n", errno);
+ nlldbg("read failed: %d\n", errno);
return 1;
}
}
@@ -385,10 +385,10 @@ static inline int cgi_interpose_input(struct cgi_conn_s *cc)
if (nbytes_read > 0)
{
nbytes_written = httpd_write(cc->wrfd, cc->inbuf.buffer, nbytes_read);
- llvdbg("nbytes_written: %d\n", nbytes_written);
+ nllvdbg("nbytes_written: %d\n", nbytes_written);
if (nbytes_written != nbytes_read)
{
- lldbg("httpd_write failed\n");
+ nlldbg("httpd_write failed\n");
return 1;
}
cgi_dumpbuffer("Sent to CGI:", cc->inbuf.buffer, nbytes_written);
@@ -444,7 +444,7 @@ static inline int cgi_interpose_output(struct cgi_conn_s *cc)
/* Loop while there are things we can do without waiting for more input */
- llvdbg("state: %d\n", cc->outbuf.state);
+ nllvdbg("state: %d\n", cc->outbuf.state);
switch (cc->outbuf.state)
{
case CGI_OUTBUFFER_READHEADER:
@@ -665,8 +665,6 @@ static inline int cgi_interpose_output(struct cgi_conn_s *cc)
if (nbytes_read == 0)
{
nllvdbg("End-of-file\n");
- close(cc->connfd);
- close(cc->rdfd);
cc->outbuf.state = CGI_OUTBUFFER_DONE;
return 1;
}
@@ -884,12 +882,12 @@ static int cgi_child(int argc, char **argv)
/* Send any data that is already buffer to the CGI task */
nbytes = hc->read_idx - hc->checked_idx;
- llvdbg("nbytes: %d contentlength: %d\n", nbytes, hc->contentlength);
+ nllvdbg("nbytes: %d contentlength: %d\n", nbytes, hc->contentlength);
if (nbytes > 0)
{
if (httpd_write(cc->wrfd, &(hc->read_buf[hc->checked_idx]), nbytes) != nbytes)
{
- lldbg("httpd_write failed\n");
+ nlldbg("httpd_write failed\n");
return 1;
}
}
@@ -976,7 +974,6 @@ errout:
INTERNALERROR("errout");
httpd_send_err(hc, 500, err500title, "", err500form, hc->encodedurl);
httpd_write_response(hc);
-
cgi_semgive();
}
return err;