summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/ChangeLog6
-rw-r--r--nuttx/Documentation/NuttX.html7
-rw-r--r--nuttx/Makefile5
-rw-r--r--nuttx/configs/eagle100/thttpd/defconfig9
-rw-r--r--nuttx/examples/README.txt11
-rw-r--r--nuttx/examples/thttpd/Makefile75
-rw-r--r--nuttx/examples/thttpd/main.c135
-rw-r--r--nuttx/netutils/Makefile24
-rw-r--r--nuttx/netutils/README3
-rw-r--r--nuttx/netutils/thttpd/Make.defs38
-rw-r--r--nuttx/netutils/thttpd/Makefile40
-rw-r--r--nuttx/netutils/thttpd/cgi-src/phf.c6
-rw-r--r--nuttx/netutils/thttpd/cgi-src/ssi.c4
-rw-r--r--nuttx/netutils/thttpd/thttpd.c3
14 files changed, 306 insertions, 60 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 1ae0fd8ff..97f299ae9 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -820,3 +820,9 @@
when creating test threads (16Kb stacksize). The stack size should
be controlled by the .config file or the OSTest won't work on platforms
with memory constraints.
+ * netutils/thttpd: An initial port of Jef Poskanzer's THTTPD HTPPD server.
+ See http://acme.com/software/thttpd/.
+ * examples/thttpd: A basic test program for THTTPD
+ * configs/eagle100/thttpd: A build configuration for THTTPD on the Micromint
+ Eagle-100 LMS6918 (Cortex-M3) board.
+
diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html
index a8a546ca0..e0a815934 100644
--- a/nuttx/Documentation/NuttX.html
+++ b/nuttx/Documentation/NuttX.html
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
- <p>Last Updated: July 13, 2009</p>
+ <p>Last Updated: July 18, 2009</p>
</td>
</tr>
</table>
@@ -1493,6 +1493,11 @@ nuttx-0.4.10 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
when creating test threads (16Kb stacksize). The stack size should
be controlled by the .config file or the OSTest won't work on platforms
with memory constraints.
+ * netutils/thttpd: An initial port of Jef Poskanzer's THTTPD HTPPD server.
+ See http://acme.com/software/thttpd/.
+ * examples/thttpd: A basic test program for THTTPD
+ * configs/eagle100/thttpd: A build configuration for THTTPD on the Micromint
+ Eagle-100 LMS6918 (Cortex-M3) board.
nuttx-0.4.10 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
diff --git a/nuttx/Makefile b/nuttx/Makefile
index c0b73406f..eba340467 100644
--- a/nuttx/Makefile
+++ b/nuttx/Makefile
@@ -116,7 +116,7 @@ endif
# Add libraries for network support
ifeq ($(CONFIG_NET),y)
-LINKLIBS += net/libnet$(LIBEXT) netutils/libnetutils$(LIBEXT) netutils/libthttpd$(LIBEXT)
+LINKLIBS += net/libnet$(LIBEXT) netutils/libnetutils$(LIBEXT)
endif
# Add libraries for file system support
@@ -226,9 +226,6 @@ net/libnet$(LIBEXT): context
netutils/libnetutils$(LIBEXT): context
@$(MAKE) -C netutils TOPDIR="$(TOPDIR)" libnetutils$(LIBEXT)
-netutils/libthttpd$(LIBEXT): context
- @$(MAKE) -C netutils TOPDIR="$(TOPDIR)" libthttpd$(LIBEXT)
-
fs/libfs$(LIBEXT): context
@$(MAKE) -C fs TOPDIR="$(TOPDIR)" libfs$(LIBEXT)
diff --git a/nuttx/configs/eagle100/thttpd/defconfig b/nuttx/configs/eagle100/thttpd/defconfig
index 49dd962c9..e6ca1ba7a 100644
--- a/nuttx/configs/eagle100/thttpd/defconfig
+++ b/nuttx/configs/eagle100/thttpd/defconfig
@@ -254,7 +254,7 @@ CONFIG_HAVE_LIBM=n
# desciptors by task_create() when a new task is started. If
# set, all sockets will appear to be closed in the new task.
#
-CONFIG_EXAMPLE=nxflat
+CONFIG_EXAMPLE=thttpd
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_NET=y
@@ -557,6 +557,13 @@ CONFIG_THTTPD_GENERATE_INDICES=n
CONFIG_THTTPD_URLPATTERN=n
#
+# Additional settings for examples/thttpd
+#
+CONFIG_EXAMPLE_THTTPD_NOMAC=n
+CONFIG_EXAMPLE_THTTPD_DRIPADDR=(10<<24|0<<16|0<<8|1)
+CONFIG_EXAMPLE_THTTPD_NETMASK=(255<<24|255<<16|255<<8|0)
+
+#
# Settings for examples/uip
#
CONFIG_EXAMPLE_UIP_IPADDR=(10<<24|0<<16|0<<8|2)
diff --git a/nuttx/examples/README.txt b/nuttx/examples/README.txt
index e228de207..78d5ca764 100644
--- a/nuttx/examples/README.txt
+++ b/nuttx/examples/README.txt
@@ -293,6 +293,17 @@ examples/serloop
Use C buffered I/O (getchar/putchar) vs. raw console I/O
(read/read).
+examples/thttpd
+^^^^^^^^^^^^^^^
+
+ An example that builds netutils/thttpd with some simple NXFLAT
+ CGI programs. see configs/README.txt for most THTTPD settings.
+ In addition to those, this example accepts:
+
+ CONFIG_EXAMPLE_THTTPD_NOMAC - (May be defined to use software assigned MAC)
+ CONFIG_EXAMPLE_THTTPD_DRIPADDR - Default router IP addess
+ CONFIG_EXAMPLE_THTTPD_NETMASK - Network mask
+
examples/udp
^^^^^^^^^^^^
diff --git a/nuttx/examples/thttpd/Makefile b/nuttx/examples/thttpd/Makefile
new file mode 100644
index 000000000..321cccde5
--- /dev/null
+++ b/nuttx/examples/thttpd/Makefile
@@ -0,0 +1,75 @@
+############################################################################
+# examples/thttpd/Makefile
+#
+# Copyright (C) 2009 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# 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
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, 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.
+#
+############################################################################
+
+-include $(TOPDIR)/.config
+-include $(TOPDIR)/Make.defs
+
+ASRCS =
+AOBJS = $(ASRCS:.S=$(OBJEXT))
+CSRCS = main.c
+COBJS = $(CSRCS:.c=$(OBJEXT))
+
+SRCS = $(ASRCS) $(CSRCS)
+OBJS = $(AOBJS) $(COBJS)
+
+BIN = lib$(CONFIG_EXAMPLE)$(LIBEXT)
+
+all: $(BIN)
+
+$(AOBJS): %$(OBJEXT): %.S
+ $(call ASSEMBLE, $<, $@)
+
+$(COBJS): %$(OBJEXT): %.c
+ $(call COMPILE, $<, $@)
+
+$(BIN): $(OBJS)
+ @( for obj in $(OBJS) ; do \
+ $(call ARCHIVE, $@, $${obj}); \
+ done ; )
+
+.depend: Makefile $(SRCS)
+ @$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
+ @touch $@
+
+depend: .depend
+
+clean:
+ @rm -f $(BIN) *~ .*.swp
+ $(call CLEAN)
+
+distclean: clean
+ @rm -f Make.dep .depend
+
+-include Make.dep
diff --git a/nuttx/examples/thttpd/main.c b/nuttx/examples/thttpd/main.c
new file mode 100644
index 000000000..93596a3a1
--- /dev/null
+++ b/nuttx/examples/thttpd/main.c
@@ -0,0 +1,135 @@
+/****************************************************************************
+ * examples/thttpd/main.c
+ *
+ * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ *
+ * 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
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, 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.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <sys/ioctl.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <time.h>
+#include <debug.h>
+
+#include <net/if.h>
+#include <net/uip/thttpd.h>
+#include <net/uip/uip-arp.h>
+#include <net/uip/uip-lib.h>
+
+/****************************************************************************
+ * Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_CPP_HAVE_VARARGS
+# ifdef CONFIG_DEBUG
+# define message(...) lib_lowprintf(__VA_ARGS__)
+# else
+# define message(...) printf(__VA_ARGS__)
+# endif
+#else
+# ifdef CONFIG_DEBUG
+# define message lib_lowprintf
+# else
+# define message (void)
+# endif
+#endif
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * user_initialize
+ ****************************************************************************/
+
+#ifndef CONFIG_HAVE_WEAKFUNCTIONS
+void user_initialize(void)
+{
+ /* Stub that must be provided only if the toolchain does not support weak
+ * functions.
+ */
+}
+#endif
+
+/****************************************************************************
+ * user_start
+ ****************************************************************************/
+
+int user_start(int argc, char *argv[])
+{
+ struct in_addr addr;
+#ifdef CONFIG_EXAMPLE_UIP_NOMAC
+ uint8 mac[IFHWADDRLEN];
+#endif
+ char *thttpd_argv = "thttpd";
+
+/* Many embedded network interfaces must have a software assigned MAC */
+
+#ifdef CONFIG_EXAMPLE_UIP_NOMAC
+ mac[0] = 0x00;
+ mac[1] = 0xe0;
+ mac[2] = 0xb0;
+ mac[3] = 0x0b;
+ mac[4] = 0xba;
+ mac[5] = 0xbe;
+ uip_setmacaddr("eth0", mac);
+#endif
+
+ /* Set up our host address */
+
+ addr.s_addr = HTONL(CONFIG_THTTPD_IPADDR);
+ uip_sethostaddr("eth0", &addr);
+
+ /* Set up the default router address */
+
+ addr.s_addr = HTONL(CONFIG_EXAMPLE_THTTPD_DRIPADDR);
+ uip_setdraddr("eth0", &addr);
+
+ /* Setup the subnet mask */
+
+ addr.s_addr = HTONL(CONFIG_EXAMPLE_THTTPD_NETMASK);
+ uip_setnetmask("eth0", &addr);
+
+
+ printf("Starting THTTPD\n");
+ thttpd_main(1, &thttpd_argv);
+ return 0;
+}
diff --git a/nuttx/netutils/Makefile b/nuttx/netutils/Makefile
index a7a9ec2ac..9f95a7d22 100644
--- a/nuttx/netutils/Makefile
+++ b/nuttx/netutils/Makefile
@@ -42,6 +42,7 @@ include smtp/Make.defs
include telnetd/Make.defs
include webclient/Make.defs
include webserver/Make.defs
+include thttpd/Make.defs
endif
ifeq ($(CONFIG_NET_UDP),y)
include dhcpc/Make.defs
@@ -53,16 +54,16 @@ endif
endif
endif
-SUBDIRS = uiplib dhcpc dhcpd resolv smtp telnetd webclient webserver tftpc
+SUBDIRS = uiplib dhcpc dhcpd resolv smtp telnetd webclient webserver tftpc thttpd
ASRCS = $(UIPLIB_ASRCS) $(DHCPC_ASRCS) $(DHCPD_ASRCS) $(RESOLV_ASRCS) \
$(SMTP_ASRCS) $(TELNETD_ASRCS) $(WEBCLIENT_ASRCS) $(WEBSERVER_ASRCS) \
- $(TFTPC_ASRCS)
+ $(TFTPC_ASRCS) $(THTTPD_ASRCS)
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = $(UIPLIB_CSRCS) $(DHCPC_CSRCS) $(DHCPD_CSRCS) $(RESOLV_CSRCS) \
$(SMTP_CSRCS) $(TELNETD_CSRCS) $(WEBCLIENT_CSRCS) $(WEBSERVER_CSRCS) \
- $(TFTPC_CSRCS)
+ $(TFTPC_CSRCS) $(THTTPD_CSRCS)
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
@@ -70,9 +71,9 @@ OBJS = $(AOBJS) $(COBJS)
BIN = libnetutils$(LIBEXT)
-VPATH = uiplib:dhcpc:dhcpd:resolv:smtp:telnetd:webclient:webserver:tftpc
+VPATH = uiplib:dhcpc:dhcpd:resolv:smtp:telnetd:webclient:webserver:tftpc:thttpd
-all: $(BIN) libthttpd$(LIBEXT)
+all: $(BIN)
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@@ -85,17 +86,12 @@ $(BIN): $(OBJS)
$(call ARCHIVE, $@, $${obj}); \
done ; )
-thttpd/libthttpd$(LIBEXT):
- @$(MAKE) -C thttpd libthttpd$(LIBEXT) TOPDIR="$(TOPDIR)"
-
-libthttpd$(LIBEXT): thttpd/libthttpd$(LIBEXT)
- @cp -a thttpd/libthttpd$(LIBEXT) .
-
.depend: Makefile $(SRCS)
+ @$(MAKE) -C thttpd all TOPDIR="$(TOPDIR)"
ifeq ($(CONFIG_NET),y)
@$(MKDEP) --dep-path . --dep-path uiplib --dep-path dhcpc --dep-path dhcpd \
- --dep-path smtp --dep-path webclient --dep-path resolv \
- --dep-path telnetd --dep-path webserver --dep-path tftpc \
+ --dep-path smtp --dep-path webclient --dep-path resolv --dep-path telnetd \
+ --dep-path webserver --dep-path tftpc --dep-path thttpd \
$(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
endif
@touch $@
@@ -104,7 +100,7 @@ depend: .depend
@$(MAKE) -C thttpd depend TOPDIR="$(TOPDIR)"
clean:
- @rm -f $(BIN) libthttpd$(LIBEXT) *~ .*.swp
+ @rm -f $(BIN) *~ .*.swp
$(call CLEAN)
@( for dir in $(SUBDIRS); do \
rm -f $${dir}/*~ $${dir}/.*.swp; \
diff --git a/nuttx/netutils/README b/nuttx/netutils/README
index 2f30bb48f..a28270715 100644
--- a/nuttx/netutils/README
+++ b/nuttx/netutils/README
@@ -18,4 +18,7 @@ highly influenced by uIP) include:
dhcpd - Dynamic Host Configuration Protocol (DHCP) server
tftpc - TFTP client
+ thttpd - This is a port of Jef Poskanzer's THTTPD HTPPD server.
+ See http://acme.com/software/thttpd/.
+
diff --git a/nuttx/netutils/thttpd/Make.defs b/nuttx/netutils/thttpd/Make.defs
new file mode 100644
index 000000000..a80d36abf
--- /dev/null
+++ b/nuttx/netutils/thttpd/Make.defs
@@ -0,0 +1,38 @@
+############################################################################
+# netutils/thttpd/Make.defs
+#
+# Copyright (C) 2009 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# 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
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, 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.
+#
+############################################################################
+
+THTTPD_ASRCS =
+THTTPD_CSRCS = thttpd.c libhttpd.c timers.c fdwatch.c tdate_parse.c
+
diff --git a/nuttx/netutils/thttpd/Makefile b/nuttx/netutils/thttpd/Makefile
index 6ff882dc4..f317e40a7 100644
--- a/nuttx/netutils/thttpd/Makefile
+++ b/nuttx/netutils/thttpd/Makefile
@@ -47,29 +47,8 @@ SUBDIR_BIN3 = ssi
SUBDIR_BIN += cgi-bin/$(SUBDIR_BIN1) cgi-bin/$(SUBDIR_BIN2) cgi-bin/$(SUBDIR_BIN3)
endif
-ASRCS =
-AOBJS = $(ASRCS:.S=$(OBJEXT))
-
-CSRCS = thttpd.c libhttpd.c timers.c fdwatch.c tdate_parse.c
-COBJS = $(CSRCS:.c=$(OBJEXT))
-
-SRCS = $(ASRCS) $(CSRCS)
-OBJS = $(AOBJS) $(COBJS)
-
-BIN = libthttpd$(LIBEXT)
-
-all: $(BIN) $(SUBDIR_BIN)
-
-$(AOBJS): %$(OBJEXT): %.S
- $(call ASSEMBLE, $<, $@)
-
-$(COBJS): %$(OBJEXT): %.c
- $(call COMPILE, $<, $@)
-
-$(BIN): $(OBJS)
- @( for obj in $(OBJS) ; do \
- $(call ARCHIVE, $@, $${obj}); \
- done ; )
+all: $(SUBDIR_BIN)
+.PHONY: depend clean distclean
ifeq ($(CONFIG_NXFLAT),y)
cgi-bin:
@@ -94,22 +73,15 @@ cgi-bin/$(SUBDIR_BIN3): cgi-bin cgi-src/$(SUBDIR_BIN3)
@cp -a cgi-src/$(SUBDIR_BIN3) $@
endif
-.depend: Makefile $(SRCS)
- @$(MKDEP) --dep-path . $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
- @touch $@
-
-depend: .depend
+depend:
clean:
- @rm -f $(BIN) *~ .*.swp
+ @rm -f *~ .*.swp
@rm -rf cgi-bin
- $(call CLEAN)
- @( for dir in $(SUBDIRS); do \
- rm -f $${dir}/*~ $${dir}/.*.swp; \
- done ; )
+ @$(MAKE) -C cgi-src clean
distclean: clean
- @rm -f Make.dep .depend
+ @$(MAKE) -C cgi-src distclean
-include Make.dep
diff --git a/nuttx/netutils/thttpd/cgi-src/phf.c b/nuttx/netutils/thttpd/cgi-src/phf.c
index a108468a8..2541481c4 100644
--- a/nuttx/netutils/thttpd/cgi-src/phf.c
+++ b/nuttx/netutils/thttpd/cgi-src/phf.c
@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
{
fprintf(stderr, "phf CGI probe from %s\n", getenv("REMOTE_ADDR"));
- (void)printf("\
+ (void)printf("\
Content-type: text/html\n\
Status: 404/html\n\
\n\
@@ -73,7 +73,5 @@ The requested object does not exist on this server.\n\
The link you followed is either outdated, inaccurate,\n\
or the server has been instructed not to let you have it.\n\
</BODY></HTML>\n");
- return 0;
- }
- return 1;
+ return 0;
}
diff --git a/nuttx/netutils/thttpd/cgi-src/ssi.c b/nuttx/netutils/thttpd/cgi-src/ssi.c
index befb7f769..a4b81d45a 100644
--- a/nuttx/netutils/thttpd/cgi-src/ssi.c
+++ b/nuttx/netutils/thttpd/cgi-src/ssi.c
@@ -869,7 +869,7 @@ static void read_file(FILE *instream, char *vfilename, char *filename)
break;
}
- putcchar((char)ich);
+ putchar((char)ich);
}
}
@@ -892,7 +892,7 @@ int main(int argc, char **argv)
/* The MIME type has to be text/html. */
- (voidfputs("Content-type: text/html\n\n");
+ (void)puts("Content-type: text/html\n\n");
/* Get the name that we were run as. */
diff --git a/nuttx/netutils/thttpd/thttpd.c b/nuttx/netutils/thttpd/thttpd.c
index 8d26933fa..a2aa1c330 100644
--- a/nuttx/netutils/thttpd/thttpd.c
+++ b/nuttx/netutils/thttpd/thttpd.c
@@ -743,6 +743,9 @@ int thttpd_main(int argc, char **argv)
struct sockaddr_in sa;
#endif
struct timeval tv;
+#ifdef CONFIG_THTTPD_DIR
+ int ret;
+#endif
/* Setup host address */