aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 */