gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated (7934cc07 -> 12f65d40


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (7934cc07 -> 12f65d40)
Date: Sun, 27 Aug 2017 20:56:24 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 7934cc07 MHD_queue_response(): check for correct thread ID
     new de5c159d connection_https: reset tls_read_ready when no data is 
available
     new 1d313179 *_param_adapter: Distinguish between network error and remote 
hard close
     new 12f65d40 Rename _MHD_inline to _MHD_static_inline for better 
readability

The 3 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:
 configure.ac                      |  4 +++-
 src/microhttpd/connection.c       |  8 ++++++--
 src/microhttpd/connection.h       |  5 +++--
 src/microhttpd/connection_https.c |  6 ++++--
 src/microhttpd/mhd_str.c          | 28 ++++++++++++++--------------
 5 files changed, 30 insertions(+), 21 deletions(-)

diff --git a/configure.ac b/configure.ac
index c249aef1..a5a48210 100644
--- a/configure.ac
+++ b/configure.ac
@@ -241,7 +241,9 @@ done
 AS_IF([[test "x$inln_prfx" != "xnone"]],
       [
        AC_DEFINE([INLINE_FUNC],[1],[Define to 1 if your C compiler supports 
inline functions.])
-       AC_DEFINE_UNQUOTED([_MHD_inline],[static $inln_prfx],[Define to prefix 
which will be used with MHD inline functions.])
+       AC_DEFINE_UNQUOTED([_MHD_static_inline],[static $inln_prfx],[Define to 
prefix which will be used with MHD static inline functions.])
+      ], [
+       AC_DEFINE([_MHD_static_inline],[static],[Define to prefix which will be 
used with MHD static inline functions.])
       ])
 AC_MSG_RESULT([[$inln_prfx]])
 CFLAGS="$save_CFLAGS"
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 95823992..8fadc8d8 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -152,8 +152,10 @@ recv_param_adapter (struct MHD_Connection *connection,
         }
       if (MHD_SCKT_ERR_IS_EINTR_ (err))
         return MHD_ERR_AGAIN_;
+      if (MHD_SCKT_ERR_IS_ (err, MHD_SCKT_ECONNRESET_))
+        return MHD_ERR_CONNRESET_;
       /* Treat any other error as hard error. */
-      return MHD_ERR_CONNRESET_;
+      return MHD_ERR_NOTCONN_;
     }
 #ifdef EPOLL_SUPPORT
   else if (i > (size_t)ret)
@@ -204,8 +206,10 @@ send_param_adapter (struct MHD_Connection *connection,
         }
       if (MHD_SCKT_ERR_IS_EINTR_ (err))
         return MHD_ERR_AGAIN_;
+      if (MHD_SCKT_ERR_IS_ (err, MHD_SCKT_ECONNRESET_))
+        return MHD_ERR_CONNRESET_;
       /* Treat any other error as hard error. */
-      return MHD_ERR_CONNRESET_;
+      return MHD_ERR_NOTCONN_;
     }
 #ifdef EPOLL_SUPPORT
   else if (i > (size_t)ret)
diff --git a/src/microhttpd/connection.h b/src/microhttpd/connection.h
index f5316887..37e4d550 100644
--- a/src/microhttpd/connection.h
+++ b/src/microhttpd/connection.h
@@ -36,12 +36,13 @@
 #define MHD_ERR_AGAIN_ (-3073)
 
 /**
- * "Connection (remote) reset" error code
+ * Connection was hard-closed by remote peer.
  */
 #define MHD_ERR_CONNRESET_ (-3074)
 
 /**
- * "Not connected" error code
+ * Connection is not connected anymore due to
+ * network error or any other reason.
  */
 #define MHD_ERR_NOTCONN_ (-3075)
 
diff --git a/src/microhttpd/connection_https.c 
b/src/microhttpd/connection_https.c
index 19d6db59..03f80b8c 100644
--- a/src/microhttpd/connection_https.c
+++ b/src/microhttpd/connection_https.c
@@ -64,6 +64,8 @@ recv_tls_adapter (struct MHD_Connection *connection,
       if (GNUTLS_E_AGAIN == res)
         connection->epoll_state &= ~MHD_EPOLL_STATE_READ_READY;
 #endif
+      /* Any network errors means that buffer is empty. */
+      connection->tls_read_ready = false;
       return MHD_ERR_AGAIN_;
     }
   if (res < 0)
@@ -71,7 +73,7 @@ recv_tls_adapter (struct MHD_Connection *connection,
       /* Likely 'GNUTLS_E_INVALID_SESSION' (client communication
          disrupted); interpret as a hard error */
       connection->tls_read_ready = false;
-      return MHD_ERR_CONNRESET_;
+      return MHD_ERR_NOTCONN_;
     }
 
 #ifdef EPOLL_SUPPORT
