[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37968 - in libmicrohttpd: . src/include src/microhttpd src
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37968 - in libmicrohttpd: . src/include src/microhttpd src/testcurl src/testcurl/https |
Date: |
Thu, 22 Sep 2016 11:25:18 +0200 |
Author: grothoff
Date: 2016-09-22 11:25:18 +0200 (Thu, 22 Sep 2016)
New Revision: 37968
Modified:
libmicrohttpd/ChangeLog
libmicrohttpd/src/include/mhd_options.h
libmicrohttpd/src/microhttpd/connection.c
libmicrohttpd/src/microhttpd/daemon.c
libmicrohttpd/src/microhttpd/digestauth.c
libmicrohttpd/src/microhttpd/internal.h
libmicrohttpd/src/microhttpd/mhd_locks.h
libmicrohttpd/src/microhttpd/mhd_sem.c
libmicrohttpd/src/microhttpd/mhd_sockets.h
libmicrohttpd/src/microhttpd/response.c
libmicrohttpd/src/microhttpd/test_shutdown_select.c
libmicrohttpd/src/microhttpd/test_upgrade_common.c
libmicrohttpd/src/testcurl/https/test_https_time_out.c
libmicrohttpd/src/testcurl/test_callback.c
libmicrohttpd/src/testcurl/test_get.c
libmicrohttpd/src/testcurl/test_quiesce.c
Log:
simplify error handling by baking it into the macros
Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog 2016-09-22 07:57:40 UTC (rev 37967)
+++ libmicrohttpd/ChangeLog 2016-09-22 09:25:18 UTC (rev 37968)
@@ -1,3 +1,8 @@
+Thu Sep 22 11:03:43 CEST 2016
+ Simplify internal error handling logic by folding it into the
+ MHD_socket_close_, MHD_mutex_lock_, MHD_mutex_unlock_ and
+ MHD_mutex_destroy_ functions. -CG
+
Tue Sep 13 22:20:26 MSK 2016
Added autoconf macro to enable maximum platform
features. Fixed compiling on Solaris. -EG
Modified: libmicrohttpd/src/include/mhd_options.h
===================================================================
--- libmicrohttpd/src/include/mhd_options.h 2016-09-22 07:57:40 UTC (rev
37967)
+++ libmicrohttpd/src/include/mhd_options.h 2016-09-22 09:25:18 UTC (rev
37968)
@@ -33,7 +33,16 @@
#include "MHD_config.h"
+/**
+ * Macro to make it easy to mark text for translation. Note that
+ * we do not actually call gettext() in MHD, but we do make it
+ * easy to create a ".po" file so that applications that do want
+ * to translate error messages can do so.
+ */
+#define _(String) (String)
+
+
#ifndef _MHD_EXTERN
#if defined(BUILDING_MHD_LIB) && defined(_WIN32) && \
(defined(DLL_EXPORT) || defined(MHD_W32DLL))
@@ -92,7 +101,7 @@
#endif /* HAVE_C11_GMTIME_S */
#if defined(MHD_FAVOR_FAST_CODE) && defined(MHD_FAVOR_SMALL_CODE)
-#error MHD_FAVOR_FAST_CODE and MHD_FAVOR_SMALL_CODE are both defined. Cannot
favor speed and size at the same time.
+#error MHD_FAVOR_FAST_CODE and MHD_FAVOR_SMALL_CODE are both defined. Cannot
favor speed and size at the same time.
#endif /* MHD_FAVOR_FAST_CODE && MHD_FAVOR_SMALL_CODE */
/* Define MHD_FAVOR_FAST_CODE to force fast code path or
@@ -100,7 +109,7 @@
#if !defined(MHD_FAVOR_FAST_CODE) && !defined(MHD_FAVOR_SMALL_CODE)
/* Try to detect user preferences */
/* Defined by GCC and many compatible compilers */
-#ifdef __OPTIMIZE_SIZE__
+#ifdef __OPTIMIZE_SIZE__
#define MHD_FAVOR_SMALL_CODE 1
#elif __OPTIMIZE__
#define MHD_FAVOR_FAST_CODE 1
Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c 2016-09-22 07:57:40 UTC (rev
37967)
+++ libmicrohttpd/src/microhttpd/connection.c 2016-09-22 09:25:18 UTC (rev
37968)
@@ -614,7 +614,7 @@
{
/* either error or http 1.0 transfer, close socket! */
response->total_size = connection->response_write_position;
- (void) MHD_mutex_unlock_ (&response->mutex);
+ MHD_mutex_unlock_ (&response->mutex);
if ( ((ssize_t)MHD_CONTENT_READER_END_OF_STREAM) == ret)
MHD_connection_close_ (connection,
MHD_REQUEST_TERMINATED_COMPLETED_OK);
@@ -628,7 +628,7 @@
if (0 == ret)
{
connection->state = MHD_CONNECTION_NORMAL_BODY_UNREADY;
- (void) MHD_mutex_unlock_ (&response->mutex);
+ MHD_mutex_unlock_ (&response->mutex);
return MHD_NO;
}
return MHD_YES;
@@ -2457,13 +2457,13 @@
uint64_t data_write_offset;
if (NULL != response->crc)
- (void) MHD_mutex_lock_ (&response->mutex);
+ MHD_mutex_lock_ (&response->mutex);
if (MHD_YES != try_ready_normal_body (connection))
- {
- if (NULL != response->crc)
- (void) MHD_mutex_unlock_ (&response->mutex);
- break;
- }
+ {
+ if (NULL != response->crc)
+ MHD_mutex_unlock_ (&response->mutex);
+ break;
+ }
data_write_offset = connection->response_write_position
- response->data_start;
if (data_write_offset > (uint64_t)SIZE_MAX)
@@ -2484,7 +2484,7 @@
response->data_start]);
#endif
if (NULL != response->crc)
- (void) MHD_mutex_unlock_ (&response->mutex);
+ MHD_mutex_unlock_ (&response->mutex);
if (ret < 0)
{
if (MHD_SCKT_ERR_IS_EINTR_ (err) ||
@@ -2570,8 +2570,7 @@
}
if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
{
- if (! MHD_mutex_lock_ (&daemon->cleanup_connection_mutex))
- MHD_PANIC (_("Failed to acquire cleanup mutex\n"));
+ MHD_mutex_lock_ (&daemon->cleanup_connection_mutex);
}
else
{
@@ -2598,9 +2597,8 @@
connection->suspended = MHD_NO;
connection->resuming = MHD_NO;
connection->in_idle = MHD_NO;
- if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
- (! MHD_mutex_unlock_(&daemon->cleanup_connection_mutex)) )
- MHD_PANIC (_("Failed to release cleanup mutex\n"));
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_unlock_(&daemon->cleanup_connection_mutex);
}
@@ -2909,11 +2907,11 @@
break;
case MHD_CONNECTION_NORMAL_BODY_UNREADY:
if (NULL != connection->response->crc)
- (void) MHD_mutex_lock_ (&connection->response->mutex);
+ MHD_mutex_lock_ (&connection->response->mutex);
if (0 == connection->response->total_size)
{
if (NULL != connection->response->crc)
- (void) MHD_mutex_unlock_ (&connection->response->mutex);
+ MHD_mutex_unlock_ (&connection->response->mutex);
connection->state = MHD_CONNECTION_BODY_SENT;
continue;
}
@@ -2920,7 +2918,7 @@
if (MHD_YES == try_ready_normal_body (connection))
{
if (NULL != connection->response->crc)
- (void) MHD_mutex_unlock_ (&connection->response->mutex);
+ MHD_mutex_unlock_ (&connection->response->mutex);
connection->state = MHD_CONNECTION_NORMAL_BODY_READY;
/* Buffering for flushable socket was already enabled*/
if (MHD_NO == socket_flush_possible (connection))
@@ -2934,13 +2932,13 @@
break;
case MHD_CONNECTION_CHUNKED_BODY_UNREADY:
if (NULL != connection->response->crc)
- (void) MHD_mutex_lock_ (&connection->response->mutex);
+ MHD_mutex_lock_ (&connection->response->mutex);
if ( (0 == connection->response->total_size) ||
(connection->response_write_position ==
connection->response->total_size) )
{
if (NULL != connection->response->crc)
- (void) MHD_mutex_unlock_ (&connection->response->mutex);
+ MHD_mutex_unlock_ (&connection->response->mutex);
connection->state = MHD_CONNECTION_BODY_SENT;
continue;
}
@@ -2947,7 +2945,7 @@
if (MHD_YES == try_ready_chunked_body (connection))
{
if (NULL != connection->response->crc)
- (void) MHD_mutex_unlock_ (&connection->response->mutex);
+ MHD_mutex_unlock_ (&connection->response->mutex);
connection->state = MHD_CONNECTION_CHUNKED_BODY_READY;
/* Buffering for flushable socket was already enabled */
if (MHD_NO == socket_flush_possible (connection))
@@ -2956,7 +2954,7 @@
continue;
}
if (NULL != connection->response->crc)
- (void) MHD_mutex_unlock_ (&connection->response->mutex);
+ MHD_mutex_unlock_ (&connection->response->mutex);
break;
case MHD_CONNECTION_BODY_SENT:
if (MHD_NO == build_header_response (connection))
Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c 2016-09-22 07:57:40 UTC (rev
37967)
+++ libmicrohttpd/src/microhttpd/daemon.c 2016-09-22 09:25:18 UTC (rev
37968)
@@ -195,10 +195,7 @@
static void
MHD_ip_count_lock (struct MHD_Daemon *daemon)
{
- if (! MHD_mutex_lock_(&daemon->per_ip_connection_mutex))
- {
- MHD_PANIC (_("Failed to acquire IP connection limit mutex\n"));
- }
+ MHD_mutex_lock_(&daemon->per_ip_connection_mutex);
}
@@ -210,10 +207,7 @@
static void
MHD_ip_count_unlock (struct MHD_Daemon *daemon)
{
- if (! MHD_mutex_unlock_(&daemon->per_ip_connection_mutex))
- {
- MHD_PANIC (_("Failed to release IP connection limit mutex\n"));
- }
+ MHD_mutex_unlock_(&daemon->per_ip_connection_mutex);
}
@@ -965,8 +959,7 @@
NULL)) )
MHD_PANIC (_("Failed to remove FD from epoll set\n"));
#endif
- if (0 != MHD_socket_close_ (urh->mhd.socket))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (urh->mhd.socket);
}
MHD_resume_connection (connection);
MHD_connection_close_ (connection,
@@ -1536,8 +1529,7 @@
{
shutdown (con->socket_fd,
SHUT_WR);
- if (0 != MHD_socket_close_ (con->socket_fd))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (con->socket_fd);
con->socket_fd = MHD_INVALID_SOCKET;
}
return (MHD_THRD_RTRN_TYPE_) 0;
@@ -1776,8 +1768,7 @@
external_add);
}
/* all pools are at their connection limit, must refuse */
- if (0 != MHD_socket_close_ (client_socket))
- MHD_PANIC ("close failed\n");
+ MHD_socket_close_ (client_socket);
#if ENFILE
errno = ENFILE;
#endif
@@ -1794,8 +1785,7 @@
(int) client_socket,
(int) FD_SETSIZE);
#endif
- if (0 != MHD_socket_close_ (client_socket))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (client_socket);
#if EINVAL
errno = EINVAL;
#endif
@@ -1820,8 +1810,7 @@
MHD_DLOG (daemon,
_("Server reached connection limit. Closing inbound
connection.\n"));
#endif
- if (0 != MHD_socket_close_ (client_socket))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (client_socket);
#if ENFILE
errno = ENFILE;
#endif
@@ -1840,8 +1829,7 @@
_("Connection rejected by application. Closing
connection.\n"));
#endif
#endif
- if (0 != MHD_socket_close_ (client_socket))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (client_socket);
MHD_ip_limit_del (daemon,
addr,
addrlen);
@@ -1871,8 +1859,7 @@
"Error allocating memory: %s\n",
MHD_strerror_ (errno));
#endif
- if (0 != MHD_socket_close_ (client_socket))
- MHD_PANIC ("close failed\n");
+ MHD_socket_close_ (client_socket);
MHD_ip_limit_del (daemon,
addr,
addrlen);
@@ -1890,8 +1877,7 @@
_("Error allocating memory: %s\n"),
MHD_strerror_ (errno));
#endif
- if (0 != MHD_socket_close_ (client_socket))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (client_socket);
MHD_ip_limit_del (daemon,
addr,
addrlen);
@@ -1911,8 +1897,7 @@
_("Error allocating memory: %s\n"),
MHD_strerror_ (errno));
#endif
- if (0 != MHD_socket_close_ (client_socket))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (client_socket);
MHD_ip_limit_del (daemon,
addr,
addrlen);
@@ -1973,8 +1958,7 @@
_("Failed to setup TLS credentials: unknown credential
type %d\n"),
daemon->cred_type);
#endif
- if (0 != MHD_socket_close_ (client_socket))
- MHD_PANIC ("close failed\n");
+ MHD_socket_close_ (client_socket);
MHD_ip_limit_del (daemon,
addr,
addrlen);
@@ -2001,19 +1985,19 @@
if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
{
- if (! MHD_mutex_lock_ (&daemon->cleanup_connection_mutex))
- MHD_PANIC (_("Failed to acquire cleanup mutex\n"));
+ MHD_mutex_lock_ (&daemon->cleanup_connection_mutex);
}
else
+ {
XDLL_insert (daemon->normal_timeout_head,
daemon->normal_timeout_tail,
connection);
+ }
DLL_insert (daemon->connections_head,
daemon->connections_tail,
connection);
- if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
- (!MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex)) )
- MHD_PANIC (_("Failed to release cleanup mutex\n"));
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex);
if (NULL != daemon->notify_connection)
daemon->notify_connection (daemon->notify_connection_cls,
@@ -2093,24 +2077,25 @@
connection,
&connection->socket_context,
MHD_CONNECTION_NOTIFY_CLOSED);
- if (0 != MHD_socket_close_ (client_socket))
- MHD_PANIC (_("close failed\n"));
- MHD_ip_limit_del (daemon, addr, addrlen);
+ MHD_socket_close_ (client_socket);
+ MHD_ip_limit_del (daemon,
+ addr,
+ addrlen);
if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
- {
- if (!MHD_mutex_lock_ (&daemon->cleanup_connection_mutex))
- MHD_PANIC (_("Failed to acquire cleanup mutex\n"));
- }
+ {
+ MHD_mutex_lock_ (&daemon->cleanup_connection_mutex);
+ }
else
- XDLL_remove (daemon->normal_timeout_head,
- daemon->normal_timeout_tail,
- connection);
+ {
+ XDLL_remove (daemon->normal_timeout_head,
+ daemon->normal_timeout_tail,
+ connection);
+ }
DLL_remove (daemon->connections_head,
daemon->connections_tail,
connection);
- if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
- (!MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex)) )
- MHD_PANIC (_("Failed to release cleanup mutex\n"));
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex);
MHD_pool_destroy (connection->pool);
free (connection->addr);
free (connection);
@@ -2156,8 +2141,7 @@
MHD_PANIC (_("Cannot suspend connections without enabling
MHD_USE_SUSPEND_RESUME!\n"));
if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
{
- if (! MHD_mutex_lock_ (&daemon->cleanup_connection_mutex))
- MHD_PANIC (_("Failed to acquire cleanup mutex\n"));
+ MHD_mutex_lock_ (&daemon->cleanup_connection_mutex);
}
else
{
@@ -2199,9 +2183,8 @@
}
#endif
connection->suspended = MHD_YES;
- if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
- (! MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex)) )
- MHD_PANIC (_("Failed to release cleanup mutex\n"));
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex);
}
@@ -2221,9 +2204,8 @@
daemon = connection->daemon;
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)) &&
- (! MHD_mutex_lock_ (&daemon->cleanup_connection_mutex)) )
- MHD_PANIC (_("Failed to acquire cleanup mutex\n"));
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_lock_ (&daemon->cleanup_connection_mutex);
connection->resuming = MHD_YES;
daemon->resuming = MHD_YES;
if ( (MHD_INVALID_PIPE_ != daemon->wpipe[1]) &&
@@ -2234,9 +2216,8 @@
_("Failed to signal resume via pipe."));
#endif
}
- if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
- (! MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex)) )
- MHD_PANIC (_("Failed to release cleanup mutex\n"));
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex);
}
@@ -2255,9 +2236,8 @@
int ret;
ret = MHD_NO;
- if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
- (! MHD_mutex_lock_ (&daemon->cleanup_connection_mutex)) )
- MHD_PANIC (_("Failed to acquire cleanup mutex\n"));
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_lock_ (&daemon->cleanup_connection_mutex);
if (MHD_NO != daemon->resuming)
next = daemon->suspended_connections_head;
@@ -2311,9 +2291,8 @@
pos->suspended = MHD_NO;
pos->resuming = MHD_NO;
}
- if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
- (! MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex)) )
- MHD_PANIC (_("Failed to release cleanup mutex\n"));
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex);
return ret;
}
@@ -2442,9 +2421,7 @@
#endif
if (MHD_INVALID_SOCKET != s)
{
- if (0 != MHD_socket_close_ (s))
- MHD_PANIC (_("close failed\n"));
- /* just in case */
+ MHD_socket_close_ (s);
}
if ( MHD_SCKT_ERR_IS_LOW_RESOURCES_ (err) )
{
@@ -2518,9 +2495,8 @@
{
struct MHD_Connection *pos;
- if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
- (! MHD_mutex_lock_ (&daemon->cleanup_connection_mutex)) )
- MHD_PANIC (_("Failed to acquire cleanup mutex\n"));
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_lock_ (&daemon->cleanup_connection_mutex);
while (NULL != (pos = daemon->cleanup_head))
{
DLL_remove (daemon->cleanup_head,
@@ -2586,16 +2562,14 @@
}
if (MHD_INVALID_SOCKET != pos->socket_fd)
{
- if (0 != MHD_socket_close_ (pos->socket_fd))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (pos->socket_fd);
}
if (NULL != pos->addr)
free (pos->addr);
free (pos);
}
- if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
- (! MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex)) )
- MHD_PANIC (_("Failed to release cleanup mutex\n"));
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex);
}
@@ -4829,8 +4803,7 @@
(unsigned int) port,
MHD_socket_last_strerr_ ());
#endif
- if (0 != MHD_socket_close_ (socket_fd))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (socket_fd);
goto free_and_fail;
}
#ifdef TCP_FASTOPEN
@@ -4860,8 +4833,7 @@
_("Failed to listen for connections: %s\n"),
MHD_socket_last_strerr_ ());
#endif
- if (0 != MHD_socket_close_ (socket_fd))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (socket_fd);
goto free_and_fail;
}
}
@@ -4883,8 +4855,7 @@
/* 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. */
- if (0 != MHD_socket_close_ (socket_fd))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (socket_fd);
goto free_and_fail;
}
}
@@ -4898,8 +4869,7 @@
socket_fd,
FD_SETSIZE);
#endif
- if (0 != MHD_socket_close_ (socket_fd))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (socket_fd);
goto free_and_fail;
}
@@ -4936,9 +4906,8 @@
MHD_DLOG (daemon,
_("MHD failed to initialize IP connection limit mutex\n"));
#endif
- if ( (MHD_INVALID_SOCKET != socket_fd) &&
- (0 != MHD_socket_close_ (socket_fd)) )
- MHD_PANIC (_("close failed\n"));
+ if (MHD_INVALID_SOCKET != socket_fd)
+ MHD_socket_close_ (socket_fd);
goto free_and_fail;
}
if (! MHD_mutex_init_ (&daemon->cleanup_connection_mutex))
@@ -4947,10 +4916,9 @@
MHD_DLOG (daemon,
_("MHD failed to initialize IP connection limit mutex\n"));
#endif
- (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
- if ( (MHD_INVALID_SOCKET != socket_fd) &&
- (0 != MHD_socket_close_ (socket_fd)) )
- MHD_PANIC (_("close failed\n"));
+ MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
+ if (MHD_INVALID_SOCKET != socket_fd)
+ MHD_socket_close_ (socket_fd);
goto free_and_fail;
}
@@ -4963,11 +4931,10 @@
MHD_DLOG (daemon,
_("Failed to initialize TLS support\n"));
#endif
- if ( (MHD_INVALID_SOCKET != socket_fd) &&
- (0 != MHD_socket_close_ (socket_fd)) )
- MHD_PANIC (_("close failed\n"));
- (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
- (void) MHD_mutex_destroy_ (&daemon->per_ip_connection_mutex);
+ if (MHD_INVALID_SOCKET != socket_fd)
+ MHD_socket_close_ (socket_fd);
+ MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
+ MHD_mutex_destroy_ (&daemon->per_ip_connection_mutex);
goto free_and_fail;
}
#endif
@@ -4987,11 +4954,10 @@
_("Failed to create listen thread: %s\n"),
MHD_strerror_ (errno));
#endif
- (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
- (void) MHD_mutex_destroy_ (&daemon->per_ip_connection_mutex);
- if ( (MHD_INVALID_SOCKET != socket_fd) &&
- (0 != MHD_socket_close_ (socket_fd)) )
- MHD_PANIC (_("close failed\n"));
+ MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
+ MHD_mutex_destroy_ (&daemon->per_ip_connection_mutex);
+ if (MHD_INVALID_SOCKET != socket_fd)
+ MHD_socket_close_ (socket_fd);
goto free_and_fail;
}
if ( (daemon->worker_pool_size > 0) &&
@@ -5107,7 +5073,7 @@
#endif
/* Free memory for this worker; cleanup below handles
* all previously-created workers. */
- (void) MHD_mutex_destroy_ (&d->cleanup_connection_mutex);
+ MHD_mutex_destroy_ (&d->cleanup_connection_mutex);
goto thread_failed;
}
}
@@ -5127,11 +5093,10 @@
MHD_USE_SELECT_INTERNALLY mode. */
if (0 == i)
{
- if ( (MHD_INVALID_SOCKET != socket_fd) &&
- (0 != MHD_socket_close_ (socket_fd)) )
- MHD_PANIC (_("close failed\n"));
- (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
- (void) MHD_mutex_destroy_ (&daemon->per_ip_connection_mutex);
+ if (MHD_INVALID_SOCKET != socket_fd)
+ MHD_socket_close_ (socket_fd);
+ MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
+ MHD_mutex_destroy_ (&daemon->per_ip_connection_mutex);
if (NULL != daemon->worker_pool)
free (daemon->worker_pool);
goto free_and_fail;
@@ -5169,7 +5134,7 @@
#endif
#ifdef DAUTH_SUPPORT
free (daemon->nnc);
- (void) MHD_mutex_destroy_ (&daemon->nnc_lock);
+ MHD_mutex_destroy_ (&daemon->nnc_lock);
#endif
#if HTTPS_SUPPORT
if (0 != (flags & MHD_USE_SSL))
@@ -5231,11 +5196,15 @@
{
struct MHD_Connection *pos;
+ /* Give suspended connections a chance to resume to avoid
+ running into the check for there not being any suspended
+ connections left in case of a tight race with a recently
+ resumed connection. */
+ resume_suspended_connections (daemon);
/* first, make sure all threads are aware of shutdown; need to
traverse DLLs in peace... */
- if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
- (! MHD_mutex_lock_ (&daemon->cleanup_connection_mutex)) )
- MHD_PANIC (_("Failed to acquire cleanup mutex\n"));
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_lock_ (&daemon->cleanup_connection_mutex);
if (NULL != daemon->suspended_connections_head)
MHD_PANIC (_("MHD_stop_daemon() called while we have suspended
connections.\n"));
for (pos = daemon->connections_head; NULL != pos; pos = pos->next)
@@ -5248,9 +5217,8 @@
MHD_PANIC (_("Failed to signal shutdown via pipe"));
#endif
}
- if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
- (! MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex)) )
- MHD_PANIC (_("Failed to release cleanup mutex\n"));
+ if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ MHD_mutex_unlock_ (&daemon->cleanup_connection_mutex);
/* now, collect per-connection threads */
if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
@@ -5392,15 +5360,13 @@
if (!MHD_join_thread_ (daemon->worker_pool[i].pid))
MHD_PANIC (_("Failed to join a thread\n"));
close_all_connections (&daemon->worker_pool[i]);
- (void) MHD_mutex_destroy_
(&daemon->worker_pool[i].cleanup_connection_mutex);
+ MHD_mutex_destroy_ (&daemon->worker_pool[i].cleanup_connection_mutex);
#ifdef EPOLL_SUPPORT
- if ( (-1 != daemon->worker_pool[i].epoll_fd) &&
- (0 != MHD_socket_close_ (daemon->worker_pool[i].epoll_fd)) )
- MHD_PANIC (_("close failed\n"));
+ if (-1 != daemon->worker_pool[i].epoll_fd)
+ MHD_socket_close_ (daemon->worker_pool[i].epoll_fd);
#if HTTPS_SUPPORT
- if ( (-1 != daemon->worker_pool[i].epoll_upgrade_fd) &&
- (0 != MHD_socket_close_
(daemon->worker_pool[i].epoll_upgrade_fd)) )
- MHD_PANIC (_("close failed\n"));
+ if (-1 != daemon->worker_pool[i].epoll_upgrade_fd)
+ MHD_socket_close_ (daemon->worker_pool[i].epoll_upgrade_fd);
#endif
#endif
/* Individual pipes are always used */
@@ -5431,9 +5397,8 @@
}
}
close_all_connections (daemon);
- if ( (MHD_INVALID_SOCKET != fd) &&
- (0 != MHD_socket_close_ (fd)) )
- MHD_PANIC (_("close failed\n"));
+ if (MHD_INVALID_SOCKET != fd)
+ MHD_socket_close_ (fd);
/* TLS clean up */
#if HTTPS_SUPPORT
@@ -5451,23 +5416,21 @@
#endif
#ifdef EPOLL_SUPPORT
if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
- (-1 != daemon->epoll_fd) &&
- (0 != MHD_socket_close_ (daemon->epoll_fd)) )
- MHD_PANIC (_("close failed\n"));
+ (-1 != daemon->epoll_fd) )
+ MHD_socket_close_ (daemon->epoll_fd);
#if HTTPS_SUPPORT
if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
- (-1 != daemon->epoll_upgrade_fd) &&
- (0 != MHD_socket_close_ (daemon->epoll_upgrade_fd)) )
- MHD_PANIC (_("close failed\n"));
+ (-1 != daemon->epoll_upgrade_fd) )
+ MHD_socket_close_ (daemon->epoll_upgrade_fd);
#endif
#endif
#ifdef DAUTH_SUPPORT
free (daemon->nnc);
- (void) MHD_mutex_destroy_ (&daemon->nnc_lock);
+ MHD_mutex_destroy_ (&daemon->nnc_lock);
#endif
- (void) MHD_mutex_destroy_ (&daemon->per_ip_connection_mutex);
- (void) MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
+ MHD_mutex_destroy_ (&daemon->per_ip_connection_mutex);
+ MHD_mutex_destroy_ (&daemon->cleanup_connection_mutex);
if (MHD_INVALID_PIPE_ != daemon->wpipe[1])
{
@@ -5735,7 +5698,8 @@
static int
gcry_w32_mutex_lock (void **ppmtx)
{
- return (MHD_mutex_lock_ ((MHD_mutex_*)*ppmtx)) ? 0 : 1;
+ MHD_mutex_lock_ ((MHD_mutex_*)*ppmtx);
+ return 0;
}
@@ -5742,7 +5706,8 @@
static int
gcry_w32_mutex_unlock (void **ppmtx)
{
- return (MHD_mutex_unlock_ ((MHD_mutex_*)*ppmtx)) ? 0 : 1;
+ MHD_mutex_unlock_ ((MHD_mutex_*)*ppmtx);
+ return 0;
}
Modified: libmicrohttpd/src/microhttpd/digestauth.c
===================================================================
--- libmicrohttpd/src/microhttpd/digestauth.c 2016-09-22 07:57:40 UTC (rev
37967)
+++ libmicrohttpd/src/microhttpd/digestauth.c 2016-09-22 09:25:18 UTC (rev
37968)
@@ -408,7 +408,7 @@
* then only increase the nonce counter by one.
*/
nn = &daemon->nnc[off];
- (void) MHD_mutex_lock_ (&daemon->nnc_lock);
+ MHD_mutex_lock_ (&daemon->nnc_lock);
if (0 == nc)
{
/* Fresh nonce, reinitialize array */
@@ -416,7 +416,7 @@
nonce);
nn->nc = 0;
nn->nmask = 0;
- (void) MHD_mutex_unlock_ (&daemon->nnc_lock);
+ MHD_mutex_unlock_ (&daemon->nnc_lock);
return MHD_YES;
}
/* Note that we use 64 here, as we do not store the
@@ -428,7 +428,7 @@
{
/* Out-of-order nonce, but within 64-bit bitmask, set bit */
nn->nmask |= (1LLU < (nn->nc - nc - 1));
- (void) MHD_mutex_unlock_ (&daemon->nnc_lock);
+ MHD_mutex_unlock_ (&daemon->nnc_lock);
return MHD_YES;
}
@@ -437,7 +437,7 @@
nonce)) )
{
/* Nonce does not match, fail */
- (void) MHD_mutex_unlock_ (&daemon->nnc_lock);
+ MHD_mutex_unlock_ (&daemon->nnc_lock);
#ifdef HAVE_MESSAGES
MHD_DLOG (daemon,
_("Stale nonce received. If this happens a lot, you should
probably increase the size of the nonce array.\n"));
@@ -450,7 +450,7 @@
else
nn->nmask = 0; /* big jump, unset all bits in the mask */
nn->nc = nc;
- (void) MHD_mutex_unlock_ (&daemon->nnc_lock);
+ MHD_mutex_unlock_ (&daemon->nnc_lock);
return MHD_YES;
}
Modified: libmicrohttpd/src/microhttpd/internal.h
===================================================================
--- libmicrohttpd/src/microhttpd/internal.h 2016-09-22 07:57:40 UTC (rev
37967)
+++ libmicrohttpd/src/microhttpd/internal.h 2016-09-22 09:25:18 UTC (rev
37968)
@@ -35,6 +35,7 @@
#include <gnutls/abstract.h>
#endif
#endif
+
#include "mhd_threads.h"
#include "mhd_locks.h"
#include "mhd_sockets.h"
@@ -42,14 +43,6 @@
/**
- * Macro to make it easy to mark text for translation. Note that
- * we do not actually call gettext() in MHD, but we do make it
- * easy to create a ".po" file so that applications that do want
- * to translate error messages can do so.
- */
-#define _(String) String
-
-/**
* Should we perform additional sanity checks at runtime (on our internal
* invariants)? This may lead to aborts, but can be useful for debugging.
*/
Modified: libmicrohttpd/src/microhttpd/mhd_locks.h
===================================================================
--- libmicrohttpd/src/microhttpd/mhd_locks.h 2016-09-22 07:57:40 UTC (rev
37967)
+++ libmicrohttpd/src/microhttpd/mhd_locks.h 2016-09-22 09:25:18 UTC (rev
37968)
@@ -80,16 +80,19 @@
/**
* Destroy previously initialised mutex.
* @param pmutex pointer to mutex
- * @return nonzero on success, zero otherwise
*/
-#define MHD_mutex_destroy_(pmutex) (!(pthread_mutex_destroy((pmutex))))
+#define MHD_mutex_destroy_(pmutex) do { \
+ if ( (0 != pthread_mutex_destroy((pmutex))) && \
+ (EAGAIN != errno) && \
+ (EINPROGRESS != errno) ) \
+ MHD_PANIC (_("Failed to destroy mutex\n")); \
+ } while (0)
#elif defined(MHD_W32_MUTEX_)
/**
* Destroy previously initialised mutex.
* @param pmutex pointer to mutex
- * @return Always nonzero
*/
-#define MHD_mutex_destroy_(pmutex) (DeleteCriticalSection((pmutex)), !0)
+#define MHD_mutex_destroy_(pmutex) DeleteCriticalSection((pmutex))
#endif
#if defined(MHD_PTHREAD_MUTEX_)
@@ -98,9 +101,11 @@
* If mutex was already locked by other thread, function
* blocks until mutex becomes available.
* @param pmutex pointer to mutex
- * @return nonzero on success, zero otherwise
*/
-#define MHD_mutex_lock_(pmutex) (!(pthread_mutex_lock((pmutex))))
+#define MHD_mutex_lock_(pmutex) do { \
+ if (0 != pthread_mutex_lock((pmutex))) \
+ MHD_PANIC (_("Failed to lock mutex\n")); \
+ } while (0)
#elif defined(MHD_W32_MUTEX_)
/**
* Acquire lock on previously initialised mutex.
@@ -107,38 +112,20 @@
* If mutex was already locked by other thread, function
* blocks until mutex becomes available.
* @param pmutex pointer to mutex
- * @return Always nonzero
*/
-#define MHD_mutex_lock_(pmutex) (EnterCriticalSection((pmutex)), !0)
+#define MHD_mutex_lock_(pmutex) EnterCriticalSection((pmutex))
#endif
#if defined(MHD_PTHREAD_MUTEX_)
/**
- * Try to acquire lock on previously initialised mutex.
- * Function returns immediately.
- * @param pmutex pointer to mutex
- * @return nonzero if mutex is locked, zero if
- * mutex was not locked.
- */
-#define MHD_mutex_trylock_(pmutex) (!(pthread_mutex_trylock((pmutex))))
-#elif defined(MHD_W32_MUTEX_)
-/**
- * Try to acquire lock on previously initialised mutex.
- * Function returns immediately.
- * @param pmutex pointer to mutex
- * @return nonzero if mutex is locked, zero if
- * mutex was not locked.
- */
-#define MHD_mutex_trylock_(pmutex) (TryEnterCriticalSection((pmutex))))
-#endif
-
-#if defined(MHD_PTHREAD_MUTEX_)
-/**
* Unlock previously initialised and locked mutex.
* @param pmutex pointer to mutex
* @return nonzero on success, zero otherwise
*/
-#define MHD_mutex_unlock_(pmutex) (!(pthread_mutex_unlock((pmutex))))
+#define MHD_mutex_unlock_(pmutex) do { \
+ if (0 != pthread_mutex_unlock((pmutex))) \
+ MHD_PANIC (_("Failed to unlock mutex\n")); \
+ } while (0)
#elif defined(MHD_W32_MUTEX_)
/**
* Unlock previously initialised and locked mutex.
@@ -145,7 +132,7 @@
* @param pmutex pointer to mutex
* @return Always nonzero
*/
-#define MHD_mutex_unlock_(pmutex) (LeaveCriticalSection((pmutex)), !0)
+#define MHD_mutex_unlock_(pmutex) LeaveCriticalSection((pmutex))
#endif
Modified: libmicrohttpd/src/microhttpd/mhd_sem.c
===================================================================
--- libmicrohttpd/src/microhttpd/mhd_sem.c 2016-09-22 07:57:40 UTC (rev
37967)
+++ libmicrohttpd/src/microhttpd/mhd_sem.c 2016-09-22 09:25:18 UTC (rev
37968)
@@ -89,16 +89,16 @@
MHD_semaphore_down (struct MHD_Semaphore *sem)
{
if (0 != pthread_mutex_lock (&sem->mutex))
- MHD_PANIC ("pthread_mutex_lock for semaphore failed\n");
+ MHD_PANIC (_("Failed to lock mutex\n"));
while (0 == sem->counter)
{
if (0 != pthread_cond_wait (&sem->cv,
&sem->mutex))
- MHD_PANIC ("pthread_cond_wait failed\n");
+ MHD_PANIC (_("pthread_cond_wait failed\n"));
}
sem->counter--;
if (0 != pthread_mutex_unlock (&sem->mutex))
- MHD_PANIC ("pthread_mutex_unlock for semaphore failed\n");
+ MHD_PANIC (_("Failed to unlock mutex\n"));
}
@@ -111,11 +111,11 @@
MHD_semaphore_up (struct MHD_Semaphore *sem)
{
if (0 != pthread_mutex_lock (&sem->mutex))
- MHD_PANIC ("pthread_mutex_lock for semaphore failed\n");
+ MHD_PANIC (_("Failed to lock mutex\n"));
sem->counter++;
pthread_cond_signal (&sem->cv);
if (0 != pthread_mutex_unlock (&sem->mutex))
- MHD_PANIC ("pthread_mutex_unlock for semaphore failed\n");
+ MHD_PANIC (_("Failed to unlock mutex\n"));
}
@@ -128,9 +128,9 @@
MHD_semaphore_destroy (struct MHD_Semaphore *sem)
{
if (0 != pthread_cond_destroy (&sem->cv))
- MHD_PANIC ("pthread_cond_destroy failed\n");
+ MHD_PANIC (_("pthread_cond_destroy failed\n"));
if (0 != pthread_mutex_destroy (&sem->mutex))
- MHD_PANIC ("pthread_mutex_destroy failed\n");
+ MHD_PANIC (_("Failed to destroy mutex\n"));
free (sem);
}
Modified: libmicrohttpd/src/microhttpd/mhd_sockets.h
===================================================================
--- libmicrohttpd/src/microhttpd/mhd_sockets.h 2016-09-22 07:57:40 UTC (rev
37967)
+++ libmicrohttpd/src/microhttpd/mhd_sockets.h 2016-09-22 09:25:18 UTC (rev
37968)
@@ -195,13 +195,18 @@
* errno is set to EINTR. Do not use HP-UNIX.
*
* @param fd descriptor to close
- * @return 0 on success (error codes like EINTR and EIO are counted as success,
- * only EBADF counts as an error!)
*/
#if !defined(MHD_WINSOCK_SOCKETS)
-# define MHD_socket_close_(fd) (((0 != close(fd)) && (EBADF == errno)) ? -1 :
0)
+# define MHD_socket_close_(fd) do { \
+ if ( (0 != close((fd))) && \
+ (EBADF == errno) ) \
+ MHD_PANIC (_("close failed\n")); \
+ } while (0)
#else
-# define MHD_socket_close_(fd) closesocket((fd))
+# define MHD_socket_close_(fd) do { \
+ if (0 != closesocket((fd)) ) \
+ MHD_PANIC (_("close failed\n")); \
+ } while (0)
#endif
/**
Modified: libmicrohttpd/src/microhttpd/response.c
===================================================================
--- libmicrohttpd/src/microhttpd/response.c 2016-09-22 07:57:40 UTC (rev
37967)
+++ libmicrohttpd/src/microhttpd/response.c 2016-09-22 09:25:18 UTC (rev
37968)
@@ -568,7 +568,7 @@
{
if (NULL == (tmp = malloc (size)))
{
- (void) MHD_mutex_destroy_ (&response->mutex);
+ MHD_mutex_destroy_ (&response->mutex);
free (response);
return NULL;
}
@@ -655,8 +655,7 @@
urh->was_closed = MHD_YES;
if (MHD_INVALID_SOCKET != urh->app.socket)
{
- if (0 != MHD_socket_close_ (urh->app.socket))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (urh->app.socket);
urh->app.socket = MHD_INVALID_SOCKET;
}
return MHD_YES;
@@ -743,10 +742,8 @@
(int) sv[1],
(int) FD_SETSIZE);
#endif
- if (0 != MHD_socket_close_ (sv[0]))
- MHD_PANIC (_("close failed\n"));
- if (0 != MHD_socket_close_ (sv[1]))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (sv[0]);
+ MHD_socket_close_ (sv[1]);
free (urh);
return MHD_NO;
}
@@ -817,10 +814,8 @@
_("Call to epoll_ctl failed: %s\n"),
MHD_socket_last_strerr_ ());
#endif
- if (0 != MHD_socket_close_ (sv[0]))
- MHD_PANIC (_("close failed\n"));
- if (0 != MHD_socket_close_ (sv[1]))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (sv[0]);
+ MHD_socket_close_ (sv[1]);
free (urh);
return MHD_NO;
}
@@ -845,10 +840,8 @@
_("Call to epoll_ctl failed: %s\n"),
MHD_socket_last_strerr_ ());
#endif
- if (0 != MHD_socket_close_ (sv[0]))
- MHD_PANIC (_("close failed\n"));
- if (0 != MHD_socket_close_ (sv[1]))
- MHD_PANIC (_("close failed\n"));
+ MHD_socket_close_ (sv[0]);
+ MHD_socket_close_ (sv[1]);
free (urh);
return MHD_NO;
}
@@ -993,14 +986,14 @@
if (NULL == response)
return;
- (void) MHD_mutex_lock_ (&response->mutex);
+ MHD_mutex_lock_ (&response->mutex);
if (0 != --(response->reference_count))
{
- (void) MHD_mutex_unlock_ (&response->mutex);
+ MHD_mutex_unlock_ (&response->mutex);
return;
}
- (void) MHD_mutex_unlock_ (&response->mutex);
- (void) MHD_mutex_destroy_ (&response->mutex);
+ MHD_mutex_unlock_ (&response->mutex);
+ MHD_mutex_destroy_ (&response->mutex);
if (NULL != response->crfc)
response->crfc (response->crc_cls);
while (NULL != response->first_header)
@@ -1023,9 +1016,9 @@
void
MHD_increment_response_rc (struct MHD_Response *response)
{
- (void) MHD_mutex_lock_ (&response->mutex);
+ MHD_mutex_lock_ (&response->mutex);
(response->reference_count)++;
- (void) MHD_mutex_unlock_ (&response->mutex);
+ MHD_mutex_unlock_ (&response->mutex);
}
Modified: libmicrohttpd/src/microhttpd/test_shutdown_select.c
===================================================================
--- libmicrohttpd/src/microhttpd/test_shutdown_select.c 2016-09-22 07:57:40 UTC
(rev 37967)
+++ libmicrohttpd/src/microhttpd/test_shutdown_select.c 2016-09-22 09:25:18 UTC
(rev 37968)
@@ -89,6 +89,15 @@
static _MHD_bool check_err;
+
+void
+MHD_PANIC (char *msg)
+{
+ fprintf (stderr, "%s", msg);
+ abort ();
+}
+
+
static _MHD_bool
has_in_name(const char *prog_name, const char *marker)
{
Modified: libmicrohttpd/src/microhttpd/test_upgrade_common.c
===================================================================
--- libmicrohttpd/src/microhttpd/test_upgrade_common.c 2016-09-22 07:57:40 UTC
(rev 37967)
+++ libmicrohttpd/src/microhttpd/test_upgrade_common.c 2016-09-22 09:25:18 UTC
(rev 37968)
@@ -45,6 +45,15 @@
*/
static int done;
+
+void
+MHD_PANIC (char *msg)
+{
+ fprintf (stderr, "%s", msg);
+ abort ();
+}
+
+
/**
* Change socket to non-blocking.
*
Modified: libmicrohttpd/src/testcurl/https/test_https_time_out.c
===================================================================
--- libmicrohttpd/src/testcurl/https/test_https_time_out.c 2016-09-22
07:57:40 UTC (rev 37967)
+++ libmicrohttpd/src/testcurl/https/test_https_time_out.c 2016-09-22
09:25:18 UTC (rev 37968)
@@ -32,6 +32,16 @@
#include <gcrypt.h>
#include "mhd_sockets.h" /* only macros used */
+#undef MHD_PANIC
+
+
+void
+MHD_PANIC (char *msg)
+{
+ fprintf (stderr, "%s", msg);
+ abort ();
+}
+
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
Modified: libmicrohttpd/src/testcurl/test_callback.c
===================================================================
--- libmicrohttpd/src/testcurl/test_callback.c 2016-09-22 07:57:40 UTC (rev
37967)
+++ libmicrohttpd/src/testcurl/test_callback.c 2016-09-22 09:25:18 UTC (rev
37968)
@@ -73,14 +73,19 @@
r = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, 1024,
&called_twice, cbc,
&free);
- MHD_queue_response(connection, MHD_HTTP_OK, r);
- MHD_destroy_response(r);
+ MHD_queue_response (connection,
+ MHD_HTTP_OK,
+ r);
+ MHD_destroy_response (r);
return MHD_YES;
}
static size_t
-discard_buffer (void *ptr, size_t size, size_t nmemb, void *ctx)
+discard_buffer (void *ptr,
+ size_t size,
+ size_t nmemb,
+ void *ctx)
{
return size * nmemb;
}
Modified: libmicrohttpd/src/testcurl/test_get.c
===================================================================
--- libmicrohttpd/src/testcurl/test_get.c 2016-09-22 07:57:40 UTC (rev
37967)
+++ libmicrohttpd/src/testcurl/test_get.c 2016-09-22 09:25:18 UTC (rev
37968)
@@ -34,6 +34,14 @@
#include <time.h>
#include "mhd_sockets.h" /* only macros used */
+void
+MHD_PANIC (char *msg)
+{
+ fprintf (stderr, "%s", msg);
+ abort ();
+}
+
+
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
Modified: libmicrohttpd/src/testcurl/test_quiesce.c
===================================================================
--- libmicrohttpd/src/testcurl/test_quiesce.c 2016-09-22 07:57:40 UTC (rev
37967)
+++ libmicrohttpd/src/testcurl/test_quiesce.c 2016-09-22 09:25:18 UTC (rev
37968)
@@ -34,6 +34,14 @@
#include <pthread.h>
#include "mhd_sockets.h" /* only macros used */
+void
+MHD_PANIC (char *msg)
+{
+ fprintf (stderr, "%s", msg);
+ abort ();
+}
+
+
#ifndef WINDOWS
#include <unistd.h>
#include <sys/socket.h>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37968 - in libmicrohttpd: . src/include src/microhttpd src/testcurl src/testcurl/https,
gnunet <=