gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated (5bdb60b9 -> 21ce9bfa


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (5bdb60b9 -> 21ce9bfa)
Date: Sun, 29 Oct 2017 21:36:41 +0100

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 5bdb60b9 daemon.c: refactoring of MHD_start_daemon_va() for clarity 
and readability. Some asserts were added.
     new a4320556 daemon.c: refactoring of MHD_stop_daemon() for clarity and 
readability. Added some asserts.
     new 21ce9bfa Make testsuite compatible with W32 again

The 2 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:
 src/microhttpd/daemon.c                    | 198 ++++++++++++++---------------
 src/testcurl/https/test_empty_response.c   |   8 +-
 src/testcurl/https/test_https_get_select.c |   8 +-
 src/testcurl/perf_get.c                    |   6 +
 src/testcurl/perf_get_concurrent.c         |  18 ++-
 src/testcurl/test_callback.c               |  10 +-
 src/testcurl/test_delete.c                 |  10 +-
 src/testcurl/test_get.c                    |   6 +
 src/testcurl/test_get_chunked.c            |   6 +
 src/testcurl/test_get_sendfile.c           |   6 +
 src/testcurl/test_large_put.c              |   6 +
 src/testcurl/test_parse_cookies.c          |   6 +
 src/testcurl/test_post.c                   |   6 +
 src/testcurl/test_postform.c               |   6 +
 src/testcurl/test_process_arguments.c      |   6 +
 src/testcurl/test_process_headers.c        |   6 +
 src/testcurl/test_put.c                    |   6 +
 src/testcurl/test_put_chunked.c            |   6 +
 src/testcurl/test_quiesce.c                |  12 ++
 19 files changed, 225 insertions(+), 111 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 81ed33af..7b651259 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2666,7 +2666,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
   struct MHD_Connection *prev = NULL;
   int ret;
   const bool used_thr_p_c = (0 != (daemon->options & 
MHD_USE_THREAD_PER_CONNECTION));
-  assert (NULL == daemon->worker_pool);
+  mhd_assert (NULL == daemon->worker_pool);
 
   ret = MHD_NO;
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
@@ -6089,7 +6089,8 @@ close_all_connections (struct MHD_Daemon *daemon)
   struct MHD_UpgradeResponseHandle *urhn;
   const bool used_tls = (0 != (daemon->options & MHD_USE_TLS));
 
-  assert (NULL == daemon->worker_pool);
+  mhd_assert (NULL == daemon->worker_pool);
+  mhd_assert (daemon->shutdown);
   /* give upgraded HTTPS connections a chance to finish */
   /* 'daemon->urh_head' is not used in thread-per-connection mode. */
   for (urh = daemon->urh_tail; NULL != urh; urh = urhn)
@@ -6232,129 +6233,126 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
   if (NULL == daemon)
     return;
 
-  if ( (0 != (MHD_TEST_ALLOW_SUSPEND_RESUME & daemon->options)) &&
-       (NULL == daemon->worker_pool) )
-    resume_suspended_connections (daemon);
-
   daemon->shutdown = true;
-  fd = daemon->listen_fd;
+  if (daemon->was_quiesced)
+    fd = MHD_INVALID_SOCKET; /* Do not use FD if daemon was quiesced */
+  else
+    fd = daemon->listen_fd;
 
-  if (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))
+  if (MHD_INVALID_SOCKET != fd)
     {
-      /* Separate thread(s) is used for select()/poll()/etc. */
-      if (NULL != daemon->worker_pool)
+      (void) shutdown (fd,
+                       SHUT_RDWR);
+    }
+
+  if (NULL != daemon->worker_pool)
+    { /* Master daemon with worker pool. */
+      mhd_assert (1 < daemon->worker_pool_size);
+      mhd_assert (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD));
+
+      /* Let workers shutdown in parallel. */
+      for (i = 0; i < daemon->worker_pool_size; ++i)
         {
-          /* Pool of workers is used.  */
-          /* Initiate shutdown process in wokers. */
-          for (i = 0; i < daemon->worker_pool_size; ++i)
+          daemon->worker_pool[i].shutdown = true;
+          if (MHD_ITC_IS_VALID_(daemon->worker_pool[i].itc))
             {
-              daemon->worker_pool[i].shutdown = true;
-              if (MHD_ITC_IS_VALID_(daemon->worker_pool[i].itc))
-                {
-                  if (! MHD_itc_activate_ (daemon->worker_pool[i].itc, "e"))
-                    MHD_PANIC (_("Failed to signal shutdown via inter-thread 
communication channel."));
-                }
-#ifdef HAVE_LISTEN_SHUTDOWN
-              else if (MHD_INVALID_SOCKET != fd)
-                {
-                  /* fd might be MHD_INVALID_SOCKET here due to 
'MHD_quiesce_daemon' */
-                  /* No problem if shutdown will be called several times for 
the same socket. */
-                    (void) shutdown (fd,
-                                     SHUT_RDWR);
-                }
-#endif
+              if (! MHD_itc_activate_ (daemon->worker_pool[i].itc, "e"))
+                MHD_PANIC (_("Failed to signal shutdown via inter-thread 
communication channel."));
             }
-          /* Start harvesting. */
-          for (i = 0; i < daemon->worker_pool_size; ++i)
-            {
-              if (! MHD_join_thread_ (daemon->worker_pool[i].pid.handle))
-                MHD_PANIC (_("Failed to join a thread\n"));
+          else
+            mhd_assert (MHD_INVALID_SOCKET != fd);
+        }
+      for (i = 0; i < daemon->worker_pool_size; ++i)
+        {
+          MHD_stop_daemon (&daemon->worker_pool[i]);
+        }
+      free (daemon->worker_pool);
+      mhd_assert (MHD_ITC_IS_INVALID_(daemon->itc));
 #ifdef EPOLL_SUPPORT
-              if (-1 != daemon->worker_pool[i].epoll_fd)
-                MHD_fd_close_chk_ (daemon->worker_pool[i].epoll_fd);
+      mhd_assert (-1 == daemon->epoll_fd);
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
-              if (-1 != daemon->worker_pool[i].epoll_upgrade_fd)
-                MHD_fd_close_chk_ (daemon->worker_pool[i].epoll_upgrade_fd);
+      mhd_assert (-1 == daemon->epoll_upgrade_fd);
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
-#endif
-              if (MHD_ITC_IS_VALID_ (daemon->worker_pool[i].itc) )
-                MHD_itc_destroy_chk_ (daemon->worker_pool[i].itc);
-              MHD_mutex_destroy_chk_ 
(&daemon->worker_pool[i].cleanup_connection_mutex);
+#endif /* EPOLL_SUPPORT */
+    }
+  else
+    { /* Worker daemon or single daemon. */
+      if (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))
+        { /* Worker daemon or single daemon with internal thread(s). */
+          mhd_assert (0 == daemon->worker_pool_size);
+          if (0 != (MHD_TEST_ALLOW_SUSPEND_RESUME & daemon->options))
+            resume_suspended_connections (daemon);
+
+          if (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))
+            {
+              /* Separate thread(s) is used for polling sockets. */
+              if (MHD_ITC_IS_VALID_(daemon->itc))
+                {
+                  if (! MHD_itc_activate_ (daemon->itc, "e"))
+                    MHD_PANIC (_("Failed to signal shutdown via inter-thread 
communication channel"));
+                }
+              else
+                mhd_assert (MHD_INVALID_SOCKET != fd);
+
+              if (! MHD_join_thread_ (daemon->pid.handle))
+                {
+                  MHD_PANIC (_("Failed to join a thread\n"));
+                }
+              /* close_all_connections() was called in daemon thread. */
             }
-          free (daemon->worker_pool);
         }
       else
         {
-          /* Single internal thread is used for select()/poll()/etc. */
-          if (MHD_ITC_IS_VALID_(daemon->itc))
-            {
-              if (! MHD_itc_activate_ (daemon->itc, "e"))
-                MHD_PANIC (_("Failed to signal shutdown via inter-thread 
communication channel"));
-            }
-#ifdef HAVE_LISTEN_SHUTDOWN
-          else
-            {
-              /* fd might be MHD_INVALID_SOCKET here due to 
'MHD_quiesce_daemon' */
-              if ( (MHD_INVALID_SOCKET != fd) &&
-                   (! daemon->was_quiesced) )
-                (void) shutdown (fd,
-                                 SHUT_RDWR);
-            }
-#endif
-          if (! MHD_join_thread_ (daemon->pid.handle))
-            {
-              MHD_PANIC (_("Failed to join a thread\n"));
-            }
+          /* Internal threads are not used polling sockets. */
+          close_all_connections (daemon);
         }
-    }
-  else
-    {
-      /* Internal threads are not used for select()/poll()/etc. */
-      close_all_connections (daemon);
-    }
-
-  if ( (MHD_INVALID_SOCKET != fd) &&
-       (! daemon->was_quiesced) )
-    MHD_socket_close_chk_ (fd);
-
-  if (MHD_ITC_IS_VALID_ (daemon->itc))
-    MHD_itc_destroy_chk_ (daemon->itc);
+      if (MHD_ITC_IS_VALID_ (daemon->itc))
+        MHD_itc_destroy_chk_ (daemon->itc);
 
 #ifdef EPOLL_SUPPORT
-  if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
-       (-1 != daemon->epoll_fd) )
-    MHD_socket_close_chk_ (daemon->epoll_fd);
+      if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
+           (-1 != daemon->epoll_fd) )
+        MHD_socket_close_chk_ (daemon->epoll_fd);
 #if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
-  if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
-       (-1 != daemon->epoll_upgrade_fd) )
-    MHD_socket_close_chk_ (daemon->epoll_upgrade_fd);
+      if ( (0 != (daemon->options & MHD_USE_EPOLL)) &&
+           (-1 != daemon->epoll_upgrade_fd) )
+        MHD_socket_close_chk_ (daemon->epoll_upgrade_fd);
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
-#endif
+#endif /* EPOLL_SUPPORT */
 
-  /* TLS clean up */
-#ifdef HTTPS_SUPPORT
-  if (daemon->have_dhparams)
-    {
-      gnutls_dh_params_deinit (daemon->https_mem_dhparams);
-      daemon->have_dhparams = false;
-    }
-  if (0 != (daemon->options & MHD_USE_TLS))
-    {
-      gnutls_priority_deinit (daemon->priority_cache);
-      if (daemon->x509_cred)
-        gnutls_certificate_free_credentials (daemon->x509_cred);
+      MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
     }
+
+  if (NULL == daemon->master)
+    { /* Cleanup that should be done only one time in master/single daemon.
+       * Do not perform this cleanup in worker daemons. */
+
+      if (MHD_INVALID_SOCKET != fd)
+        MHD_socket_close_chk_ (fd);
+
+      /* TLS clean up */
+#ifdef HTTPS_SUPPORT
+      if (daemon->have_dhparams)
+        {
+          gnutls_dh_params_deinit (daemon->https_mem_dhparams);
+          daemon->have_dhparams = false;
+        }
+      if (0 != (daemon->options & MHD_USE_TLS))
+        {
+          gnutls_priority_deinit (daemon->priority_cache);
+          if (daemon->x509_cred)
+            gnutls_certificate_free_credentials (daemon->x509_cred);
+        }
 #endif /* HTTPS_SUPPORT */
 
 #ifdef DAUTH_SUPPORT
-  free (daemon->nnc);
-  MHD_mutex_destroy_chk_ (&daemon->nnc_lock);
+      free (daemon->nnc);
+      MHD_mutex_destroy_chk_ (&daemon->nnc_lock);
 #endif
-  MHD_mutex_destroy_chk_ (&daemon->per_ip_connection_mutex);
-  if (NULL != daemon->worker_pool)
-    MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
+      MHD_mutex_destroy_chk_ (&daemon->per_ip_connection_mutex);
 
-  free (daemon);
+      free (daemon);
+    }
 }
 
 
diff --git a/src/testcurl/https/test_empty_response.c 
b/src/testcurl/https/test_empty_response.c
index 70baf832..09da489d 100644
--- a/src/testcurl/https/test_empty_response.c
+++ b/src/testcurl/https/test_empty_response.c
@@ -172,10 +172,16 @@ testInternalSelectGet ()
             {
 #ifdef MHD_POSIX_SOCKETS
               if (EINTR != errno)
-#endif /* MHD_POSIX_SOCKETS */
                 abort ();
+#else
+              if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+                abort ();
+              Sleep (1000);
+#endif
             }
         }
+      else
+        sleep (1000);
       curl_multi_perform (multi, &running);
       if (running == 0)
         {
diff --git a/src/testcurl/https/test_https_get_select.c 
b/src/testcurl/https/test_https_get_select.c
index df19396e..f76fbad0 100644
--- a/src/testcurl/https/test_https_get_select.c
+++ b/src/testcurl/https/test_https_get_select.c
@@ -198,10 +198,16 @@ testExternalGet (int flags)
             {
 #ifdef MHD_POSIX_SOCKETS
               if (EINTR != errno)
-#endif /* MHD_POSIX_SOCKETS */
                 abort ();
+#else
+              if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+                abort ();
+              Sleep (1000);
+#endif
             }
         }
+      else
+        sleep (1000);
       curl_multi_perform (multi, &running);
       if (running == 0)
         {
diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c
index 8e5902d8..d7ddc0e2 100644
--- a/src/testcurl/perf_get.c
+++ b/src/testcurl/perf_get.c
@@ -497,8 +497,14 @@ testExternalGet (int port)
          tv.tv_usec = 1000;
          if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
             {
+#ifdef MHD_POSIX_SOCKETS
               if (EINTR != errno)
                 abort ();
+#else
+              if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+                abort ();
+              Sleep (1000);
+#endif
             }
          curl_multi_perform (multi, &running);
          if (running == 0)
diff --git a/src/testcurl/perf_get_concurrent.c 
b/src/testcurl/perf_get_concurrent.c
index d4bbf753..d234b720 100644
--- a/src/testcurl/perf_get_concurrent.c
+++ b/src/testcurl/perf_get_concurrent.c
@@ -416,11 +416,19 @@ testExternalGet (int port)
       tv.tv_usec = 1000 * (tt % 1000);
       if (-1 == select (max + 1, &rs, &ws, &es, &tv))
        {
-         if (EINTR == errno)
-           continue;
-         fprintf (stderr,
-                  "select failed: %s\n",
-                  strerror (errno));
+#ifdef MHD_POSIX_SOCKETS
+          if (EINTR == errno)
+            continue;
+          fprintf (stderr,
+                   "select failed: %s\n",
+                   strerror (errno));
+#else
+          if (WSAEINVAL == WSAGetLastError() && 0 == rs.fd_count && 0 == 
ws.fd_count && 0 == es.fd_count)
+            {
+              Sleep (1000);
+              continue;
+            }
+#endif
          ret |= 1024;
          break;
        }
diff --git a/src/testcurl/test_callback.c b/src/testcurl/test_callback.c
index 9c9e125f..b7dc9fe8 100644
--- a/src/testcurl/test_callback.c
+++ b/src/testcurl/test_callback.c
@@ -199,8 +199,14 @@ main(int argc, char **argv)
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
-          if (EINTR != errno)
-            abort ();
+#ifdef MHD_POSIX_SOCKETS
+              if (EINTR != errno)
+                abort ();
+#else
+              if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+                abort ();
+              Sleep (1000);
+#endif
         }
       if (NULL != multi)
        {
diff --git a/src/testcurl/test_delete.c b/src/testcurl/test_delete.c
index 513a5ebd..1b4b8db0 100644
--- a/src/testcurl/test_delete.c
+++ b/src/testcurl/test_delete.c
@@ -454,8 +454,14 @@ testExternalDelete ()
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
-          if (EINTR != errno)
-            abort ();
+#ifdef MHD_POSIX_SOCKETS
+              if (EINTR != errno)
+                abort ();
+#else
+              if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+                abort ();
+              Sleep (1000);
+#endif
         }
       curl_multi_perform (multi, &running);
       if (running == 0)
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c
index bc7f5fb5..2b4089e1 100644
--- a/src/testcurl/test_get.c
+++ b/src/testcurl/test_get.c
@@ -428,8 +428,14 @@ testExternalGet ()
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
+#ifdef MHD_POSIX_SOCKETS
           if (EINTR != errno)
             abort ();
+#else
+          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+            abort ();
+          Sleep (1000);
+#endif
         }
       curl_multi_perform (multi, &running);
       if (running == 0)
diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c
index 2c6ec2d4..f698907c 100644
--- a/src/testcurl/test_get_chunked.c
+++ b/src/testcurl/test_get_chunked.c
@@ -450,8 +450,14 @@ testExternalGet ()
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
+#ifdef MHD_POSIX_SOCKETS
           if (EINTR != errno)
             abort ();
+#else
+          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+            abort ();
+          Sleep (1000);
+#endif
         }
       curl_multi_perform (multi, &running);
       if (running == 0)
diff --git a/src/testcurl/test_get_sendfile.c b/src/testcurl/test_get_sendfile.c
index 652423d4..de51e1d0 100644
--- a/src/testcurl/test_get_sendfile.c
+++ b/src/testcurl/test_get_sendfile.c
@@ -433,8 +433,14 @@ testExternalGet ()
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
+#ifdef MHD_POSIX_SOCKETS
           if (EINTR != errno)
             abort ();
+#else
+          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+            abort ();
+          Sleep (1000);
+#endif
         }
       curl_multi_perform (multi, &running);
       if (running == 0)
diff --git a/src/testcurl/test_large_put.c b/src/testcurl/test_large_put.c
index c6b3ae27..4dc16319 100644
--- a/src/testcurl/test_large_put.c
+++ b/src/testcurl/test_large_put.c
@@ -540,8 +540,14 @@ testPutExternal (void)
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
+#ifdef MHD_POSIX_SOCKETS
           if (EINTR != errno)
             abort ();
