gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (8f9567bb -> a8423ab8)


From: gnunet
Subject: [libmicrohttpd] branch master updated (8f9567bb -> a8423ab8)
Date: Wed, 01 Dec 2021 13:04:32 +0100

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 8f9567bb test_client_put_stop: Use longer timeout periods for select()
     new e910727d Partial revert of 8f9567bb48387cd9d95e5d30914f945b106d2ee4
     new 3fddf35b test_client_put_stop: improved readability of the test results
     new c6ba7ba2 test_client_put_stop: limit total test time
     new 06476807 test_client_put_stop: cosmetics
     new e87044f7 configure: header detection fixes
     new a8423ab8 configure: do header detection before other checks

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 configure.ac                          | 79 +++++++++++++++++++++++++----------
 src/microhttpd/test_client_put_stop.c | 48 ++++++++++++---------
 2 files changed, 84 insertions(+), 43 deletions(-)

diff --git a/configure.ac b/configure.ac
index d0e957f6..ca403875 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,6 +79,62 @@ MHD_SYS_EXT
 LT_INIT([win32-dll])
 LT_LANG([Windows Resource])
 
+# Check for headers that are ALWAYS required
+AC_CHECK_HEADERS_ONCE([stdio.h string.h stdint.h errno.h limits.h fcntl.h], [],
+  [AC_MSG_ERROR([Compiling libmicrohttpd requires standard POSIX headers 
files])], [AC_INCLUDES_DEFAULT])
+
+# Check for basic optional headers
+AC_CHECK_HEADERS([stddef.h stdlib.h inttypes.h sys/types.h sys/stat.h 
unistd.h], [], [], [AC_INCLUDES_DEFAULT])
+
+# Check for clock-specific optional headers
+AC_CHECK_HEADERS([sys/time.h time.h], [], [], [AC_INCLUDES_DEFAULT])
+
+# Check for system information and parameters optional headers
+AC_CHECK_HEADERS([endian.h machine/endian.h sys/endian.h sys/byteorder.h \
+                  sys/machine.h machine/param.h sys/param.h sys/isa_defs.h \
+                  sys/ioctl.h], [], [], [AC_INCLUDES_DEFAULT])
+
+# Check for network and sockets optional headers
+AC_CHECK_HEADERS([sys/socket.h sys/select.h netinet/in.h arpa/inet.h \
+                  netinet/ip.h netinet/tcp.h net/if.h \
+                  netdb.h sockLib.h inetLib.h], [], [],
+  [AC_INCLUDES_DEFAULT
+   [
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif /* HAVE_INTTYPES_H */
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif /* HAVE_SYS_SOCKET_H */
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif /* HAVE_NETINET_IN_H */
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif /* HAVE_NETINET_IP_H */
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif /* HAVE_NETINET_TCP_H */
+  ]]
+)
+
+# Check for other optional headers
+AC_CHECK_HEADERS([sys/msg.h sys/mman.h signal.h], [], [], 
[AC_INCLUDES_DEFAULT])
+
+AC_CHECK_HEADER([[search.h]],
+  [
+   gl_FUNC_TSEARCH
+   AS_IF([[test "x$HAVE_TSEARCH" = "x1" && test "x$REPLACE_TSEARCH" != "x1"]],
+     [AC_DEFINE([[HAVE_SEARCH_H]], [[1]],
+       [Define to 1 if you have the <search.h> header file and your system 
have properly functioning tsearch(), tfind() and tdelete() functions])])
+  ],
+  [], [AC_INCLUDES_DEFAULT])
+
+AM_CONDITIONAL([MHD_HAVE_TSEARCH], [[test "x$ac_cv_header_search_h" = xyes && 
test "x$HAVE_TSEARCH" = "x1" && test "x$REPLACE_TSEARCH" != "x1"]])
+
 # Checks for gettext.
 m4_ifdef([AM_GNU_GETTEXT], [
   AS_VAR_SET_IF([enable_nls], [], [[enable_nls=no]])
@@ -1094,29 +1150,6 @@ fd = epoll_create1(EPOLL_CLOEXEC);]])],
   AS_IF([test "x$mhd_cv_have_epoll_create1" = "xyes"],[
     AC_DEFINE([[HAVE_EPOLL_CREATE1]], [[1]], [Define if you have epoll_create1 
function.])]))
 
