aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-02-24 07:28:38 +0000
committerEric Andersen <andersen@codepoet.org>2004-02-24 07:28:38 +0000
commitd8746cdc40b619f14223893f0e9401c4357352be (patch)
tree2b70dc4cff3ea3a6b1ff7e469ad09bf179e85929
parent60be069d581224b2242cfa8297377a6c11b02b52 (diff)
downloadbusybox-w32-d8746cdc40b619f14223893f0e9401c4357352be.tar.gz
busybox-w32-d8746cdc40b619f14223893f0e9401c4357352be.tar.bz2
busybox-w32-d8746cdc40b619f14223893f0e9401c4357352be.zip
Joe.C, joe at numa dot com dot tw writes:
Hi, When downloading files over slow network (e.g. wireless/ internet) using IE, sometimes it will stop downloading and show error message 'connection closed' when the download is almost complete. This is because IE can't handle server close connection properly. Apache http_main.c fix this problem by close the connection after client close the connection. This patch do exactly the same thing. Please consider include this patch. Joe.C
-rw-r--r--networking/httpd.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 9b36101d7..6374e670f 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1499,6 +1499,9 @@ static void handleIncoming(void)
1499 char *test; 1499 char *test;
1500 struct stat sb; 1500 struct stat sb;
1501 int ip_allowed; 1501 int ip_allowed;
1502 fd_set s_fd ;
1503 struct timeval tv ;
1504 int retval;
1502 1505
1503#ifdef CONFIG_FEATURE_HTTPD_BASIC_AUTH 1506#ifdef CONFIG_FEATURE_HTTPD_BASIC_AUTH
1504 int credentials = -1; /* if not requred this is Ok */ 1507 int credentials = -1; /* if not requred this is Ok */
@@ -1717,6 +1720,17 @@ FORBIDDEN: /* protect listing /cgi-bin */
1717#endif 1720#endif
1718# endif 1721# endif
1719 shutdown(a_c_w, SHUT_WR); 1722 shutdown(a_c_w, SHUT_WR);
1723
1724 /* Properly wait for remote to closed */
1725 FD_ZERO (&s_fd) ;
1726 FD_SET (a_c_w, &s_fd) ;
1727
1728 do {
1729 tv.tv_sec = 2 ;
1730 tv.tv_usec = 0 ;
1731 retval = select (a_c_w + 1, &s_fd, NULL, NULL, &tv);
1732 } while (retval > 0 && (read (a_c_w, buf, sizeof (config->buf)) > 0));
1733
1720 shutdown(a_c_r, SHUT_RD); 1734 shutdown(a_c_r, SHUT_RD);
1721 close(config->accepted_socket); 1735 close(config->accepted_socket);
1722#endif /* CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY */ 1736#endif /* CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY */