gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated (a6ea76af -> 295a4884


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (a6ea76af -> 295a4884)
Date: Sun, 08 Jan 2017 21:48:06 +0100

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from a6ea76af connection->tls_read_ready: use 'true'/'false' instead of 
'!0'/'0'
     new eee0b9ad Fixed regression introduced by 
f3b0eb539e8a0e87745dc53eabe507b98f1864b6
     new 295a4884 thread_main_connection_upgrade(): process data from TLS 
buffers

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/connection.c |  2 +-
 src/microhttpd/daemon.c     | 29 +++++++++++++++++++++++------
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 23fde229..abcf3fa0 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3111,7 +3111,7 @@ MHD_connection_handle_idle (struct MHD_Connection 
*connection)
           /* no default action */
           break;
         case MHD_CONNECTION_FOOTERS_SENT:
-         if (MHD_HTTP_PROCESSING == connection->response->status_code)
+         if (MHD_HTTP_PROCESSING == connection->responseCode)
          {
            /* After this type of response, we allow sending another! */
            connection->state = MHD_CONNECTION_HEADERS_PROCESSED;
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 1e94f218..a6edd787 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1289,11 +1289,23 @@ thread_main_connection_upgrade (struct MHD_Connection 
*con)
               break;
             }
           if (MHD_INVALID_SOCKET != max_fd)
-            num_ready = MHD_SYS_select_ (max_fd + 1,
-                                         &rs,
-                                         &ws,
-                                         NULL,
-                                         NULL);
+            {
+              struct timeval* tvp;
+              struct timeval tv;
+              if (con->tls_read_ready)
+                { /* No need to wait if incoming data is already pending in 
TLS buffers. */
+                  tv.tv_sec = 0;
+                  tv.tv_usec = 0;
+                  tvp = &tv;
+                }
+              else
+                tvp = NULL;
+              num_ready = MHD_SYS_select_ (max_fd + 1,
+                                           &rs,
+                                           &ws,
+                                           NULL,
+                                           tvp);
+            }
           else
             num_ready = 0;
           if (num_ready < 0)
@@ -1325,12 +1337,12 @@ thread_main_connection_upgrade (struct MHD_Connection 
*con)
   else if (0 != (daemon->options & MHD_USE_TLS))
     {
       /* use poll() */
-      const unsigned int timeout = UINT_MAX;
 
       while ( (MHD_CONNECTION_UPGRADE == con->state) ||
               (0 != urh->out_buffer_used) )
         {
           struct pollfd p[2];
+          unsigned int timeout;
 
           memset (p,
                   0,
@@ -1346,6 +1358,11 @@ thread_main_connection_upgrade (struct MHD_Connection 
*con)
           if (0 != urh->in_buffer_used)
             p[1].events |= POLLOUT;
 
+          if (con->tls_read_ready)
+            timeout = 0; /* No need to wait if incoming data is already 
pending in TLS buffers. */
+          else
+            timeout = UINT_MAX;
+
           if ( (0 != (p[0].events | p[1].events)) &&
                (MHD_sys_poll_ (p,
                                2,

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



reply via email to

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