-# Check for headers that are ALWAYS required
-AC_CHECK_HEADERS_ONCE([fcntl.h errno.h limits.h stdio.h stdint.h], [],
-  [AC_MSG_ERROR([Compiling libmicrohttpd requires standard UNIX headers 
files])], [AC_INCLUDES_DEFAULT])
-
-# Check for optional headers
-AC_CHECK_HEADERS([sys/types.h sys/time.h sys/msg.h time.h sys/mman.h 
sys/ioctl.h \
-  sys/socket.h sys/select.h netdb.h netinet/in.h netinet/ip.h netinet/tcp.h 
arpa/inet.h \
-  endian.h machine/endian.h sys/endian.h sys/param.h sys/machine.h 
sys/byteorder.h machine/param.h sys/isa_defs.h \
-  signal.h sys/stat.h \
-  inttypes.h stddef.h stdlib.h unistd.h \
-  sockLib.h inetLib.h net/if.h], [], [], [AC_INCLUDES_DEFAULT])
-
-AC_CHECK_HEADER([[search.h]],
-  [
-   gl_FUNC_TSEARCH
-   AS_IF([[test "x$HAVE_TSEARCH" = "x1" && test "x$REPLACE_TSEARCH" != "x1"]],
-     [AC_DEFINE([[HAVE_SEARCH_H]], [[1]],
-       [Define to 1 if you have the <search.h> header file and your system 
have properly functioning tsearch(), tfind() and tdelete() functions])])
-  ],
-  [], [AC_INCLUDES_DEFAULT])
-
-AM_CONDITIONAL([MHD_HAVE_TSEARCH], [[test "x$ac_cv_header_search_h" = xyes && 
test "x$HAVE_TSEARCH" = "x1" && test "x$REPLACE_TSEARCH" != "x1"]])
-
 AC_CACHE_CHECK([for suported 'noreturn' keyword], [mhd_cv_decl_noreturn],
   [
     mhd_cv_decl_noreturn="none"
diff --git a/src/microhttpd/test_client_put_stop.c 
b/src/microhttpd/test_client_put_stop.c
index 434ff1f0..4a6cade0 100644
--- a/src/microhttpd/test_client_put_stop.c
+++ b/src/microhttpd/test_client_put_stop.c
@@ -825,7 +825,7 @@ _MHD_dumbClient_perform (struct _MHD_dumbClient *clnt)
       _MHD_dumbClient_get_fdsets (clnt, &maxMhdSk, &rs, &ws, &es);
       mhd_assert (now >= start);
       tv.tv_sec = TIMEOUTS_VAL - (now - start) + 1;
-      tv.tv_usec = 700 * 1000;
+      tv.tv_usec = 250 * 1000;
       if (-1 == select (maxMhdSk + 1, &rs, &ws, &es, &tv))
       {
 #ifdef MHD_POSIX_SOCKETS
@@ -1268,7 +1268,7 @@ performQueryExternal (struct MHD_Daemon *d, struct 
_MHD_dumbClient *clnt)
     if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxMhdSk))
       mhdErrorExitDesc ("MHD_get_fdset() failed");
     tv.tv_sec = 1;
-    tv.tv_usec = 800 * 1000;
+    tv.tv_usec = 250 * 1000;
     if (-1 == select (maxMhdSk + 1, &rs, &ws, &es, &tv))
     {
 #ifdef MHD_POSIX_SOCKETS
@@ -1322,7 +1322,7 @@ doClientQueryInThread (struct MHD_Daemon *d,
                              & MHD_USE_INTERNAL_POLLING_THREAD));
 
   if (0 == p->queryPort)
-    abort ();
+    externalErrorExit ();
 
   c = _MHD_dumbClient_create (p->queryPort, p->method, p->queryPath,
                               p->headers, p->req_body, p->req_body_size,
@@ -1399,6 +1399,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
                     struct sckt_notif_cb_param *sckt_result)
 {
   struct simpleQueryParams qParam;
+  time_t start;
   int ret = 0;          /* Return value */
   size_t req_total_size;
   size_t limit_send_size;
@@ -1440,6 +1441,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
                     MHD_REQUEST_TERMINATED_READ_ERROR :
                     MHD_REQUEST_TERMINATED_CLIENT_ABORT;
   found_right_reason = 0;
+  start = time (NULL);
   for (limit_send_size = 1; limit_send_size < req_total_size; 
limit_send_size++)
   {
     int test_succeed;
@@ -1498,6 +1500,12 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
                         &qParam, ahc_param, uri_cb_param,
                         term_result, sckt_result);
     }
+
+    if (time (NULL) - start > TIMEOUTS_VAL * 25)
+    {
+      ret |= 1 << 2;
+      fprintf (stderr, "FAILED: Test total time exceeded.\n");
+    }
   }
 
   MHD_stop_daemon (d);
@@ -1558,7 +1566,7 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
   const union MHD_DaemonInfo *dinfo;
 
   if ((NULL == ahc_param) || (NULL == uri_cb_param) || (NULL == term_result))
