[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16982 - in libmicrohttpd: . src/daemon
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16982 - in libmicrohttpd: . src/daemon |
Date: |
Wed, 21 Sep 2011 09:58:17 +0200 |
Author: grothoff
Date: 2011-09-21 09:58:16 +0200 (Wed, 21 Sep 2011)
New Revision: 16982
Modified:
libmicrohttpd/ChangeLog
libmicrohttpd/configure.ac
libmicrohttpd/src/daemon/daemon.c
Log:
fix
Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog 2011-09-21 07:47:35 UTC (rev 16981)
+++ libmicrohttpd/ChangeLog 2011-09-21 07:58:16 UTC (rev 16982)
@@ -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
Modified: libmicrohttpd/configure.ac
===================================================================
--- libmicrohttpd/configure.ac 2011-09-21 07:47:35 UTC (rev 16981)
+++ libmicrohttpd/configure.ac 2011-09-21 07:58:16 UTC (rev 16982)
@@ -85,6 +85,7 @@
;;
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 @@
;;
*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 @@
*)
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)
;;
Modified: libmicrohttpd/src/daemon/daemon.c
===================================================================
--- libmicrohttpd/src/daemon/daemon.c 2011-09-21 07:47:35 UTC (rev 16981)
+++ libmicrohttpd/src/daemon/daemon.c 2011-09-21 07:58:16 UTC (rev 16982)
@@ -2517,23 +2517,24 @@
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 @@
#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);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16982 - in libmicrohttpd: . src/daemon,
gnunet <=