gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] GNU libmicrohttpd branch master updated. 69


From: gitolite
Subject: [GNUnet-SVN] [libmicrohttpd] GNU libmicrohttpd branch master updated. 69e753bce51bf54aff2304b16e64fb2918decf09
Date: Mon, 17 Oct 2016 22:42:41 +0200 (CEST)

The branch, master has been updated
       via  69e753bce51bf54aff2304b16e64fb2918decf09 (commit)
       via  7235e65f98c5fd8d937dca87ae1b1794ec3eee96 (commit)
      from  445c17837fb06fd2f173957fbac7b396f52f8ac4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 69e753bce51bf54aff2304b16e64fb2918decf09
Author: Evgeny Grin (Karlson2k) <address@hidden>
Date:   Mon Oct 17 23:41:02 2016 +0300

    process_urh(): use better variable names

commit 7235e65f98c5fd8d937dca87ae1b1794ec3eee96
Author: Evgeny Grin (Karlson2k) <address@hidden>
Date:   Mon Oct 17 21:02:16 2016 +0300

    MHD_cleanup_upgraded_connection_(): check pointer for NULL *before* 
dereferencing

-----------------------------------------------------------------------

Summary of changes:
 src/microhttpd/daemon.c | 43 ++++++++++++++++++++++---------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 4e3fbdf..be7c79a 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -923,7 +923,8 @@ MHD_cleanup_upgraded_connection_ (struct MHD_Connection 
*connection)
   struct MHD_UpgradeResponseHandle *urh = connection->urh;
 
 #if HTTPS_SUPPORT
-  if (0 != (daemon->options & MHD_USE_TLS))
+  if ( (NULL != urh) &&
+       (0 != (daemon->options & MHD_USE_TLS)) )
     {
       if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
         DLL_remove (daemon->urh_head,
@@ -1009,15 +1010,15 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
        (urh->in_buffer_off < urh->in_buffer_size) )
     {
       ssize_t res;
-      size_t rcv_size;
+      size_t buf_size;
 
-      rcv_size = urh->in_buffer_size - urh->in_buffer_off;
-      if (rcv_size > SSIZE_MAX)
-        rcv_size = SSIZE_MAX;
+      buf_size = urh->in_buffer_size - urh->in_buffer_off;
+      if (buf_size > SSIZE_MAX)
+        buf_size = SSIZE_MAX;
 
       res = gnutls_record_recv (urh->connection->tls_session,
                                 &urh->in_buffer[urh->in_buffer_off],
-                                rcv_size);
+                                buf_size);
       if ( (GNUTLS_E_AGAIN == res) ||
            (GNUTLS_E_INTERRUPTED == res) )
         {
@@ -1038,15 +1039,15 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
        (urh->in_buffer_off > 0) )
     {
       ssize_t res;
-      size_t snd_size;
+      size_t data_size;
 
-      snd_size = urh->in_buffer_off;
-      if (snd_size > MHD_SCKT_SEND_MAX_SIZE_)
-        snd_size = MHD_SCKT_SEND_MAX_SIZE_;
+      data_size = urh->in_buffer_off;
+      if (data_size > MHD_SCKT_SEND_MAX_SIZE_)
+        data_size = MHD_SCKT_SEND_MAX_SIZE_;
 
       res = MHD_send_ (urh->mhd.socket,
                        urh->in_buffer,
-                       snd_size);
+                       data_size);
       if (-1 == res)
         {
           int err = MHD_socket_get_error_ ();
@@ -1083,15 +1084,15 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
        (urh->out_buffer_off < urh->out_buffer_size) )
     {
       ssize_t res;
-      size_t rcv_size;
+      size_t buf_size;
 
-      rcv_size = urh->out_buffer_size - urh->out_buffer_off;
-      if (rcv_size > MHD_SCKT_SEND_MAX_SIZE_)
-        rcv_size = MHD_SCKT_SEND_MAX_SIZE_;
+      buf_size = urh->out_buffer_size - urh->out_buffer_off;
+      if (buf_size > MHD_SCKT_SEND_MAX_SIZE_)
+        buf_size = MHD_SCKT_SEND_MAX_SIZE_;
 
       res = MHD_recv_ (urh->mhd.socket,
                        &urh->out_buffer[urh->out_buffer_off],
-                       rcv_size);
+                       buf_size);
       if (-1 == res)
         {
           /* FIXME: differenciate by errno? */
@@ -1115,15 +1116,15 @@ process_urh (struct MHD_UpgradeResponseHandle *urh)
        (urh->out_buffer_off > 0) )
     {
       ssize_t res;
-      size_t snd_size;
+      size_t data_size;
 
-      snd_size = urh->out_buffer_off;
-      if (snd_size > SSIZE_MAX)
-        snd_size = SSIZE_MAX;
+      data_size = urh->out_buffer_off;
+      if (data_size > SSIZE_MAX)
+        data_size = SSIZE_MAX;
 
       res = gnutls_record_send (urh->connection->tls_session,
                                 urh->out_buffer,
-                                snd_size);
+                                data_size);
       if ( (GNUTLS_E_AGAIN == res) ||
            (GNUTLS_E_INTERRUPTED == res) )
         {


hooks/post-receive
-- 
GNU libmicrohttpd



reply via email to

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