+#else
+          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+            abort ();
+          Sleep (1000);
+#endif
         }
       curl_multi_perform (multi, &running);
       if (running == 0)
diff --git a/src/testcurl/test_parse_cookies.c 
b/src/testcurl/test_parse_cookies.c
index d04815d5..a406bd32 100644
--- a/src/testcurl/test_parse_cookies.c
+++ b/src/testcurl/test_parse_cookies.c
@@ -221,8 +221,14 @@ testExternalGet ()
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
+#ifdef MHD_POSIX_SOCKETS
           if (EINTR != errno)
             abort ();
+#else
+          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+            abort ();
+          Sleep (1000);
+#endif
         }
       curl_multi_perform (multi, &running);
       if (running == 0)
diff --git a/src/testcurl/test_post.c b/src/testcurl/test_post.c
index 41d219fa..91da9362 100644
--- a/src/testcurl/test_post.c
+++ b/src/testcurl/test_post.c
@@ -495,8 +495,14 @@ testExternalPost ()
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
+#ifdef MHD_POSIX_SOCKETS
           if (EINTR != errno)
             abort ();
+#else
+          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+            abort ();
+          Sleep (1000);
+#endif
         }
       curl_multi_perform (multi, &running);
       if (running == 0)
diff --git a/src/testcurl/test_postform.c b/src/testcurl/test_postform.c
index 9e771da9..cbb46413 100644
--- a/src/testcurl/test_postform.c
+++ b/src/testcurl/test_postform.c
@@ -519,8 +519,14 @@ testExternalPost ()
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
+#ifdef MHD_POSIX_SOCKETS
           if (EINTR != errno)
             abort ();
