aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configs/mingw32_defconfig4
-rw-r--r--configs/mingw64_defconfig4
-rw-r--r--networking/httpd.c20
3 files changed, 17 insertions, 11 deletions
diff --git a/configs/mingw32_defconfig b/configs/mingw32_defconfig
index a86be37ea..d93eefcf5 100644
--- a/configs/mingw32_defconfig
+++ b/configs/mingw32_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Busybox version: 1.32.0.git 3# Busybox version: 1.32.0.git
4# Mon Apr 6 08:34:52 2020 4# Tue Apr 7 08:21:17 2020
5# 5#
6CONFIG_HAVE_DOT_CONFIG=y 6CONFIG_HAVE_DOT_CONFIG=y
7# CONFIG_PLATFORM_POSIX is not set 7# CONFIG_PLATFORM_POSIX is not set
@@ -877,7 +877,7 @@ CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
877# CONFIG_FEATURE_HTTPD_CGI is not set 877# CONFIG_FEATURE_HTTPD_CGI is not set
878# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set 878# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
879# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set 879# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
880# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set 880CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
881CONFIG_FEATURE_HTTPD_ERROR_PAGES=y 881CONFIG_FEATURE_HTTPD_ERROR_PAGES=y
882# CONFIG_FEATURE_HTTPD_PROXY is not set 882# CONFIG_FEATURE_HTTPD_PROXY is not set
883CONFIG_FEATURE_HTTPD_GZIP=y 883CONFIG_FEATURE_HTTPD_GZIP=y
diff --git a/configs/mingw64_defconfig b/configs/mingw64_defconfig
index 2c60d22ac..3bd6beb70 100644
--- a/configs/mingw64_defconfig
+++ b/configs/mingw64_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Busybox version: 1.32.0.git 3# Busybox version: 1.32.0.git
4# Mon Apr 6 08:34:52 2020 4# Tue Apr 7 08:21:17 2020
5# 5#
6CONFIG_HAVE_DOT_CONFIG=y 6CONFIG_HAVE_DOT_CONFIG=y
7# CONFIG_PLATFORM_POSIX is not set 7# CONFIG_PLATFORM_POSIX is not set
@@ -877,7 +877,7 @@ CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
877# CONFIG_FEATURE_HTTPD_CGI is not set 877# CONFIG_FEATURE_HTTPD_CGI is not set
878# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set 878# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
879# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set 879# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
880# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set 880CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
881CONFIG_FEATURE_HTTPD_ERROR_PAGES=y 881CONFIG_FEATURE_HTTPD_ERROR_PAGES=y
882# CONFIG_FEATURE_HTTPD_PROXY is not set 882# CONFIG_FEATURE_HTTPD_PROXY is not set
883CONFIG_FEATURE_HTTPD_GZIP=y 883CONFIG_FEATURE_HTTPD_GZIP=y
diff --git a/networking/httpd.c b/networking/httpd.c
index 7e1c187a5..9cf85dc21 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -220,7 +220,12 @@
220//kbuild:lib-$(CONFIG_HTTPD) += httpd.o 220//kbuild:lib-$(CONFIG_HTTPD) += httpd.o
221 221
222//usage:#define httpd_trivial_usage 222//usage:#define httpd_trivial_usage
223//usage: IF_NOT_PLATFORM_MINGW32(
223//usage: "[-ifv[v]]" 224//usage: "[-ifv[v]]"
225//usage: )
226//usage: IF_PLATFORM_MINGW32(
227//usage: "[-fv[v]]"
228//usage: )
224//usage: " [-c CONFFILE]" 229//usage: " [-c CONFFILE]"
225//usage: " [-p [IP:]PORT]" 230//usage: " [-p [IP:]PORT]"
226//usage: IF_FEATURE_HTTPD_SETUID(" [-u USER[:GRP]]") 231//usage: IF_FEATURE_HTTPD_SETUID(" [-u USER[:GRP]]")
@@ -232,9 +237,6 @@
232//usage: IF_NOT_PLATFORM_MINGW32( 237//usage: IF_NOT_PLATFORM_MINGW32(
233//usage: "\n -i Inetd mode" 238//usage: "\n -i Inetd mode"
234//usage: ) 239//usage: )
235//usage: IF_PLATFORM_MINGW32(
236//usage: "\n -i fd Inetd mode file descriptor"
237//usage: )
238//usage: "\n -f Don't daemonize" 240//usage: "\n -f Don't daemonize"
239//usage: "\n -v[v] Verbose" 241//usage: "\n -v[v] Verbose"
240//usage: "\n -p [IP:]PORT Bind to IP:PORT (default *:80)" 242//usage: "\n -p [IP:]PORT Bind to IP:PORT (default *:80)"
@@ -2670,7 +2672,7 @@ static void mini_httpd_win32(int fg, int sock, int argc, char **argv)
2670 argv_copy[0] = (char *)bb_busybox_exec_path; 2672 argv_copy[0] = (char *)bb_busybox_exec_path;
2671 argv_copy[1] = (char *)"--busybox"; 2673 argv_copy[1] = (char *)"--busybox";
2672 argv_copy[2] = (char *)"httpd"; 2674 argv_copy[2] = (char *)"httpd";
2673 argv_copy[3] = (char *)"-i"; 2675 argv_copy[3] = (char *)"-I";
2674 memcpy(&argv_copy[5], &argv[1], argc * sizeof(argv[0])); 2676 memcpy(&argv_copy[5], &argv[1], argc * sizeof(argv[0]));
2675 2677
2676 while (1) { 2678 while (1) {
@@ -2801,10 +2803,11 @@ int httpd_main(int argc UNUSED_PARAM, char **argv)
2801 IF_FEATURE_HTTPD_AUTH_MD5("m:") 2803 IF_FEATURE_HTTPD_AUTH_MD5("m:")
2802 IF_FEATURE_HTTPD_SETUID("u:") 2804 IF_FEATURE_HTTPD_SETUID("u:")
2803 IF_NOT_PLATFORM_MINGW32("p:ifv") 2805 IF_NOT_PLATFORM_MINGW32("p:ifv")
2804 IF_PLATFORM_MINGW32("p:i:+fv") 2806 IF_PLATFORM_MINGW32("p:I:+fv")
2805 "\0" 2807 "\0"
2806 /* -v counts, -i implies -f */ 2808 /* -v counts, -i implies -f */
2807 "vv:if", 2809 IF_NOT_PLATFORM_MINGW32("vv:if",)
2810 IF_PLATFORM_MINGW32("vv:If",)
2808 &opt_c_configFile, &url_for_decode, &home_httpd 2811 &opt_c_configFile, &url_for_decode, &home_httpd
2809 IF_FEATURE_HTTPD_ENCODE_URL_STR(, &url_for_encode) 2812 IF_FEATURE_HTTPD_ENCODE_URL_STR(, &url_for_encode)
2810 IF_FEATURE_HTTPD_BASIC_AUTH(, &g_realm) 2813 IF_FEATURE_HTTPD_BASIC_AUTH(, &g_realm)
@@ -2852,7 +2855,10 @@ int httpd_main(int argc UNUSED_PARAM, char **argv)
2852 mingw_daemonize(argv); 2855 mingw_daemonize(argv);
2853#endif 2856#endif
2854 2857
2855 xchdir(home_httpd); 2858#if ENABLE_PLATFORM_MINGW32
2859 if (!(opt & OPT_INETD))
2860#endif
2861 xchdir(home_httpd);
2856 if (!(opt & OPT_INETD)) { 2862 if (!(opt & OPT_INETD)) {
2857#ifdef SIGCHLD 2863#ifdef SIGCHLD
2858 signal(SIGCHLD, SIG_IGN); 2864 signal(SIGCHLD, SIG_IGN);