summaryrefslogtreecommitdiff
path: root/nuttx/netutils/thttpd/thttpd.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-07-12 18:46:11 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-07-12 18:46:11 +0000
commitad855c503fab41c8943a94c5c4dfafc25019491b (patch)
tree1c76088cc0b39174dfa216b9863af911ab5515c9 /nuttx/netutils/thttpd/thttpd.c
parent5b17ece930357c52595d264f30a6ff87561df443 (diff)
downloadpx4-nuttx-ad855c503fab41c8943a94c5c4dfafc25019491b.tar.gz
px4-nuttx-ad855c503fab41c8943a94c5c4dfafc25019491b.tar.bz2
px4-nuttx-ad855c503fab41c8943a94c5c4dfafc25019491b.zip
libthttpd.c now longer used fork() and execve()
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1980 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/netutils/thttpd/thttpd.c')
-rw-r--r--nuttx/netutils/thttpd/thttpd.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/nuttx/netutils/thttpd/thttpd.c b/nuttx/netutils/thttpd/thttpd.c
index e8b3ef9f7..105cfb889 100644
--- a/nuttx/netutils/thttpd/thttpd.c
+++ b/nuttx/netutils/thttpd/thttpd.c
@@ -53,6 +53,8 @@
#include <debug.h>
#include <nuttx/compiler.h>
+#include <nuttx/symtab.h>
+#include <net/uip/thttpd.h>
#include "config.h"
#include "fdwatch.h"
@@ -709,13 +711,29 @@ static void thttpd_logstats(long secs)
* Public Functions
****************************************************************************/
+/****************************************************************************
+ * Function: thttpd_main
+ *
+ * Description:
+ * This function is the entrypoint into the THTTPD server. It does not
+ * return. It may be called, the normal mechanism for starting the server
+ * is:
+ *
+ * 1) Set is g_thttpdsymtab and g_thttpdnsymbols. The user is required
+ * to provide a symbol table to use for binding CGI programs (if CGI
+ * is enabled. See examples/nxflat and examples/thttpd for examples of
+ * how such a symbol table may be created.
+ * 2) Call task_create() to start thttpd_main()
+ *
+ ****************************************************************************/
+
int thttpd_main(int argc, char **argv)
{
char cwd[MAXPATHLEN + 1];
int num_ready;
int cnum;
- struct connect_s *conn;
- httpd_conn *hc;
+ FAR struct connect_s *conn;
+ FAR httpd_conn *hc;
#ifdef CONFIG_NET_IPv6
struct sockaddr_in6 sa;
#else
@@ -726,7 +744,7 @@ int thttpd_main(int argc, char **argv)
/* Setup host address */
#ifdef CONFIG_NET_IPv6
-# error "IPv6 support not yet implemented"
+# error "IPv6 support not yet implemented"
#else
sa.sin_family = AF_INET;
sa.sin_port = HTONS(CONFIG_THTTPD_PORT);