+#else
+          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+            abort ();
+          Sleep (1000);
+#endif
         }
       curl_multi_perform (multi, &running);
       if (running == 0)
diff --git a/src/testcurl/test_process_arguments.c 
b/src/testcurl/test_process_arguments.c
index def5cd98..32200229 100644
--- a/src/testcurl/test_process_arguments.c
+++ b/src/testcurl/test_process_arguments.c
@@ -221,8 +221,14 @@ testExternalGet ()
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
+#ifdef MHD_POSIX_SOCKETS
           if (EINTR != errno)
             abort ();
+#else
+          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+            abort ();
+          Sleep (1000);
+#endif
         }
       curl_multi_perform (multi, &running);
       if (running == 0)
diff --git a/src/testcurl/test_process_headers.c 
b/src/testcurl/test_process_headers.c
index db4aeb75..50d40839 100644
--- a/src/testcurl/test_process_headers.c
+++ b/src/testcurl/test_process_headers.c
@@ -464,8 +464,14 @@ testExternalGet ()
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
+#ifdef MHD_POSIX_SOCKETS
           if (EINTR != errno)
             abort ();
+#else
+          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+            abort ();
+          Sleep (1000);
+#endif
         }
       curl_multi_perform (multi, &running);
       if (running == 0)
diff --git a/src/testcurl/test_put.c b/src/testcurl/test_put.c
index f448c408..11768be8 100644
--- a/src/testcurl/test_put.c
+++ b/src/testcurl/test_put.c
@@ -465,8 +465,14 @@ curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
+#ifdef MHD_POSIX_SOCKETS
           if (EINTR != errno)
             abort ();
