gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated (42e4a4b6 -> 27c939ad


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (42e4a4b6 -> 27c939ad)
Date: Thu, 28 Sep 2017 20:00:15 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 42e4a4b6 Hello, in commit 243e8fcd6054e4c0d2964b0d4b29e0c15861498d (5 
Jun 2017), the definition of MHD_TLS_CONNECTION_INIT was deleted.
     new 5fb65271 connection.c: muted compiler warnings, replaced some unused 
checks with asserts.
     new 4e18379e daemon.c: muted some compiler warnings, added comments.
     new 73897ef5 digestauth.c: muted compiler warning
     new fe184efa postprocessor.c: fixed compiler warnings
     new 27c939ad mhd_str.c: muted compiler warning

The 5 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    | 14 +++++++-------
 src/microhttpd/daemon.c        | 13 +++++++++++--
 src/microhttpd/digestauth.c    |  1 +
 src/microhttpd/mhd_str.c       |  5 ++++-
 src/microhttpd/postprocessor.c |  6 +++---
 5 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 8fadc8d8..b30c6d1b 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -322,6 +322,7 @@ sendfile_adapter (struct MHD_Connection *connection)
 static int
 socket_flush_possible(struct MHD_Connection *connection)
 {
+  (void)connection; /* Mute compiler warning. */
 #if defined(TCP_CORK) || defined(TCP_PUSH)
   return MHD_YES;
 #else  /* !TCP_CORK && !TCP_PUSH */
@@ -341,13 +342,13 @@ static int
 socket_start_extra_buffering (struct MHD_Connection *connection)
 {
   int res = MHD_NO;
+  (void)connection; /* Mute compiler warning. */
 #if defined(TCP_CORK) || defined(TCP_NOPUSH)
   const MHD_SCKT_OPT_BOOL_ on_val = 1;
 #if defined(TCP_NODELAY)
   const MHD_SCKT_OPT_BOOL_ off_val = 0;
 #endif /* TCP_NODELAY */
-  if (!connection)
-    return MHD_NO;
+  mhd_assert(NULL != connection);
 #if defined(TCP_NOPUSH) && !defined(TCP_CORK)
   /* Buffer data before sending */
   res = (0 == setsockopt (connection->socket_fd,
@@ -406,8 +407,8 @@ socket_start_no_buffering (struct MHD_Connection 
*connection)
   const MHD_SCKT_OPT_BOOL_ off_val = 0;
 #endif /* TCP_CORK || TCP_NOPUSH */
 
-  if (NULL == connection)
-    return MHD_NO;
+  (void)connection; /* Mute compiler warning. */
+  mhd_assert(NULL != connection);
 #if defined(TCP_CORK)
   /* Allow partial packets */
   res &= (0 == setsockopt (connection->socket_fd,
@@ -489,8 +490,7 @@ socket_start_normal_buffering (struct MHD_Connection 
*connection)
   MHD_SCKT_OPT_BOOL_ cork_val = 0;
   socklen_t param_size = sizeof (cork_val);
 #endif /* TCP_CORK */
-  if (!connection)
-    return MHD_NO;
+  mhd_assert(NULL != connection);
 #if defined(TCP_CORK)
   /* Allow partial packets */
   /* Disabling TCP_CORK will flush partial packet even if TCP_CORK wasn't 
enabled before
@@ -1070,7 +1070,7 @@ try_ready_chunked_body (struct MHD_Connection *connection)
                         "%X\r\n",
                         (unsigned int) ret);
   mhd_assert(cblen > 0);
-  mhd_assert(cblen < sizeof(cbuf));
+  mhd_assert((size_t)cblen < sizeof(cbuf));
   memcpy (&connection->write_buffer[sizeof (cbuf) - cblen],
           cbuf,
           cblen);
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index fb363caa..7d4daa73 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -130,6 +130,7 @@ mhd_panic_std (void *cls,
               unsigned int line,
               const char *reason)
 {
+  (void)cls; /* Mute compiler warning. */
 #ifdef HAVE_MESSAGES
   fprintf (stderr,
            _("Fatal error in GNU libmicrohttpd %s:%u: %s\n"),
@@ -4404,6 +4405,8 @@ unescape_wrapper (void *cls,
                   struct MHD_Connection *connection,
                   char *val)
 {
+  (void)cls; /* Mute compiler warning. */
+  (void)connection; /* Mute compiler warning. */
   return MHD_http_unescape (val);
 }
 
@@ -4630,7 +4633,10 @@ parse_options_va (struct MHD_Daemon *daemon,
         case MHD_OPTION_CONNECTION_TIMEOUT:
           uv = va_arg (ap,
                        unsigned int);
-          if (TIME_T_MAX < uv)
+          /* Next comparison could be always false on some platforms and whole 
branch will
+           * be optimized out on those platforms. On others it will be 
compiled into real
+           * check. */
+          if (TIME_T_MAX < uv) /* Compiler may warn on some platforms, ignore 
warning. */
             {
 #ifdef HAVE_MESSAGES
               MHD_DLOG (daemon,
@@ -4687,7 +4693,10 @@ parse_options_va (struct MHD_Daemon *daemon,
 #endif
               daemon->worker_pool_size = 0;
             }
-          else if (daemon->worker_pool_size >= (SIZE_MAX / sizeof (struct 
MHD_Daemon)))
+          /* Next comparison could be always false on some platforms and whole 
branch will
+           * be optimized out on those platforms. On others it will be 
compiled into real
+           * check. */
+          else if (daemon->worker_pool_size >= (SIZE_MAX / sizeof (struct 
MHD_Daemon))) /* Compiler may warn on some platforms, ignore warning. */
            {
 #ifdef HAVE_MESSAGES
              MHD_DLOG (daemon,
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index f1f55dfa..dc277249 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -190,6 +190,7 @@ digest_calc_response (const char ha1[HASH_MD5_HEX_LEN + 1],
   unsigned char ha2[MD5_DIGEST_SIZE];
   unsigned char resphash[MD5_DIGEST_SIZE];
   char ha2hex[HASH_MD5_HEX_LEN + 1];
+  (void)hentity; /* Silent compiler warning. */
 
   MD5Init (&md5);
   MD5Update (&md5,
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
index e965be63..0c62de52 100644
--- a/src/microhttpd/mhd_str.c
+++ b/src/microhttpd/mhd_str.c
@@ -101,7 +101,7 @@ isasciidigit (char c)
   return (c >= '0') && (c <= '9');
 }
 
-
+#if 0 /* Disable unused functions. */
 /**
  * Check whether character is hexadecimal digit in US-ASCII
  *
@@ -128,6 +128,7 @@ isasciialnum (char c)
 {
   return isasciialpha (c) || isasciidigit (c);
 }
+#endif /* Disable unused functions. */
 
 
 /**
@@ -146,6 +147,7 @@ toasciilower (char c)
 }
 
 
+#if 0 /* Disable unused functions. */
 /**
  * Convert US-ASCII character to upper case.
  * If character is lower case letter in US-ASCII than it's converted to upper
@@ -176,6 +178,7 @@ todigitvalue (char c)
 
   return -1;
 }
+#endif /* Disable unused functions. */
 
 
 /**
diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c
index 208686bb..8b710ea1 100644
--- a/src/microhttpd/postprocessor.c
+++ b/src/microhttpd/postprocessor.c
@@ -783,12 +783,12 @@ process_value_to_boundary (struct MHD_PostProcessor *pp,
             break;
           newline++;
         }
-      if (newline + pp->blen + 4 <= pp->buffer_pos)
+      if (newline + blen + 4 <= pp->buffer_pos)
         {
           /* can check boundary */
           if (0 != memcmp (&buf[newline + 4],
                            boundary,
-                           pp->blen))
+                           blen))
             {
               /* no boundary, "\r\n--" is part of content, skip */
               newline += 4;
@@ -801,7 +801,7 @@ process_value_to_boundary (struct MHD_PostProcessor *pp,
               pp->skip_rn = RN_Dash;
               pp->state = next_state;
               pp->dash_state = next_dash_state;
-              (*ioffptr) += pp->blen + 4;       /* skip boundary as well */
+              (*ioffptr) += blen + 4;       /* skip boundary as well */
               buf[newline] = '\0';
               break;
             }

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



reply via email to

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