gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r31024 - libmicrohttpd/src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r31024 - libmicrohttpd/src/microhttpd
Date: Tue, 3 Dec 2013 21:32:51 +0100

Author: grothoff
Date: 2013-12-03 21:32:51 +0100 (Tue, 03 Dec 2013)
New Revision: 31024

Modified:
   libmicrohttpd/src/microhttpd/daemon.c
   libmicrohttpd/src/microhttpd/internal.c
Log:
-fix tests for MHD_USE_SUSPEND_RESUME

Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c       2013-12-03 20:28:46 UTC (rev 
31023)
+++ libmicrohttpd/src/microhttpd/daemon.c       2013-12-03 20:32:51 UTC (rev 
31024)
@@ -1395,7 +1395,7 @@
   struct MHD_Daemon *daemon;
 
   daemon = connection->daemon;
-  if (0 == (daemon->options & MHD_USE_SUSPEND_RESUME))
+  if (MHD_USE_SUSPEND_RESUME != (daemon->options & MHD_USE_SUSPEND_RESUME))
     MHD_PANIC ("Cannot suspend connections without enabling 
MHD_USE_SUSPEND_RESUME!\n");
   if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
        (0 != pthread_mutex_lock (&daemon->cleanup_connection_mutex)) )
@@ -1456,7 +1456,7 @@
   struct MHD_Daemon *daemon;
 
   daemon = connection->daemon;
-  if (0 == (daemon->options & MHD_USE_SUSPEND_RESUME))
+  if (MHD_USE_SUSPEND_RESUME != (daemon->options & MHD_USE_SUSPEND_RESUME))
     MHD_PANIC ("Cannot resume connections without enabling 
MHD_USE_SUSPEND_RESUME!\n");
   if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
        (0 != pthread_mutex_lock (&daemon->cleanup_connection_mutex)) )
@@ -2037,7 +2037,7 @@
   max = -1;
   if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
     {
-      if (0 != (daemon->options & MHD_USE_SUSPEND_RESUME))
+      if (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME))
         resume_suspended_connections (daemon);
 
       /* single-threaded, go over everything */
@@ -2117,7 +2117,7 @@
   struct MHD_Connection *pos;
   struct MHD_Connection *next;
 
-  if (0 != (daemon->options & MHD_USE_SUSPEND_RESUME))
+  if (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME))
     resume_suspended_connections (daemon);
 
   /* count number of connections and thus determine poll set size */
@@ -2504,7 +2504,7 @@
 
   /* we handle resumes here because we may have ready connections
      that will not be placed into the epoll list immediately. */
-  if (0 != (daemon->options & MHD_USE_SUSPEND_RESUME))
+  if (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME))
     resume_suspended_connections (daemon);
 
   /* process events for connections */
@@ -3115,7 +3115,7 @@
       return MHD_NO;
     }
   if ( (-1 != daemon->wpipe[0]) &&
-       (0 != (daemon->options & MHD_USE_SUSPEND_RESUME)) )
+       (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME)) )
     {
       event.events = EPOLLIN | EPOLLET;
       event.data.ptr = NULL;
@@ -3354,7 +3354,7 @@
       goto free_and_fail;
     }
 
-  if ( (0 != (flags & MHD_USE_SUSPEND_RESUME)) &&
+  if ( (MHD_USE_SUSPEND_RESUME == (flags & MHD_USE_SUSPEND_RESUME)) &&
        (0 != (flags & MHD_USE_THREAD_PER_CONNECTION)) )
     {
 #if HAVE_MESSAGES
@@ -3678,7 +3678,7 @@
           d->worker_pool_size = 0;
           d->worker_pool = NULL;
 
-          if ( (0 != (flags & MHD_USE_SUSPEND_RESUME)) &&
+          if ( (MHD_USE_SUSPEND_RESUME == (flags & MHD_USE_SUSPEND_RESUME)) &&
 #ifdef WINDOWS
                (0 != SOCKETPAIR (AF_INET, SOCK_STREAM, IPPROTO_TCP, d->wpipe))
 #else
@@ -3695,7 +3695,7 @@
             }
 #ifndef WINDOWS
           if ( (0 == (flags & MHD_USE_POLL)) &&
-               (0 != (flags & MHD_USE_SUSPEND_RESUME)) &&
+               (MHD_USE_SUSPEND_RESUME == (flags & MHD_USE_SUSPEND_RESUME)) &&
                (d->wpipe[0] >= FD_SETSIZE) )
             {
 #if HAVE_MESSAGES

Modified: libmicrohttpd/src/microhttpd/internal.c
===================================================================
--- libmicrohttpd/src/microhttpd/internal.c     2013-12-03 20:28:46 UTC (rev 
31023)
+++ libmicrohttpd/src/microhttpd/internal.c     2013-12-03 20:32:51 UTC (rev 
31024)
@@ -136,6 +136,12 @@
          rpos++;
          break;
        case '%':
+          if ( ('\0' == rpos[1]) ||
+               ('\0' == rpos[2]) )
+          {
+            *wpos = '\0';
+            return wpos - val;
+          }
          buf3[0] = rpos[1];
          buf3[1] = rpos[2];
          buf3[2] = '\0';
@@ -159,7 +165,7 @@
 }
 
 
-time_t 
+time_t
 MHD_monotonic_time (void)
 {
 #ifdef HAVE_CLOCK_GETTIME




reply via email to

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