gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] 04/06: MHD_get_daemon_info(): return bind p


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 04/06: MHD_get_daemon_info(): return bind port number by MHD_DAEMON_INFO_BIND_PORT
Date: Thu, 15 Jun 2017 23:43:29 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 94e7a07828a3c4d2b5f782c1cafc35169d9bc29f
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Thu Jun 15 10:42:22 2017 +0300

    MHD_get_daemon_info(): return bind port number by MHD_DAEMON_INFO_BIND_PORT
---
 src/include/microhttpd.h | 18 ++++++++++++++++--
 src/microhttpd/daemon.c  |  2 ++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 2319eef3..de84e5d7 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -126,7 +126,7 @@ typedef intptr_t ssize_t;
  * Current version of the library.
  * 0x01093001 = 1.9.30-1.
  */
-#define MHD_VERSION 0x00095500
+#define MHD_VERSION 0x00095501
 
 /**
  * MHD-internal return code for "YES".
@@ -1845,7 +1845,15 @@ enum MHD_DaemonInfoType
    * Note: flags may differ from original 'flags' specified for
    * daemon, especially if #MHD_USE_AUTO was set.
    */
-  MHD_DAEMON_INFO_FLAGS
+  MHD_DAEMON_INFO_FLAGS,
+
+  /**
+   * Request the port number of daemon's listen socket.
+   * No extra arguments should be passed.
+   * Note: if port '0' was specified for #MHD_start_daemon(), returned
+   * value will be real port number.
+   */
+  MHD_DAEMON_INFO_BIND_PORT
 };
 
 
@@ -3248,6 +3256,11 @@ union MHD_DaemonInfo
   MHD_socket listen_fd;
 
   /**
+   * Bind port number, returned for #MHD_DAEMON_INFO_BIND_PORT.
+   */
+  uint16_t port;
+
+  /**
    * epoll FD, returned for #MHD_DAEMON_INFO_EPOLL_FD.
    */
   int epoll_fd;
@@ -3437,6 +3450,7 @@ enum MHD_FEATURE
 
   /**
    * Get whether MHD support automatic detection of bind port number.
+   * @sa #MHD_DAEMON_INFO_BIND_PORT
    */
   MHD_FEATURE_AUTODETECT_BIND_PORT = 19
 };
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index dfb92b4d..45ecd804 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -6319,6 +6319,8 @@ MHD_get_daemon_info (struct MHD_Daemon *daemon,
       return (const union MHD_DaemonInfo *) &daemon->connections;
     case MHD_DAEMON_INFO_FLAGS:
       return (const union MHD_DaemonInfo *) &daemon->options;
+    case MHD_DAEMON_INFO_BIND_PORT:
+      return (const union MHD_DaemonInfo *) &daemon->port;
     default:
       return NULL;
     };

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



reply via email to

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