gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r8344 - libmicrohttpd/src/daemon


From: gnunet
Subject: [GNUnet-SVN] r8344 - libmicrohttpd/src/daemon
Date: Wed, 25 Mar 2009 14:40:35 -0600

Author: durner
Date: 2009-03-25 14:40:35 -0600 (Wed, 25 Mar 2009)
New Revision: 8344

Modified:
   libmicrohttpd/src/daemon/daemon.c
Log:
fix MinGW (untried; based on patch by Brecht Sanders)

Modified: libmicrohttpd/src/daemon/daemon.c
===================================================================
--- libmicrohttpd/src/daemon/daemon.c   2009-03-19 05:01:19 UTC (rev 8343)
+++ libmicrohttpd/src/daemon/daemon.c   2009-03-25 20:40:35 UTC (rev 8344)
@@ -1276,7 +1276,11 @@
     }
   else if (retVal->worker_pool_size > 0)
     {
+#ifndef MINGW
       int sk_flags;
+#else
+      unsigned long sk_flags;
+#endif
 
       /* Coarse-grained count of connections per thread (note error
        * due to integer division). Also keep track of how many
@@ -1291,11 +1295,22 @@
       /* Accept must be non-blocking. Multiple children may wake up
        * to handle a new connection, but only one will win the race.
        * The others must immediately return. */
+#ifndef MINGW
       sk_flags = fcntl (socket_fd, F_GETFL);
       if (sk_flags < 0)
         goto thread_failed;
       if (fcntl (socket_fd, F_SETFL, sk_flags | O_NONBLOCK) < 0)
         goto thread_failed;
+#else
+      sk_flags = 1;
+#if HAVE_PLIBC_FD
+      if (ioctlsocket (plibc_fd_get_handle (socket_fd), FIONBIO, &sk_flags) ==
+          SOCKET_ERROR)
+#else
+      if (ioctlsocket (socket_fd, FIONBIO, &sk_flags) == SOCKET_ERROR)
+#endif // PLIBC_FD
+        goto thread_failed;
+#endif // MINGW
 
       /* Allocate memory for pooled objects */
       retVal->worker_pool = malloc (sizeof (struct MHD_Daemon)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]