mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-26 04:09:30 +03:00
fix
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
Wed Sep 21 09:53:18 CEST 2011
|
||||
Reverting to using pipes for signalling select on non-Linux
|
||||
platforms where shutdown-on-listen-sockets does not work. -WB/CG
|
||||
|
||||
Mon Sep 19 14:06:30 CEST 2011
|
||||
Fixing problem introduced with prompt response cleanup code. -CG
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ case "$host_os" in
|
||||
;;
|
||||
linux*)
|
||||
AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
|
||||
AC_DEFINE_UNQUOTED(HAVE_LISTEN_SHUTDOWN,1,[can use shutdown on listen sockets])
|
||||
AM_CONDITIONAL(HAVE_GNU_LD, true)
|
||||
AM_CONDITIONAL(HAVE_W32, false)
|
||||
;;
|
||||
@@ -116,6 +117,7 @@ netbsd*)
|
||||
;;
|
||||
*arm-linux*)
|
||||
AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
|
||||
AC_DEFINE_UNQUOTED(HAVE_LISTEN_SHUTDOWN,1,[can use shutdown on listen sockets])
|
||||
CFLAGS="-D_REENTRANT -fPIC -pipe $CFLAGS"
|
||||
AM_CONDITIONAL(HAVE_GNU_LD, true)
|
||||
AM_CONDITIONAL(HAVE_W32, false)
|
||||
@@ -147,6 +149,10 @@ netbsd*)
|
||||
*)
|
||||
AC_MSG_RESULT(Unrecognised OS $host_os)
|
||||
AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
|
||||
# You might want to find out if your OS supports shutdown on listen sockets,
|
||||
# and extend the switch statement; if we do not have 'HAVE_LISTEN_SHUTDOWN',
|
||||
# pipes are used instead to signal 'select'.
|
||||
# AC_DEFINE_UNQUOTED(HAVE_LISTEN_SHUTDOWN,1,[can use shutdown on listen sockets])
|
||||
AM_CONDITIONAL(HAVE_GNU_LD, false)
|
||||
AM_CONDITIONAL(HAVE_W32, false)
|
||||
;;
|
||||
|
||||
+7
-4
@@ -2517,23 +2517,24 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
|
||||
int fd;
|
||||
unsigned int i;
|
||||
int rc;
|
||||
char c;
|
||||
|
||||
if (daemon == NULL)
|
||||
return;
|
||||
daemon->shutdown = MHD_YES;
|
||||
fd = daemon->socket_fd;
|
||||
daemon->socket_fd = -1;
|
||||
if (daemon->wpipe[1] != -1)
|
||||
write (daemon->wpipe[1], "e", 1);
|
||||
|
||||
/* Prepare workers for shutdown */
|
||||
for (i = 0; i < daemon->worker_pool_size; ++i)
|
||||
{
|
||||
daemon->worker_pool[i].shutdown = MHD_YES;
|
||||
daemon->worker_pool[i].socket_fd = -1;
|
||||
}
|
||||
#ifdef HAVE_LISTEN_SHUTDOWN
|
||||
SHUTDOWN (fd, SHUT_RDWR);
|
||||
#else
|
||||
if (daemon->wpipe[1] != -1)
|
||||
write (daemon->wpipe[1], "e", 1);
|
||||
#endif
|
||||
#if DEBUG_CLOSE
|
||||
#if HAVE_MESSAGES
|
||||
MHD_DLOG (daemon, "MHD listen socket shutdown\n");
|
||||
@@ -2608,6 +2609,8 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
|
||||
#ifndef HAVE_LISTEN_SHUTDOWN
|
||||
if (daemon->wpipe[1] != -1)
|
||||
{
|
||||
char c;
|
||||
|
||||
/* just to be sure, remove the one char we
|
||||
wrote into the pipe */
|
||||
(void) read (daemon->wpipe[0], &c, 1);
|
||||
|
||||
Reference in New Issue
Block a user