diff options
| author | Rob Landley <rob@landley.net> | 2006-04-14 19:46:19 +0000 |
|---|---|---|
| committer | Rob Landley <rob@landley.net> | 2006-04-14 19:46:19 +0000 |
| commit | da0dcd10509b06ba895c271f1b232cdfaaa6cfc8 (patch) | |
| tree | 5b6fb52a443323082eaa4d0174b5b8ef585966d4 | |
| parent | e66c7efc31c44cd549226ac705edf7d1e32f558f (diff) | |
| download | busybox-w32-da0dcd10509b06ba895c271f1b232cdfaaa6cfc8.tar.gz busybox-w32-da0dcd10509b06ba895c271f1b232cdfaaa6cfc8.tar.bz2 busybox-w32-da0dcd10509b06ba895c271f1b232cdfaaa6cfc8.zip | |
Patch from Robert P Day to remove standalone code from httpd. (Busybox has
its own make standalone planned as a general solution to this for all
applets.)
| -rw-r--r-- | networking/httpd.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 34d24ff11..97bec6e4b 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
| @@ -128,66 +128,6 @@ static const char home[] = "./"; | |||
| 128 | 128 | ||
| 129 | //#define DEBUG 1 | 129 | //#define DEBUG 1 |
| 130 | 130 | ||
| 131 | /* Configure options, disabled by default as custom httpd feature */ | ||
| 132 | |||
| 133 | /* disabled as optional features */ | ||
| 134 | //#define CONFIG_FEATURE_HTTPD_ENCODE_URL_STR | ||
| 135 | //#define CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV | ||
| 136 | //#define CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES | ||
| 137 | //#define CONFIG_FEATURE_HTTPD_SETUID | ||
| 138 | //#define CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP | ||
| 139 | |||
| 140 | /* If set, use this server from internet superserver only */ | ||
| 141 | //#define CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY | ||
| 142 | |||
| 143 | /* You can use this server as standalone, require libbb.a for linking */ | ||
| 144 | //#define HTTPD_STANDALONE | ||
| 145 | |||
| 146 | /* Config options, disable this for do very small module */ | ||
| 147 | //#define CONFIG_FEATURE_HTTPD_CGI | ||
| 148 | //#define CONFIG_FEATURE_HTTPD_BASIC_AUTH | ||
| 149 | //#define CONFIG_FEATURE_HTTPD_AUTH_MD5 | ||
| 150 | |||
| 151 | #ifdef HTTPD_STANDALONE | ||
| 152 | /* standalone, enable all features */ | ||
| 153 | #undef CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY | ||
| 154 | /* unset config option for remove warning as redefined */ | ||
| 155 | #undef CONFIG_FEATURE_HTTPD_BASIC_AUTH | ||
| 156 | #undef CONFIG_FEATURE_HTTPD_AUTH_MD5 | ||
| 157 | #undef CONFIG_FEATURE_HTTPD_ENCODE_URL_STR | ||
| 158 | #undef CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV | ||
| 159 | #undef CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES | ||
| 160 | #undef CONFIG_FEATURE_HTTPD_CGI | ||
| 161 | #undef CONFIG_FEATURE_HTTPD_SETUID | ||
| 162 | #undef CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP | ||
| 163 | /* enable all features now */ | ||
| 164 | #define CONFIG_FEATURE_HTTPD_BASIC_AUTH | ||
| 165 | #define CONFIG_FEATURE_HTTPD_AUTH_MD5 | ||
| 166 | #define CONFIG_FEATURE_HTTPD_ENCODE_URL_STR | ||
| 167 | #define CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV | ||
| 168 | #define CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES | ||
| 169 | #define CONFIG_FEATURE_HTTPD_CGI | ||
| 170 | #define CONFIG_FEATURE_HTTPD_SETUID | ||
| 171 | #define CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP | ||
| 172 | |||
| 173 | /* require from libbb.a for linking */ | ||
| 174 | const char *bb_applet_name = "httpd"; | ||
| 175 | |||
| 176 | void bb_show_usage(void) | ||
| 177 | { | ||
| 178 | fprintf(stderr, "Usage: %s [-p <port>] [-c configFile] [-d/-e <string>] " | ||
| 179 | "[-r realm] [-u user] [-h homedir]\n", bb_applet_name); | ||
| 180 | exit(1); | ||
| 181 | } | ||
| 182 | #endif | ||
| 183 | |||
| 184 | #ifdef CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY | ||
| 185 | #undef CONFIG_FEATURE_HTTPD_SETUID /* use inetd user.group config settings */ | ||
| 186 | #undef CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP /* so is not daemon */ | ||
| 187 | /* inetd set stderr to accepted socket and we can`t true see debug messages */ | ||
| 188 | #undef DEBUG | ||
| 189 | #endif | ||
| 190 | |||
| 191 | #ifndef DEBUG | 131 | #ifndef DEBUG |
| 192 | # define DEBUG 0 | 132 | # define DEBUG 0 |
| 193 | #endif | 133 | #endif |
| @@ -1989,11 +1929,7 @@ static const char httpd_opts[]="c:d:h:" | |||
| 1989 | USE_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY(0) | 1929 | USE_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY(0) |
| 1990 | 1930 | ||
| 1991 | 1931 | ||
| 1992 | #ifdef HTTPD_STANDALONE | ||
| 1993 | int main(int argc, char *argv[]) | ||
| 1994 | #else | ||
| 1995 | int httpd_main(int argc, char *argv[]) | 1932 | int httpd_main(int argc, char *argv[]) |
| 1996 | #endif | ||
| 1997 | { | 1933 | { |
| 1998 | unsigned long opt; | 1934 | unsigned long opt; |
| 1999 | const char *home_httpd = home; | 1935 | const char *home_httpd = home; |