+#else
+          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+            abort ();
+          Sleep (1000);
+#endif
         }
       curl_multi_perform (multi, &running);
       if (running == 0)
diff --git a/src/testcurl/test_put_chunked.c b/src/testcurl/test_put_chunked.c
index b7a7537c..f4c60aab 100644
--- a/src/testcurl/test_put_chunked.c
+++ b/src/testcurl/test_put_chunked.c
@@ -459,8 +459,14 @@ testExternalPut ()
       tv.tv_usec = 1000;
       if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
         {
+#ifdef MHD_POSIX_SOCKETS
           if (EINTR != errno)
             abort ();
+#else
+          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+            abort ();
+          Sleep (1000);
+#endif
         }
       curl_multi_perform (multi, &running);
       if (running == 0)
diff --git a/src/testcurl/test_quiesce.c b/src/testcurl/test_quiesce.c
index 59eea2d0..0063606f 100644
--- a/src/testcurl/test_quiesce.c
+++ b/src/testcurl/test_quiesce.c
@@ -151,8 +151,14 @@ ServeOneRequest(void *param)
       tv.tv_usec = 1000;
       if (-1 == MHD_SYS_select_ (max + 1, &rs, &ws, &es, &tv))
         {
+#ifdef MHD_POSIX_SOCKETS
           if (EINTR != errno)
             abort ();
+#else
+          if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+            abort ();
+          Sleep (1000);
+#endif
         }
       MHD_run (d);
     }
@@ -432,8 +438,14 @@ testExternalGet ()
           tv.tv_usec = 1000;
           if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
             {
+#ifdef MHD_POSIX_SOCKETS
               if (EINTR != errno)
                 abort ();
+#else
+              if (WSAEINVAL != WSAGetLastError() || 0 != rs.fd_count || 0 != 
ws.fd_count || 0 != es.fd_count)
+                abort ();
+              Sleep (1000);
+#endif
             }
           curl_multi_perform (multi, &running);
           if (0 == running)

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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