[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37780 - in libmicrohttpd: . src/examples src/microhttpd sr
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37780 - in libmicrohttpd: . src/examples src/microhttpd src/testcurl/https |
Date: |
Wed, 24 Aug 2016 17:02:10 +0200 |
Author: Karlson2k
Date: 2016-08-24 17:02:10 +0200 (Wed, 24 Aug 2016)
New Revision: 37780
Modified:
libmicrohttpd/configure.ac
libmicrohttpd/src/examples/benchmark.c
libmicrohttpd/src/examples/benchmark_https.c
libmicrohttpd/src/examples/demo.c
libmicrohttpd/src/examples/demo_https.c
libmicrohttpd/src/microhttpd/connection.c
libmicrohttpd/src/microhttpd/connection.h
libmicrohttpd/src/microhttpd/connection_https.c
libmicrohttpd/src/microhttpd/daemon.c
libmicrohttpd/src/microhttpd/internal.h
libmicrohttpd/src/microhttpd/mhd_sockets.h
libmicrohttpd/src/testcurl/https/test_https_get_parallel.c
libmicrohttpd/src/testcurl/https/test_https_get_select.c
Log:
Refactoring: do not define EPOLL_SUPPORT if epoll is disabled or not supported.
Modified: libmicrohttpd/configure.ac
===================================================================
--- libmicrohttpd/configure.ac 2016-08-24 15:02:05 UTC (rev 37779)
+++ libmicrohttpd/configure.ac 2016-08-24 15:02:10 UTC (rev 37780)
@@ -529,10 +529,9 @@
if test "$enable_epoll" != "no"; then
AX_HAVE_EPOLL
if test "${ax_cv_have_epoll}" = "yes"; then
- AC_DEFINE([EPOLL_SUPPORT],[1],[define to 1 to enable epoll support])
+ AC_DEFINE([[EPOLL_SUPPORT]],[[1]],[Define to 1 to enable epoll support])
enable_epoll='yes'
else
- AC_DEFINE([EPOLL_SUPPORT],[0],[define to 0 to disable epoll support])
if test "$enable_epoll" = "yes"; then
AC_MSG_ERROR([[Support for epoll was explicitly requested but cannot be
enabled on this platform.]])
fi
Modified: libmicrohttpd/src/examples/benchmark.c
===================================================================
--- libmicrohttpd/src/examples/benchmark.c 2016-08-24 15:02:05 UTC (rev
37779)
+++ libmicrohttpd/src/examples/benchmark.c 2016-08-24 15:02:10 UTC (rev
37780)
@@ -135,7 +135,7 @@
"close");
#endif
d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_SUPPRESS_DATE_NO_CLOCK
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
| MHD_USE_EPOLL_LINUX_ONLY | MHD_USE_EPOLL_TURBO
#endif
,
Modified: libmicrohttpd/src/examples/benchmark_https.c
===================================================================
--- libmicrohttpd/src/examples/benchmark_https.c 2016-08-24 15:02:05 UTC
(rev 37779)
+++ libmicrohttpd/src/examples/benchmark_https.c 2016-08-24 15:02:10 UTC
(rev 37780)
@@ -181,7 +181,7 @@
(void *) PAGE,
MHD_RESPMEM_PERSISTENT);
d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_SSL
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
| MHD_USE_EPOLL_LINUX_ONLY | MHD_USE_EPOLL_TURBO
#endif
,
Modified: libmicrohttpd/src/examples/demo.c
===================================================================
--- libmicrohttpd/src/examples/demo.c 2016-08-24 15:02:05 UTC (rev 37779)
+++ libmicrohttpd/src/examples/demo.c 2016-08-24 15:02:10 UTC (rev 37780)
@@ -884,7 +884,7 @@
mark_as_html (internal_error_response);
update_directory ();
d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
| MHD_USE_EPOLL_LINUX_ONLY
#endif
,
Modified: libmicrohttpd/src/examples/demo_https.c
===================================================================
--- libmicrohttpd/src/examples/demo_https.c 2016-08-24 15:02:05 UTC (rev
37779)
+++ libmicrohttpd/src/examples/demo_https.c 2016-08-24 15:02:10 UTC (rev
37780)
@@ -933,7 +933,7 @@
mark_as_html (internal_error_response);
update_directory ();
d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG | MHD_USE_SSL
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
| MHD_USE_EPOLL_LINUX_ONLY
#endif
,
Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c 2016-08-24 15:02:05 UTC (rev
37779)
+++ libmicrohttpd/src/microhttpd/connection.c 2016-08-24 15:02:10 UTC (rev
37780)
@@ -2894,7 +2894,7 @@
return MHD_YES;
}
MHD_connection_update_event_loop_info (connection);
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY))
{
switch (connection->event_loop_info)
@@ -2945,7 +2945,7 @@
}
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
/**
* Perform epoll() processing, possibly moving the connection back into
* the epoll() set if needed.
Modified: libmicrohttpd/src/microhttpd/connection.h
===================================================================
--- libmicrohttpd/src/microhttpd/connection.h 2016-08-24 15:02:05 UTC (rev
37779)
+++ libmicrohttpd/src/microhttpd/connection.h 2016-08-24 15:02:10 UTC (rev
37780)
@@ -93,7 +93,7 @@
enum MHD_RequestTerminationCode termination_code);
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
/**
* Perform epoll processing, possibly moving the connection back into
* the epoll set if needed.
Modified: libmicrohttpd/src/microhttpd/connection_https.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection_https.c 2016-08-24 15:02:05 UTC
(rev 37779)
+++ libmicrohttpd/src/microhttpd/connection_https.c 2016-08-24 15:02:10 UTC
(rev 37780)
@@ -159,7 +159,7 @@
return MHD_YES;
return MHD_connection_handle_idle (connection);
}
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
return MHD_connection_epoll_update_ (connection);
#else
return MHD_YES;
Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c 2016-08-24 15:02:05 UTC (rev
37779)
+++ libmicrohttpd/src/microhttpd/daemon.c 2016-08-24 15:02:10 UTC (rev
37780)
@@ -415,7 +415,7 @@
(GNUTLS_E_INTERRUPTED == res) )
{
MHD_socket_set_error_ (MHD_SCKT_EINTR_);
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
connection->epoll_state &= ~MHD_EPOLL_STATE_READ_READY;
#endif
return -1;
@@ -456,7 +456,7 @@
(GNUTLS_E_INTERRUPTED == res) )
{
MHD_socket_set_error_ (MHD_SCKT_EINTR_);
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY;
#endif
return -1;
@@ -663,7 +663,7 @@
|| (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
|| (0 != (daemon->options & MHD_USE_POLL)))
return MHD_NO;
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY))
{
/* we're in epoll mode, use the epoll FD as a stand-in for
@@ -1047,7 +1047,7 @@
other,
(MHD_SCKT_SEND_SIZE_) i,
MSG_NOSIGNAL);
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if ( (0 > ret) && (MHD_SCKT_ERR_IS_EAGAIN_ (MHD_socket_get_error_ ())) )
{
/* Got EAGAIN --- no longer read-ready */
@@ -1128,7 +1128,7 @@
return ret;
}
err = MHD_socket_get_error_();
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if ( (0 > ret) && (MHD_SCKT_ERR_IS_EAGAIN_(err)) )
{
/* EAGAIN --- no longer write-ready */
@@ -1148,7 +1148,7 @@
#endif
ret = (ssize_t) send (connection->socket_fd, other, (MHD_SCKT_SEND_SIZE_)i,
MSG_NOSIGNAL);
err = MHD_socket_get_error_();
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if ( (0 > ret) && (MHD_SCKT_ERR_IS_EAGAIN_(err)) )
{
/* EAGAIN --- no longer write-ready */
@@ -1485,7 +1485,7 @@
"failed to signal new connection via pipe");
#endif
}
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY))
{
if (0 == (daemon->options & MHD_USE_EPOLL_TURBO))
@@ -1610,7 +1610,7 @@
DLL_insert (daemon->suspended_connections_head,
daemon->suspended_connections_tail,
connection);
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY))
{
if (0 != (connection->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
@@ -1728,7 +1728,7 @@
daemon->manual_timeout_tail,
pos);
}
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY))
{
if (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
@@ -1970,7 +1970,7 @@
&pos->socket_context,
MHD_CONNECTION_NOTIFY_CLOSED);
MHD_ip_limit_del (daemon, pos->addr, pos->addr_len);
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY))
{
if (0 != (pos->epoll_state & MHD_EPOLL_STATE_IN_EREADY_EDLL))
@@ -2152,7 +2152,7 @@
if (MHD_USE_SUSPEND_RESUME == (daemon->options & mask))
resume_suspended_connections (daemon);
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY))
{
/* we're in epoll mode, the epoll FD stands for
@@ -2583,7 +2583,7 @@
}
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
/**
* How many events to we process at most per epoll() call? Trade-off
@@ -2833,7 +2833,7 @@
MHD_poll (daemon, MHD_NO);
MHD_cleanup_connections (daemon);
}
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
else if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY))
{
MHD_epoll (daemon, MHD_NO);
@@ -2865,7 +2865,7 @@
{
if (0 != (daemon->options & MHD_USE_POLL))
MHD_poll (daemon, MHD_YES);
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
else if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY))
MHD_epoll (daemon, MHD_YES);
#endif
@@ -2972,7 +2972,7 @@
for (i = 0; i < daemon->worker_pool_size; i++)
{
daemon->worker_pool[i].socket_fd = MHD_INVALID_SOCKET;
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if ( (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) &&
(-1 != daemon->worker_pool[i].epoll_fd) &&
(MHD_YES == daemon->worker_pool[i].listen_socket_in_epoll) )
@@ -2993,7 +2993,7 @@
}
}
daemon->socket_fd = MHD_INVALID_SOCKET;
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if ( (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) &&
(-1 != daemon->epoll_fd) &&
(MHD_YES == daemon->listen_socket_in_epoll) )
@@ -3414,7 +3414,7 @@
}
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
/**
* Setup epoll() FD for the daemon and initialize it to listen
* on the listen FD.
@@ -3549,7 +3549,7 @@
if (NULL == (daemon = malloc (sizeof (struct MHD_Daemon))))
return NULL;
memset (daemon, 0, sizeof (struct MHD_Daemon));
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
daemon->epoll_fd = -1;
#endif
/* try to open listen socket */
@@ -3999,7 +3999,7 @@
goto free_and_fail;
}
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if ( (0 != (flags & MHD_USE_EPOLL_LINUX_ONLY)) &&
(0 == daemon->worker_pool_size) &&
(0 == (daemon->options & MHD_USE_NO_LISTEN_SOCKET)) )
@@ -4172,7 +4172,7 @@
d->connection_limit = conns_per_thread;
if (i < leftover_conns)
++d->connection_limit;
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if ( (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) &&
(MHD_YES != setup_epoll_to_listen (d)) )
goto thread_failed;
@@ -4242,7 +4242,7 @@
free_and_fail:
/* clean up basic memory state in 'daemon' and return NULL to
indicate failure */
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if (-1 != daemon->epoll_fd)
close (daemon->epoll_fd);
#endif
@@ -4362,7 +4362,7 @@
}
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
/**
* Shutdown epoll()-event loop by adding 'wpipe' to its event set.
*
@@ -4417,7 +4417,7 @@
{
daemon->worker_pool[i].shutdown = MHD_YES;
daemon->worker_pool[i].socket_fd = MHD_INVALID_SOCKET;
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if ( (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) &&
(-1 != daemon->worker_pool[i].epoll_fd) &&
(MHD_INVALID_SOCKET == fd) )
@@ -4439,7 +4439,7 @@
(void) shutdown (fd, SHUT_RDWR);
}
#endif
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if ( (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) &&
(-1 != daemon->epoll_fd) &&
(MHD_INVALID_SOCKET == fd) )
@@ -4469,7 +4469,7 @@
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);
-#if EPOLL_SUPPORT
+#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");
@@ -4520,7 +4520,7 @@
gnutls_certificate_free_credentials (daemon->x509_cred);
}
#endif
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if ( (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) &&
(-1 != daemon->epoll_fd) &&
(0 != MHD_socket_close_ (daemon->epoll_fd)) )
@@ -4569,7 +4569,7 @@
return NULL; /* no longer supported */
case MHD_DAEMON_INFO_LISTEN_FD:
return (const union MHD_DaemonInfo *) &daemon->socket_fd;
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
case MHD_DAEMON_INFO_EPOLL_FD_LINUX_ONLY:
return (const union MHD_DaemonInfo *) &daemon->epoll_fd;
#endif
@@ -4699,7 +4699,7 @@
return MHD_NO;
#endif
case MHD_FEATURE_EPOLL:
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
return MHD_YES;
#else
return MHD_NO;
Modified: libmicrohttpd/src/microhttpd/internal.h
===================================================================
--- libmicrohttpd/src/microhttpd/internal.h 2016-08-24 15:02:05 UTC (rev
37779)
+++ libmicrohttpd/src/microhttpd/internal.h 2016-08-24 15:02:10 UTC (rev
37780)
@@ -512,7 +512,7 @@
struct MHD_Connection
{
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
/**
* Next pointer for the EDLL listing connections that are epoll-ready.
*/
@@ -757,7 +757,7 @@
*/
int in_idle;
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
/**
* What is the state of this socket in relation to epoll?
*/
@@ -949,7 +949,7 @@
*/
struct MHD_Connection *cleanup_tail;
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
/**
* Head of EDLL of connections ready for processing (in epoll mode).
*/
@@ -1133,7 +1133,7 @@
*/
int listening_address_reuse;
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
/**
* File descriptor associated with our epoll loop.
*/
Modified: libmicrohttpd/src/microhttpd/mhd_sockets.h
===================================================================
--- libmicrohttpd/src/microhttpd/mhd_sockets.h 2016-08-24 15:02:05 UTC (rev
37779)
+++ libmicrohttpd/src/microhttpd/mhd_sockets.h 2016-08-24 15:02:10 UTC (rev
37780)
@@ -85,7 +85,7 @@
# ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
# endif
-# if EPOLL_SUPPORT
+# ifdef EPOLL_SUPPORT
# include <sys/epoll.h>
# endif
# ifdef HAVE_NETINET_TCP_H
Modified: libmicrohttpd/src/testcurl/https/test_https_get_parallel.c
===================================================================
--- libmicrohttpd/src/testcurl/https/test_https_get_parallel.c 2016-08-24
15:02:05 UTC (rev 37779)
+++ libmicrohttpd/src/testcurl/https/test_https_get_parallel.c 2016-08-24
15:02:10 UTC (rev 37780)
@@ -147,7 +147,7 @@
if (curl_uses_nss_ssl() == 0)
aes256_sha = "rsa_aes_256_sha";
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
errorCount +=
test_wrap ("single threaded daemon, single client, epoll",
&test_single_client,
NULL,
@@ -163,7 +163,7 @@
aes256_sha, CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY,
srv_key_pem, MHD_OPTION_HTTPS_MEM_CERT,
srv_self_signed_cert_pem, MHD_OPTION_END);
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
errorCount +=
test_wrap ("single threaded daemon, parallel clients, epoll",
&test_parallel_clients, NULL,
Modified: libmicrohttpd/src/testcurl/https/test_https_get_select.c
===================================================================
--- libmicrohttpd/src/testcurl/https/test_https_get_select.c 2016-08-24
15:02:05 UTC (rev 37779)
+++ libmicrohttpd/src/testcurl/https/test_https_get_select.c 2016-08-24
15:02:10 UTC (rev 37780)
@@ -223,7 +223,7 @@
fprintf (stderr, "Error: %s\n", strerror (errno));
return -1;
}
-#if EPOLL_SUPPORT
+#ifdef EPOLL_SUPPORT
if (0 != (errorCount = testExternalGet (MHD_USE_EPOLL_LINUX_ONLY)))
fprintf (stderr, "Fail: %d\n", errorCount);
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37780 - in libmicrohttpd: . src/examples src/microhttpd src/testcurl/https,
gnunet <=