2012-04-06 18:33:17 +02:00
|
|
|
#
|
|
|
|
# For a description of the syntax of this configuration file,
|
2012-04-06 18:45:52 +02:00
|
|
|
# see misc/tools/kconfig-language.txt.
|
2012-04-06 18:33:17 +02:00
|
|
|
#
|
2012-04-14 22:01:08 +02:00
|
|
|
|
|
|
|
config NETUTILS_WEBSERVER
|
|
|
|
bool "uIP web server"
|
|
|
|
default n
|
2012-09-21 19:32:30 +02:00
|
|
|
depends on NET_TCP
|
2012-04-14 22:01:08 +02:00
|
|
|
---help---
|
2012-09-04 18:59:24 +02:00
|
|
|
Enable support for the uIP web server. This tiny web server was
|
|
|
|
from uIP 1.0, but has undergone many changes. It is, however,
|
|
|
|
still referred to as the "uIP" web server.
|
2012-04-14 22:01:08 +02:00
|
|
|
|
|
|
|
if NETUTILS_WEBSERVER
|
2012-09-04 18:59:24 +02:00
|
|
|
|
2012-09-18 01:02:58 +02:00
|
|
|
config NETUTILS_HTTPD_SINGLECONNECT
|
|
|
|
bool "Single Connection"
|
2012-09-17 21:44:53 +02:00
|
|
|
default n if !DISABLE_PTHREAD
|
|
|
|
default y if DISABLE_PTHREAD
|
|
|
|
---help---
|
|
|
|
By default, the uIP web server will create a new, independent thread
|
|
|
|
for each connection. This can, however, use a lot of stack space
|
|
|
|
if there are many connections and that can be a problem is RAM is
|
|
|
|
limited. If this option is selected, then a single thread will
|
2012-09-18 01:02:58 +02:00
|
|
|
service all HTTP requests and, in this case, only a single connection
|
|
|
|
at a time is supported at a time.
|
|
|
|
|
2012-09-04 18:59:24 +02:00
|
|
|
config NETUTILS_HTTPD_SCRIPT_DISABLE
|
|
|
|
bool "Disable %! scripting"
|
2012-09-11 15:19:59 +02:00
|
|
|
default y if NETUTILS_HTTPD_SENDFILE
|
|
|
|
default n if !NETUTILS_HTTPD_SENDFILE
|
2012-09-04 18:59:24 +02:00
|
|
|
---help---
|
|
|
|
This option, if selected, will elide the %! scripting
|
|
|
|
|
2012-09-05 20:03:37 +02:00
|
|
|
config NETUTILS_HTTPD_CGIPATH
|
|
|
|
bool "URL/CGI function mapping"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
This option enables mappings from URLs to call CGI functions. The
|
|
|
|
effect is that the existing httpd_cgi_register() interface can be
|
|
|
|
used thus:
|
|
|
|
|
|
|
|
const static struct httpd_cgi_call a[] = {
|
|
|
|
{ NULL, "/abc", cgi_abc },
|
|
|
|
{ NULL, "/xyz", cgi_xyz }
|
|
|
|
};
|
|
|
|
|
|
|
|
for (i = 0; i < sizeof a / sizeof *a; i++) {
|
|
|
|
httpd_cgi_register(&a[i]);
|
|
|
|
}
|
|
|
|
|
2013-04-25 23:52:00 +02:00
|
|
|
Where (under NETUTILS_HTTPD_CGIPATH) the "/xyz" is a URL path,
|
2012-09-05 20:03:37 +02:00
|
|
|
rather than a %! xyz style call in the existing manner.
|
|
|
|
|
2013-04-25 23:52:00 +02:00
|
|
|
This is useful when NETUTILS_HTTPD_SCRIPT_DISABLE is defined.
|
2012-09-05 20:03:37 +02:00
|
|
|
|
|
|
|
In other words, this provides a way to get your CGI functions called
|
|
|
|
without needing the scripting language. I'm using this to provide a
|
|
|
|
REST style interface over HTTP, where my CGI handlers just return a
|
|
|
|
HTTP status code with a content length of 0.
|
|
|
|
|
2012-09-18 14:34:43 +02:00
|
|
|
config NETUTILS_HTTPD_ERRPATH
|
|
|
|
string "Error Path"
|
|
|
|
default ""
|
|
|
|
---help---
|
|
|
|
Path used in error return packets.
|
|
|
|
|
2012-09-04 20:01:54 +02:00
|
|
|
config NETUTILS_HTTPD_SERVERHEADER_DISABLE
|
2012-09-04 18:59:24 +02:00
|
|
|
bool "Disabled the SERVER header"
|
|
|
|
default n
|
|
|
|
---help---
|
2012-09-04 20:01:54 +02:00
|
|
|
This option, if selected, will elide the Server\: header
|
2012-09-04 18:59:24 +02:00
|
|
|
|
2012-09-18 01:02:58 +02:00
|
|
|
config NETUTILS_HTTPD_TIMEOUT
|
|
|
|
int "Receive Timeout (sec)"
|
|
|
|
default 0
|
2012-09-21 19:32:30 +02:00
|
|
|
depends on NET_SOCKOPTS
|
2012-09-18 01:02:58 +02:00
|
|
|
---help---
|
|
|
|
Receive timeout setting (in seconds). A timeout value of zero
|
|
|
|
disables the timeout. An HTTP 408 error is generated if the timeout
|
2012-09-21 19:32:30 +02:00
|
|
|
expires. This option depends on support for socket options (sockopts).
|
2012-09-18 01:02:58 +02:00
|
|
|
|
2012-09-11 15:19:59 +02:00
|
|
|
choice
|
|
|
|
prompt "File Transfer Method"
|
|
|
|
default NETUTILS_HTTPD_CLASSIC
|
|
|
|
|
|
|
|
config NETUTILS_HTTPD_CLASSIC
|
|
|
|
bool "Pre-processed files"
|
|
|
|
---help---
|
|
|
|
Traditionally, the uIP-based webserver only sends "files" that have
|
|
|
|
been prepared as a data structure using nutts/tools/mkfsdata.pl
|
|
|
|
|
2012-09-04 18:59:24 +02:00
|
|
|
config NETUTILS_HTTPD_MMAP
|
|
|
|
bool "File mmap-ing"
|
|
|
|
---help---
|
2012-09-11 15:19:59 +02:00
|
|
|
Traditionally, the uIP-based webserver only sends "files" that have
|
|
|
|
been prepared as a data structure using nutts/tools/mkfsdata.pl
|
|
|
|
However, extensions have been contributed. If this option is
|
|
|
|
selected, then files can be accessed from the NuttX file system
|
|
|
|
as well. This selection will map the files into memory (using mmap)
|
|
|
|
so that the logic is still basically compatible with the classic
|
2012-09-11 15:53:44 +02:00
|
|
|
approach. NOTE, however, that since files are copied into memory,
|
|
|
|
this limits solution to small files that will fit into available RAM.
|
2012-09-11 15:19:59 +02:00
|
|
|
|
|
|
|
config NETUTILS_HTTPD_MMAP
|
|
|
|
bool "sendfile()"
|
|
|
|
select NETUTILS_HTTPD_SCRIPT_DISABLE
|
|
|
|
---help---
|
|
|
|
Traditionally, the uIP-based webserver only sends "files" that have
|
|
|
|
been prepared as a data structure using nutts/tools/mkfsdata.pl
|
|
|
|
However, extensions have been contributed. If this option is
|
|
|
|
selected, then files can be accessed from the NuttX file system
|
|
|
|
as well. This selection will use the NuttX sendfile() interface
|
2012-09-11 15:53:44 +02:00
|
|
|
to send files. NOTE: If this option is selected, then scripting
|
|
|
|
must be disabled since it depends on the classic, in-memory
|
|
|
|
representation.
|
2012-09-11 15:19:59 +02:00
|
|
|
|
|
|
|
endchoice
|
2012-09-22 22:36:36 +02:00
|
|
|
|
|
|
|
config NETUTILS_HTTPD_KEEPALIVE_DISABLE
|
|
|
|
bool "Keepalive Disable"
|
|
|
|
default y if !NETUTILS_HTTPD_TIMEOUT
|
|
|
|
default n if NETUTILS_HTTPD_TIMEOUT
|
|
|
|
---help---
|
|
|
|
Disabled HTTP keep-alive for HTTP clients. Keep-alive permits a
|
|
|
|
client to make multiple requests over the same connection, rather
|
|
|
|
than closing and opening a new socket for each request.
|
|
|
|
|
|
|
|
This depends on the content-length being known, and is automatically
|
|
|
|
disabled for situations where that header isn't produced (i.e.
|
|
|
|
scripting, CGI). Keep-alive is also disabled for certain error
|
|
|
|
responses.
|
|
|
|
|
|
|
|
Keep-alive should normally be disabled if timeouts are enabled,
|
|
|
|
otherwise a rogue HTTP client could block the httpd indefinitely.
|
|
|
|
|
2013-10-17 20:07:14 +02:00
|
|
|
endif # NETUTILS_WEBSERVER
|