gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r38087 - libmicrohttpd/src/microhttpd
Date: Sun, 9 Oct 2016 20:43:28 +0200

Author: grothoff
Date: 2016-10-09 20:43:27 +0200 (Sun, 09 Oct 2016)
New Revision: 38087

Modified:
   libmicrohttpd/src/microhttpd/connection.c
   libmicrohttpd/src/microhttpd/mhd_locks.h
Log:
-fix locking issue

Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c   2016-10-09 12:03:22 UTC (rev 
38086)
+++ libmicrohttpd/src/microhttpd/connection.c   2016-10-09 18:43:27 UTC (rev 
38087)
@@ -2460,8 +2460,7 @@
               MHD_mutex_lock_ (&response->mutex);
             if (MHD_YES != try_ready_normal_body (connection))
               {
-                if (NULL != response->crc)
-                  MHD_mutex_unlock_ (&response->mutex);
+                /* mutex was already unlocked by try_ready_normal_body */
                 break;
               }
             data_write_offset = connection->response_write_position
@@ -2925,6 +2924,7 @@
                 socket_start_no_buffering (connection);
               break;
             }
+          /* mutex was already unlocked by "try_ready_normal_body */
           /* not ready, no socket action */
           break;
         case MHD_CONNECTION_CHUNKED_BODY_READY:
@@ -2950,7 +2950,6 @@
               /* Buffering for flushable socket was already enabled */
               if (MHD_NO == socket_flush_possible (connection))
                 socket_start_no_buffering (connection);
-
               continue;
             }
           if (NULL != connection->response->crc)

Modified: libmicrohttpd/src/microhttpd/mhd_locks.h
===================================================================
--- libmicrohttpd/src/microhttpd/mhd_locks.h    2016-10-09 12:03:22 UTC (rev 
38086)
+++ libmicrohttpd/src/microhttpd/mhd_locks.h    2016-10-09 18:43:27 UTC (rev 
38087)
@@ -82,9 +82,8 @@
  * @param pmutex pointer to mutex
  */
 #define MHD_mutex_destroy_(pmutex) do { \
-  if ( (0 != pthread_mutex_destroy((pmutex))) && \
-       (EAGAIN != errno) && \
-       (EINPROGRESS != errno) )  \
+  errno = 0; \
+  if (0 != pthread_mutex_destroy((pmutex))) \
     MHD_PANIC (_("Failed to destroy mutex\n")); \
   } while (0)
 #elif defined(MHD_W32_MUTEX_)




reply via email to

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