-    abort ();
+    externalErrorExit ();
 
   *ahc_param = (struct ahc_cls_type *) malloc (sizeof(struct ahc_cls_type));
   if (NULL == *ahc_param)
@@ -1624,19 +1632,13 @@ startTestMhdDaemon (enum testMhdThreadsType thrType,
                           MHD_OPTION_END);
 
   if (NULL == d)
-  {
-    fprintf (stderr, "Failed to start MHD daemon, errno=%d.\n", errno);
-    abort ();
-  }
+    mhdErrorExitDesc ("Failed to start MHD daemon");
 
   if (0 == *pport)
   {
     dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
-    if ((NULL == dinfo) || (0 == dinfo->port) )
-    {
-      fprintf (stderr, "MHD_get_daemon_info() failed.\n");
-      abort ();
-    }
+    if ((NULL == dinfo) || (0 == dinfo->port))
+      mhdErrorExitDesc ("MHD_get_daemon_info() failed");
     *pport = (int) dinfo->port;
     if (0 == global_port)
       global_port = *pport; /* Reuse the same port for all tests */
@@ -1751,7 +1753,7 @@ main (int argc, char *const *argv)
   global_port = 0;
   test_result = testExternalGet ();
   if (test_result)
-    fprintf (stderr, "FAILED: testExternalGet () - %u.\n", test_result);
+    fprintf (stderr, "FAILED: testExternalGet (). Result: %u.\n", test_result);
   else if (verbose)
     printf ("PASSED: testExternalGet ().\n");
   errorCount += test_result;
@@ -1760,7 +1762,8 @@ main (int argc, char *const *argv)
   {
     test_result = testInternalGet (testMhdPollAuto);
     if (test_result)
-      fprintf (stderr, "FAILED: testInternalGet (testMhdPollAuto) - %u.\n",
+      fprintf (stderr, "FAILED: testInternalGet (testMhdPollAuto). "
+               "Result: %u.\n",
                test_result);
     else if (verbose)
       printf ("PASSED: testInternalGet (testMhdPollBySelect).\n");
@@ -1770,7 +1773,8 @@ main (int argc, char *const *argv)
      * not really provide any additional results. */
     test_result = testInternalGet (testMhdPollBySelect);
     if (test_result)
-      fprintf (stderr, "FAILED: testInternalGet (testMhdPollBySelect) - %u.\n",
+      fprintf (stderr, "FAILED: testInternalGet (testMhdPollBySelect). "
+               "Result: %u.\n",
                test_result);
     else if (verbose)
       printf ("PASSED: testInternalGet (testMhdPollBySelect).\n");
@@ -1778,7 +1782,8 @@ main (int argc, char *const *argv)
     test_result = testMultithreadedPoolGet (testMhdPollBySelect);
     if (test_result)
       fprintf (stderr,
-               "FAILED: testMultithreadedPoolGet (testMhdPollBySelect) - 
%u.\n",
+               "FAILED: testMultithreadedPoolGet (testMhdPollBySelect). "
+               "Result: %u.\n",
                test_result);
     else if (verbose)
       printf ("PASSED: testMultithreadedPoolGet (testMhdPollBySelect).\n");
@@ -1786,7 +1791,8 @@ main (int argc, char *const *argv)
     test_result = testMultithreadedGet (testMhdPollBySelect);
     if (test_result)
       fprintf (stderr,
-               "FAILED: testMultithreadedGet (testMhdPollBySelect) - %u.\n",
+               "FAILED: testMultithreadedGet (testMhdPollBySelect). "
+               "Result: %u.\n",
                test_result);
     else if (verbose)
       printf ("PASSED: testMultithreadedGet (testMhdPollBySelect).\n");
@@ -1795,7 +1801,8 @@ main (int argc, char *const *argv)
     {
       test_result = testInternalGet (testMhdPollByPoll);
       if (test_result)
-        fprintf (stderr, "FAILED: testInternalGet (testMhdPollByPoll) - %u.\n",
+        fprintf (stderr, "FAILED: testInternalGet (testMhdPollByPoll). "
+                 "Result: %u.\n",
                  test_result);
       else if (verbose)
         printf ("PASSED: testInternalGet (testMhdPollByPoll).\n");
@@ -1805,7 +1812,8 @@ main (int argc, char *const *argv)
     {
       test_result = testInternalGet (testMhdPollByEpoll);
       if (test_result)
-        fprintf (stderr, "FAILED: testInternalGet (testMhdPollByEpoll) - 
%u.\n",
+        fprintf (stderr, "FAILED: testInternalGet (testMhdPollByEpoll). "
+                 "Result: %u.\n",
                  test_result);
       else if (verbose)
         printf ("PASSED: testInternalGet (testMhdPollByEpoll).\n");

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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