libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 7055ebd931463d7bf0e4104c415d8ee60e21d83b
parent 101fa6ceed4baf7e03a2f24aca4beb6e03dbb9d6
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Thu,  3 Nov 2016 16:49:24 +0300

Added MHD_FEATURE_UPGRADE for MHD_is_feature_supported()

Diffstat:
Msrc/include/microhttpd.h | 10+++++++++-
Msrc/microhttpd/daemon.c | 8+++++++-
2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h @@ -2853,7 +2853,15 @@ enum MHD_FEATURE /** * Get whether MHD set names on generated threads. */ - MHD_THREAD_NAMES = 16 + MHD_FEATURE_THREAD_NAMES = 16, + MHD_THREAD_NAMES = 16, + + /** + * Get whether HTTP "Upgrade" is supported. + * If supported then #MHD_ALLOW_UPGRADE, #MHD_upgrade_action() and + * #MHD_create_response_for_upgrade() can be used. + */ + MHD_FEATURE_UPGRADE = 17 }; diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -5946,12 +5946,18 @@ MHD_is_feature_supported(enum MHD_FEATURE feature) #else return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES; #endif - case MHD_THREAD_NAMES: + case MHD_FEATURE_THREAD_NAMES: #if defined(MHD_USE_THREAD_NAME_) return MHD_YES; #else return MHD_NO; #endif + case MHD_FEATURE_UPGRADE: +#if defined(UPGRADE_SUPPORT) + return MHD_YES; +#else + return MHD_NO; +#endif } return MHD_NO; }