Explorar el Código

Fix using select()/poll() loop when MHD compiled with HTTPS, but upgraded connection is HTTP

Evgeny Grin (Karlson2k) hace 9 años
padre
commit
f2426d2b0f
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      src/microhttpd/daemon.c

+ 3 - 2
src/microhttpd/daemon.c

@@ -1133,7 +1133,8 @@ thread_main_connection_upgrade (struct MHD_Connection *con)
   /* Here, we need to bi-directionally forward
      until the application tells us that it is done
      with the socket; */
-  if (0 == (daemon->options & MHD_USE_POLL))
+  if ( (0 != (daemon->options & MHD_USE_SSL)) &&
+      (0 == (daemon->options & MHD_USE_POLL)))
     {
       while (MHD_CONNECTION_UPGRADE == con->state)
         {
@@ -1192,7 +1193,7 @@ thread_main_connection_upgrade (struct MHD_Connection *con)
         }
     }
 #ifdef HAVE_POLL
-  else
+  else if (0 != (daemon->options & MHD_USE_SSL))
     {
       /* use poll() */
       const unsigned int timeout = UINT_MAX;