Fix build problems with different configuratin options
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2004 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
6afa5ccf72
commit
64777d8eaf
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* board/up_network.c
|
* board/up_network.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -43,11 +43,15 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <nuttx/fs.h>
|
||||||
|
|
||||||
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Global Functions
|
* Global Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int ileno(FAR FILE *stream)
|
int fileno(FAR FILE *stream)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
if (stream)
|
if (stream)
|
||||||
@ -62,4 +66,5 @@ int ileno(FAR FILE *stream)
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_NFILE_STREAMS */
|
||||||
|
|
||||||
|
@ -36,6 +36,13 @@
|
|||||||
#ifndef __NETUTILS_THTTPD_VERSION_H
|
#ifndef __NETUTILS_THTTPD_VERSION_H
|
||||||
#define __NETUTILS_THTTPD_VERSION_H
|
#define __NETUTILS_THTTPD_VERSION_H
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
#include <nuttx/compiler.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -56,83 +63,87 @@
|
|||||||
|
|
||||||
/* Server port number */
|
/* Server port number */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_PORT
|
# ifndef CONFIG_THTTPD_PORT
|
||||||
# define CONFIG_THTTPD_PORT 80
|
# define CONFIG_THTTPD_PORT 80
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* Server IP address (no host name) */
|
/* Server IP address (no host name) */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_IPADDR
|
# ifndef CONFIG_THTTPD_IPADDR
|
||||||
|
# ifdef CONFIG_CPP_HAVE_WARNING
|
||||||
# warning "CONFIG_THTTPD_IPADDR not defined"
|
# warning "CONFIG_THTTPD_IPADDR not defined"
|
||||||
|
# endif
|
||||||
# define CONFIG_THTTPD_IPADDR (10<<24|0<<16|0<<8|2)
|
# define CONFIG_THTTPD_IPADDR (10<<24|0<<16|0<<8|2)
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* SERVER_ADDRESS: response */
|
/* SERVER_ADDRESS: response */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_SERVER_ADDRESS
|
# ifndef CONFIG_THTTPD_SERVER_ADDRESS
|
||||||
# define CONFIG_THTTPD_SERVER_ADDRESS "http://www.nuttx.org"
|
# define CONFIG_THTTPD_SERVER_ADDRESS "http://www.nuttx.org"
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* SERVER_SOFTWARE: response */
|
/* SERVER_SOFTWARE: response */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_SERVER_SOFTWARE
|
# ifndef CONFIG_THTTPD_SERVER_SOFTWARE
|
||||||
# define CONFIG_THTTPD_SERVER_SOFTWARE "thttpd/2.25b 29dec2003-NuttX"
|
# define CONFIG_THTTPD_SERVER_SOFTWARE "thttpd/2.25b 29dec2003-NuttX"
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_CGI_PATH
|
# ifndef CONFIG_THTTPD_CGI_PATH
|
||||||
|
# ifdef CONFIG_CPP_HAVE_WARNING
|
||||||
# warning "CONFIG_THTTPD_CGI_PATH not defined"
|
# warning "CONFIG_THTTPD_CGI_PATH not defined"
|
||||||
|
# endif
|
||||||
# define CONFIG_THTTPD_CGI_PATH "/mnt/www/cgi-bin"
|
# define CONFIG_THTTPD_CGI_PATH "/mnt/www/cgi-bin"
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* Only CGI programs matching this pattern will be executed. In fact,
|
/* Only CGI programs matching this pattern will be executed. In fact,
|
||||||
* if this value is not defined then no CGI logic will be built.
|
* if this value is not defined then no CGI logic will be built.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_CGI_PATTERN
|
# ifndef CONFIG_THTTPD_CGI_PATTERN
|
||||||
# define CONFIG_THTTPD_CGI_PATTERN "/cgi-bin/*"
|
# define CONFIG_THTTPD_CGI_PATTERN "/cgi-bin/*"
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* These provide the priority and stack size of the CGI child tasks */
|
/* These provide the priority and stack size of the CGI child tasks */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_CGI_PRIORITY
|
# ifndef CONFIG_THTTPD_CGI_PRIORITY
|
||||||
# define CONFIG_THTTPD_CGI_PRIORITY 50
|
# define CONFIG_THTTPD_CGI_PRIORITY 50
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_CGI_STACKSIZE
|
# ifndef CONFIG_THTTPD_CGI_STACKSIZE
|
||||||
# define CONFIG_THTTPD_CGI_STACKSIZE 2048
|
# define CONFIG_THTTPD_CGI_STACKSIZE 2048
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* Byte output limit for CGI tasks */
|
/* Byte output limit for CGI tasks */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_CGI_BYTECOUNT
|
# ifndef CONFIG_THTTPD_CGI_BYTECOUNT
|
||||||
# define CONFIG_THTTPD_CGI_BYTECOUNT 200000
|
# define CONFIG_THTTPD_CGI_BYTECOUNT 200000
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* How many seconds to allow CGI programs to run before killing them. */
|
/* How many seconds to allow CGI programs to run before killing them. */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_CGI_TIMELIMIT
|
# ifndef CONFIG_THTTPD_CGI_TIMELIMIT
|
||||||
# define CONFIG_THTTPD_CGI_TIMELIMIT 0 /* No time limit */
|
# define CONFIG_THTTPD_CGI_TIMELIMIT 0 /* No time limit */
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* The default character set name to use with text MIME types. */
|
/* The default character set name to use with text MIME types. */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_CHARSET
|
# ifndef CONFIG_THTTPD_CHARSET
|
||||||
# define CONFIG_THTTPD_CHARSET "iso-8859-1"
|
# define CONFIG_THTTPD_CHARSET "iso-8859-1"
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_IOBUFFERSIZE
|
# ifndef CONFIG_THTTPD_IOBUFFERSIZE
|
||||||
# define CONFIG_THTTPD_IOBUFFERSIZE 256
|
# define CONFIG_THTTPD_IOBUFFERSIZE 256
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#if CONFIG_THTTPD_IOBUFFERSIZE > 65535
|
# if CONFIG_THTTPD_IOBUFFERSIZE > 65535
|
||||||
# error "Can't use uint16 for buffer"
|
# error "Can't use uint16 for buffer"
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* A list of index filenames to check. The files are searched for in this order. */
|
/* A list of index filenames to check. The files are searched for in this order. */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_INDEX_NAMES
|
# ifndef CONFIG_THTTPD_INDEX_NAMES
|
||||||
# define CONFIG_THTTPD_INDEX_NAMES "index.html", "index.htm", "index.cgi"
|
# define CONFIG_THTTPD_INDEX_NAMES "index.html", "index.htm", "index.cgi"
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* CONFIG_AUTH_FILE - The file to use for authentication. If this is defined then
|
/* CONFIG_AUTH_FILE - The file to use for authentication. If this is defined then
|
||||||
* thttpd checks for this file in the local directory before every fetch. If the
|
* thttpd checks for this file in the local directory before every fetch. If the
|
||||||
@ -144,33 +155,33 @@
|
|||||||
|
|
||||||
/* The listen() backlog queue length. */
|
/* The listen() backlog queue length. */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_LISTEN_BACKLOG
|
# ifndef CONFIG_THTTPD_LISTEN_BACKLOG
|
||||||
# define CONFIG_THTTPD_LISTEN_BACKLOG 8
|
# define CONFIG_THTTPD_LISTEN_BACKLOG 8
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* How many milliseconds to leave a connection open while doing a lingering close */
|
/* How many milliseconds to leave a connection open while doing a lingering close */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_LINGER_MSEC
|
# ifndef CONFIG_THTTPD_LINGER_MSEC
|
||||||
# define CONFIG_THTTPD_LINGER_MSEC 500
|
# define CONFIG_THTTPD_LINGER_MSEC 500
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* How often to run the occasional cleanup job.*/
|
/* How often to run the occasional cleanup job.*/
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_OCCASIONAL_MSEC
|
# ifndef CONFIG_THTTPD_OCCASIONAL_MSEC
|
||||||
# define CONFIG_THTTPD_OCCASIONAL_MSEC 120 /* Two minutes */
|
# define CONFIG_THTTPD_OCCASIONAL_MSEC 120 /* Two minutes */
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* How many seconds to allow for reading the initial request on a new connection. */
|
/* How many seconds to allow for reading the initial request on a new connection. */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_IDLE_READ_LIMIT_SEC
|
# ifndef CONFIG_THTTPD_IDLE_READ_LIMIT_SEC
|
||||||
# define CONFIG_THTTPD_IDLE_READ_LIMIT_SEC 300
|
# define CONFIG_THTTPD_IDLE_READ_LIMIT_SEC 300
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* How many seconds before an idle connection gets closed. */
|
/* How many seconds before an idle connection gets closed. */
|
||||||
|
|
||||||
#ifndef CONFIG_THTTPD_IDLE_SEND_LIMIT_SEC
|
# ifndef CONFIG_THTTPD_IDLE_SEND_LIMIT_SEC
|
||||||
# define CONFIG_THTTPD_IDLE_SEND_LIMIT_SEC 300
|
# define CONFIG_THTTPD_IDLE_SEND_LIMIT_SEC 300
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* Tilde mapping. Many URLs use ~username to indicate a user's home directory. thttpd
|
/* Tilde mapping. Many URLs use ~username to indicate a user's home directory. thttpd
|
||||||
* provides two options for mapping this construct to an actual filename.
|
* provides two options for mapping this construct to an actual filename.
|
||||||
@ -188,16 +199,18 @@
|
|||||||
* for CONFIG_THTTPD_TILDE_MAP2.
|
* for CONFIG_THTTPD_TILDE_MAP2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(CONFIG_THTTPD_TILDE_MAP1) && defined(CONFIG_THTTPD_TILDE_MAP2)
|
# if defined(CONFIG_THTTPD_TILDE_MAP1) && defined(CONFIG_THTTPD_TILDE_MAP2)
|
||||||
# error "Both CONFIG_THTTPD_TILDE_MAP1 andCONFIG_THTTPD_TILDE_MAP2 are defined"
|
# error "Both CONFIG_THTTPD_TILDE_MAP1 andCONFIG_THTTPD_TILDE_MAP2 are defined"
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
/* If CONFIG_THTTPD_URLPATTERN is defined, then it will be used to match and verify
|
/* If CONFIG_THTTPD_URLPATTERN is defined, then it will be used to match and verify
|
||||||
* referrers.
|
* referrers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#else /* Dependencies not provided */
|
#else /* Dependencies not provided */
|
||||||
|
# ifdef CONFIG_CPP_HAVE_WARNING
|
||||||
# warning "THTTPD not built because dependencies not selected in configuration"
|
# warning "THTTPD not built because dependencies not selected in configuration"
|
||||||
|
# endif
|
||||||
#endif /* Dependencies not provided */
|
#endif /* Dependencies not provided */
|
||||||
|
|
||||||
#endif /* __NETUTILS_THTTPD_VERSION_H */
|
#endif /* __NETUTILS_THTTPD_VERSION_H */
|
||||||
|
@ -49,6 +49,9 @@
|
|||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#ifdef CONFIG_THTTPD
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -309,5 +312,6 @@ extern int httpd_read(int fd, const void *buf, size_t nbytes);
|
|||||||
|
|
||||||
extern int httpd_write(int fd, const void *buf, size_t nbytes);
|
extern int httpd_write(int fd, const void *buf, size_t nbytes);
|
||||||
|
|
||||||
|
#endif /* CONFIG_THTTPD */
|
||||||
#endif /* __NETUTILS_THTTPD_LIBHTTPD_H */
|
#endif /* __NETUTILS_THTTPD_LIBHTTPD_H */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user