diff options
Diffstat (limited to 'networking/httpd.c')
-rw-r--r-- | networking/httpd.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index b8113a843..d6157aca2 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -21,6 +21,10 @@ | |||
21 | * The server changes directory to the location of the script and executes it | 21 | * The server changes directory to the location of the script and executes it |
22 | * after setting QUERY_STRING and other environment variables. | 22 | * after setting QUERY_STRING and other environment variables. |
23 | * | 23 | * |
24 | * If directory URL is given, no index.html is found and CGI support is enabled, | ||
25 | * cgi-bin/index.cgi will be run. Directory to list is ../$QUERY_STRING. | ||
26 | * See httpd_indexcgi.c for an example GCI code. | ||
27 | * | ||
24 | * Doc: | 28 | * Doc: |
25 | * "CGI Environment Variables": http://hoohoo.ncsa.uiuc.edu/cgi/env.html | 29 | * "CGI Environment Variables": http://hoohoo.ncsa.uiuc.edu/cgi/env.html |
26 | * | 30 | * |
@@ -71,7 +75,7 @@ | |||
71 | * D:2.3.4. # deny from 2.3.4.0 - 2.3.4.255 | 75 | * D:2.3.4. # deny from 2.3.4.0 - 2.3.4.255 |
72 | * A:* # (optional line added for clarity) | 76 | * A:* # (optional line added for clarity) |
73 | * | 77 | * |
74 | * If a sub directory contains a config file it is parsed and merged with | 78 | * If a sub directory contains config file, it is parsed and merged with |
75 | * any existing settings as if it was appended to the original configuration. | 79 | * any existing settings as if it was appended to the original configuration. |
76 | * | 80 | * |
77 | * subdir paths are relative to the containing subdir and thus cannot | 81 | * subdir paths are relative to the containing subdir and thus cannot |
@@ -93,6 +97,32 @@ | |||
93 | */ | 97 | */ |
94 | /* TODO: use TCP_CORK, parse_config() */ | 98 | /* TODO: use TCP_CORK, parse_config() */ |
95 | 99 | ||
100 | //usage:#define httpd_trivial_usage | ||
101 | //usage: "[-ifv[v]]" | ||
102 | //usage: " [-c CONFFILE]" | ||
103 | //usage: " [-p [IP:]PORT]" | ||
104 | //usage: IF_FEATURE_HTTPD_SETUID(" [-u USER[:GRP]]") | ||
105 | //usage: IF_FEATURE_HTTPD_BASIC_AUTH(" [-r REALM]") | ||
106 | //usage: " [-h HOME]\n" | ||
107 | //usage: "or httpd -d/-e" IF_FEATURE_HTTPD_AUTH_MD5("/-m") " STRING" | ||
108 | //usage:#define httpd_full_usage "\n\n" | ||
109 | //usage: "Listen for incoming HTTP requests\n" | ||
110 | //usage: "\nOptions:" | ||
111 | //usage: "\n -i Inetd mode" | ||
112 | //usage: "\n -f Don't daemonize" | ||
113 | //usage: "\n -v[v] Verbose" | ||
114 | //usage: "\n -p [IP:]PORT Bind to IP:PORT (default *:80)" | ||
115 | //usage: IF_FEATURE_HTTPD_SETUID( | ||
116 | //usage: "\n -u USER[:GRP] Set uid/gid after binding to port") | ||
117 | //usage: IF_FEATURE_HTTPD_BASIC_AUTH( | ||
118 | //usage: "\n -r REALM Authentication Realm for Basic Authentication") | ||
119 | //usage: "\n -h HOME Home directory (default .)" | ||
120 | //usage: "\n -c FILE Configuration file (default {/etc,HOME}/httpd.conf)" | ||
121 | //usage: IF_FEATURE_HTTPD_AUTH_MD5( | ||
122 | //usage: "\n -m STRING MD5 crypt STRING") | ||
123 | //usage: "\n -e STRING HTML encode STRING" | ||
124 | //usage: "\n -d STRING URL decode STRING" | ||
125 | |||
96 | #include "libbb.h" | 126 | #include "libbb.h" |
97 | #if ENABLE_FEATURE_HTTPD_USE_SENDFILE | 127 | #if ENABLE_FEATURE_HTTPD_USE_SENDFILE |
98 | # include <sys/sendfile.h> | 128 | # include <sys/sendfile.h> |
@@ -1065,6 +1095,7 @@ static void send_headers(int responseNum) | |||
1065 | static void send_headers_and_exit(int responseNum) NORETURN; | 1095 | static void send_headers_and_exit(int responseNum) NORETURN; |
1066 | static void send_headers_and_exit(int responseNum) | 1096 | static void send_headers_and_exit(int responseNum) |
1067 | { | 1097 | { |
1098 | IF_FEATURE_HTTPD_GZIP(content_gzip = 0;) | ||
1068 | send_headers(responseNum); | 1099 | send_headers(responseNum); |
1069 | log_and_exit(); | 1100 | log_and_exit(); |
1070 | } | 1101 | } |