diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-03-16 14:55:53 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-03-16 14:55:53 +0300 |
commit | 77bc8103555ea66216af295ccf8f9176e9fa747c (patch) | |
tree | 16b43ab68be9a38ff413ba541046dd7d6dba54b8 | |
parent | 6bd7866d217214e3cbda0f67b5fda8d8020d6669 (diff) | |
download | libmicrohttpd-77bc8103555ea66216af295ccf8f9176e9fa747c.tar.gz libmicrohttpd-77bc8103555ea66216af295ccf8f9176e9fa747c.zip |
Added MHD_DAEMON_INFO_FLAGS to get daemon's flags by MHD_get_daemon_info()
-rw-r--r-- | src/include/microhttpd.h | 18 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 9912427b..79f57a19 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -1796,7 +1796,15 @@ enum MHD_DaemonInfoType | |||
1796 | * Request the number of current connections handled by the daemon. | 1796 | * Request the number of current connections handled by the daemon. |
1797 | * No extra arguments should be passed. | 1797 | * No extra arguments should be passed. |
1798 | */ | 1798 | */ |
1799 | MHD_DAEMON_INFO_CURRENT_CONNECTIONS | 1799 | MHD_DAEMON_INFO_CURRENT_CONNECTIONS, |
1800 | |||
1801 | /** | ||
1802 | * Request the daemon flags. | ||
1803 | * No extra arguments should be passed. | ||
1804 | * Note: flags may differ from original 'flags' specified for | ||
1805 | * daemon, especially if #MHD_USE_AUTO was set. | ||
1806 | */ | ||
1807 | MHD_DAEMON_INFO_FLAGS | ||
1800 | }; | 1808 | }; |
1801 | 1809 | ||
1802 | 1810 | ||
@@ -3184,6 +3192,14 @@ union MHD_DaemonInfo | |||
3184 | * Number of active connections, for #MHD_DAEMON_INFO_CURRENT_CONNECTIONS. | 3192 | * Number of active connections, for #MHD_DAEMON_INFO_CURRENT_CONNECTIONS. |
3185 | */ | 3193 | */ |
3186 | unsigned int num_connections; | 3194 | unsigned int num_connections; |
3195 | |||
3196 | /** | ||
3197 | * Combination of #MHD_FLAG values, for #MHD_DAEMON_INFO_FLAGS. | ||
3198 | * This value is actually a bitfield. | ||
3199 | * Note: flags may differ from original 'flags' specified for | ||
3200 | * daemon, especially if #MHD_USE_AUTO was set. | ||
3201 | */ | ||
3202 | enum MHD_FLAG flags; | ||
3187 | }; | 3203 | }; |
3188 | 3204 | ||
3189 | 3205 | ||
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index b78aabb0..ec3f325a 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -6259,6 +6259,8 @@ MHD_get_daemon_info (struct MHD_Daemon *daemon, | |||
6259 | } | 6259 | } |
6260 | } | 6260 | } |
6261 | return (const union MHD_DaemonInfo *) &daemon->connections; | 6261 | return (const union MHD_DaemonInfo *) &daemon->connections; |
6262 | case MHD_DAEMON_INFO_FLAGS: | ||
6263 | return (const union MHD_DaemonInfo *) &daemon->options; | ||
6262 | default: | 6264 | default: |
6263 | return NULL; | 6265 | return NULL; |
6264 | }; | 6266 | }; |