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. 19


From: gitolite
Subject: [GNUnet-SVN] [libmicrohttpd] GNU libmicrohttpd branch master updated. 198181f17828a0c25079ace9d71f23682d99b8ad
Date: Wed, 23 Nov 2016 13:31:18 +0100 (CET)

The branch, master has been updated
       via  198181f17828a0c25079ace9d71f23682d99b8ad (commit)
      from  7f5c98bfa147997d58a60186a84d12a3a602d28c (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 198181f17828a0c25079ace9d71f23682d99b8ad
Author: Evgeny Grin (Karlson2k) <address@hidden>
Date:   Wed Nov 23 15:28:03 2016 +0300

    Use both SO_REUSEADDR and SO_REUSEPORT on non-W32 if 
MHD_OPTION_LISTENING_ADDRESS_REUSE is set.

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

Summary of changes:
 ChangeLog               |  4 ++++
 src/microhttpd/daemon.c | 19 +++++++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e968453..33759ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Nov 23 15:24:10 MSK 2016
+       Used SO_REUSEADDR (on non-W32) alongside with SO_REUSEPORT if option
+       MHD_OPTION_LISTENING_ADDRESS_REUSE was set. -EG
+
 Wed Nov 23 12:48:23 MSK 2016
        Move all gettext-related staff to 'po' subdirectory.
        Excluded gettext files generation from normal build.
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 55604eb..9300a43 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -5041,8 +5041,23 @@ MHD_start_daemon_va (unsigned int flags,
         }
       else if (daemon->listening_address_reuse > 0)
         {
-          /* User requested to allow reusing listening address:port.
-           * Use SO_REUSEADDR on Windows and SO_REUSEPORT on most platforms.
+          /* User requested to allow reusing listening address:port. */
+#ifndef _WIN32
+          /* Use SO_REUSEADDR on non-W32 platforms, and do not fail if
+           * it doesn't work. */
+          if (0 > setsockopt (socket_fd,
+                              SOL_SOCKET,
+                              SO_REUSEADDR,
+                              (void*)&on, sizeof (on)))
+            {
+#ifdef HAVE_MESSAGES
+              MHD_DLOG (daemon,
+                        _("setsockopt failed: %s\n"),
+                        MHD_socket_last_strerr_ ());
+#endif
+            }
+#endif /* ! _WIN32 */
+          /* Use SO_REUSEADDR on Windows and SO_REUSEPORT on most platforms.
            * Fail if SO_REUSEPORT is not defined or setsockopt fails.
            */
           /* SO_REUSEADDR on W32 has the same semantics


hooks/post-receive
-- 
GNU libmicrohttpd



reply via email to

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