@@ -123,7 +125,7 @@ send_tls_adapter (struct MHD_Connection *connection,
     {
       /* Likely 'GNUTLS_E_INVALID_SESSION' (client communication
          disrupted); interpret as a hard error */
-      return MHD_ERR_CONNRESET_;
+      return MHD_ERR_NOTCONN_;
     }
 #ifdef EPOLL_SUPPORT
   /* If NOT all available data was sent - socket is not write ready anymore. */
diff --git a/src/microhttpd/mhd_str.c b/src/microhttpd/mhd_str.c
index bb10d26f..e965be63 100644
--- a/src/microhttpd/mhd_str.c
+++ b/src/microhttpd/mhd_str.c
@@ -32,13 +32,13 @@
 #include "mhd_limits.h"
 
 #ifdef MHD_FAVOR_SMALL_CODE
-#ifdef _MHD_inline
-#undef _MHD_inline
-#endif /* _MHD_inline */
+#ifdef _MHD_static_inline
+#undef _MHD_static_inline
+#endif /* _MHD_static_inline */
 /* Do not force inlining and do not use macro functions, use normal static
    functions instead.
    This may give more flexibility for size optimizations. */
-#define _MHD_inline static
+#define _MHD_static_inline static
 #ifndef INLINE_FUNC
 #define INLINE_FUNC 1
 #endif /* !INLINE_FUNC */
@@ -56,7 +56,7 @@
  * @param c character to check
  * @return non-zero if character is lower case letter, zero otherwise
  */
-_MHD_inline bool
+_MHD_static_inline bool
 isasciilower (char c)
 {
   return (c >= 'a') && (c <= 'z');
@@ -69,7 +69,7 @@ isasciilower (char c)
  * @param c character to check
  * @return non-zero if character is upper case letter, zero otherwise
  */
-_MHD_inline bool
+_MHD_static_inline bool
 isasciiupper (char c)
 {
   return (c >= 'A') && (c <= 'Z');
@@ -82,7 +82,7 @@ isasciiupper (char c)
  * @param c character to check
  * @return non-zero if character is letter in US-ASCII, zero otherwise
  */
-_MHD_inline bool
+_MHD_static_inline bool
 isasciialpha (char c)
 {
   return isasciilower (c) || isasciiupper (c);
@@ -95,7 +95,7 @@ isasciialpha (char c)
  * @param c character to check
  * @return non-zero if character is decimal digit, zero otherwise
  */
-_MHD_inline bool
+_MHD_static_inline bool
 isasciidigit (char c)
 {
   return (c >= '0') && (c <= '9');
@@ -108,7 +108,7 @@ isasciidigit (char c)
  * @param c character to check
  * @return non-zero if character is decimal digit, zero otherwise
  */
-_MHD_inline bool
+_MHD_static_inline bool
 isasciixdigit (char c)
 {
   return isasciidigit (c) ||
@@ -123,7 +123,7 @@ isasciixdigit (char c)
  * @param c character to check
  * @return non-zero if character is decimal digit or letter, zero otherwise
  */
-_MHD_inline bool
+_MHD_static_inline bool
 isasciialnum (char c)
 {
   return isasciialpha (c) || isasciidigit (c);
@@ -139,7 +139,7 @@ isasciialnum (char c)
  * @param c character to convert
  * @return converted to lower case character
  */
-_MHD_inline char
+_MHD_static_inline char
 toasciilower (char c)
 {
   return isasciiupper (c) ? (c - 'A' + 'a') : c;
@@ -155,7 +155,7 @@ toasciilower (char c)
  * @param c character to convert
  * @return converted to upper case character
  */
-_MHD_inline char
+_MHD_static_inline char
 toasciiupper (char c)
 {
   return isasciilower (c) ? (c - 'a' + 'A') : c;
@@ -168,7 +168,7 @@ toasciiupper (char c)
  * @param c character to convert
  * @return value of decimal digit or -1 if @ c is not decimal digit
  */
-_MHD_inline int
+_MHD_static_inline int
 todigitvalue (char c)
 {
   if (isasciidigit (c))
@@ -184,7 +184,7 @@ todigitvalue (char c)
  * @param c character to convert
  * @return value of hexadecimal digit or -1 if @ c is not hexadecimal digit
  */
-_MHD_inline int
+_MHD_static_inline int
 toxdigitvalue (char c)
 {
   if (isasciidigit (c))

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



reply via email to

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