diff options
Diffstat (limited to 'networking/httpd.c')
-rw-r--r-- | networking/httpd.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index fcd1627b1..71e3a723f 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -102,6 +102,12 @@ | |||
102 | //config: help | 102 | //config: help |
103 | //config: HTTP server. | 103 | //config: HTTP server. |
104 | //config: | 104 | //config: |
105 | //config:config FEATURE_HTTPD_PORT_DEFAULT | ||
106 | //config: int "Default port" | ||
107 | //config: default 80 | ||
108 | //config: range 1 65535 | ||
109 | //config: depends on HTTPD | ||
110 | //config: | ||
105 | //config:config FEATURE_HTTPD_RANGES | 111 | //config:config FEATURE_HTTPD_RANGES |
106 | //config: bool "Support 'Ranges:' header" | 112 | //config: bool "Support 'Ranges:' header" |
107 | //config: default y | 113 | //config: default y |
@@ -277,7 +283,7 @@ | |||
277 | //usage: ) | 283 | //usage: ) |
278 | //usage: "\n -f Don't daemonize" | 284 | //usage: "\n -f Don't daemonize" |
279 | //usage: "\n -v[v] Verbose" | 285 | //usage: "\n -v[v] Verbose" |
280 | //usage: "\n -p [IP:]PORT Bind to IP:PORT (default *:80)" | 286 | //usage: "\n -p [IP:]PORT Bind to IP:PORT (default *:"STR(CONFIG_FEATURE_HTTPD_PORT_DEFAULT)")" |
281 | //usage: IF_FEATURE_HTTPD_SETUID( | 287 | //usage: IF_FEATURE_HTTPD_SETUID( |
282 | //usage: "\n -u USER[:GRP] Set uid/gid after binding to port") | 288 | //usage: "\n -u USER[:GRP] Set uid/gid after binding to port") |
283 | //usage: IF_FEATURE_HTTPD_BASIC_AUTH( | 289 | //usage: IF_FEATURE_HTTPD_BASIC_AUTH( |
@@ -325,6 +331,9 @@ | |||
325 | 331 | ||
326 | static void send_REQUEST_TIMEOUT_and_exit(int sig) NORETURN; | 332 | static void send_REQUEST_TIMEOUT_and_exit(int sig) NORETURN; |
327 | 333 | ||
334 | #define STR1(s) #s | ||
335 | #define STR(s) STR1(s) | ||
336 | |||
328 | static const char DEFAULT_PATH_HTTPD_CONF[] ALIGN1 = "/etc"; | 337 | static const char DEFAULT_PATH_HTTPD_CONF[] ALIGN1 = "/etc"; |
329 | static const char HTTPD_CONF[] ALIGN1 = "httpd.conf"; | 338 | static const char HTTPD_CONF[] ALIGN1 = "httpd.conf"; |
330 | static const char HTTP_200[] ALIGN1 = "HTTP/1.1 200 OK\r\n"; | 339 | static const char HTTP_200[] ALIGN1 = "HTTP/1.1 200 OK\r\n"; |
@@ -551,7 +560,7 @@ enum { | |||
551 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ | 560 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ |
552 | IF_FEATURE_HTTPD_BASIC_AUTH(g_realm = "Web Server Authentication";) \ | 561 | IF_FEATURE_HTTPD_BASIC_AUTH(g_realm = "Web Server Authentication";) \ |
553 | IF_FEATURE_HTTPD_RANGES(range_start = -1;) \ | 562 | IF_FEATURE_HTTPD_RANGES(range_start = -1;) \ |
554 | bind_addr_or_port = "80"; \ | 563 | bind_addr_or_port = STR(CONFIG_FEATURE_HTTPD_PORT_DEFAULT); \ |
555 | index_page = index_html; \ | 564 | index_page = index_html; \ |
556 | file_size = -1; \ | 565 | file_size = -1; \ |
557 | } while (0) | 566 | } while (0) |