diff options
Diffstat (limited to 'Utilities/cmcurl/lib/version.c')
-rw-r--r-- | Utilities/cmcurl/lib/version.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/Utilities/cmcurl/lib/version.c b/Utilities/cmcurl/lib/version.c index 7064c20..a9102ec 100644 --- a/Utilities/cmcurl/lib/version.c +++ b/Utilities/cmcurl/lib/version.c @@ -100,7 +100,7 @@ static size_t zstd_version(char *buf, size_t bufsz) * zeros in the data. */ -#define VERSION_PARTS 14 /* number of substrings we can concatenate */ +#define VERSION_PARTS 15 /* number of substrings we can concatenate */ char *curl_version(void) { @@ -144,6 +144,9 @@ char *curl_version(void) #ifdef USE_LIBRTMP char rtmp_version[40]; #endif +#ifdef USE_HYPER + char hyper_buf[30]; +#endif int i = 0; int j; @@ -228,6 +231,10 @@ char *curl_version(void) src[i++] = rtmp_version; } #endif +#ifdef USE_HYPER + msnprintf(hyper_buf, sizeof(hyper_buf), "Hyper/%s", hyper_version()); + src[i++] = hyper_buf; +#endif DEBUGASSERT(i <= VERSION_PARTS); @@ -274,6 +281,9 @@ static const char * const protocols[] = { #ifndef CURL_DISABLE_GOPHER "gopher", #endif +#if defined(USE_SSL) && !defined(CURL_DISABLE_GOPHER) + "gophers", +#endif #ifndef CURL_DISABLE_HTTP "http", #endif @@ -394,7 +404,7 @@ static curl_version_info_data version_info = { #if defined(USE_TLS_SRP) | CURL_VERSION_TLSAUTH_SRP #endif -#if defined(USE_NGHTTP2) +#if defined(USE_NGHTTP2) || defined(USE_HYPER) | CURL_VERSION_HTTP2 #endif #if defined(ENABLE_QUIC) @@ -447,7 +457,8 @@ static curl_version_info_data version_info = { NULL, #endif 0, /* zstd_ver_num */ - NULL /* zstd version */ + NULL, /* zstd version */ + NULL /* Hyper version */ }; curl_version_info_data *curl_version_info(CURLversion stamp) @@ -469,7 +480,6 @@ curl_version_info_data *curl_version_info(CURLversion stamp) static char zstd_buffer[80]; #endif - #ifdef USE_SSL Curl_ssl_version(ssl_buffer, sizeof(ssl_buffer)); version_info.ssl_version = ssl_buffer; @@ -544,6 +554,14 @@ curl_version_info_data *curl_version_info(CURLversion stamp) } #endif +#ifdef USE_HYPER + { + static char hyper_buffer[30]; + msnprintf(hyper_buffer, sizeof(hyper_buffer), "Hyper/%s", hyper_version()); + version_info.hyper_version = hyper_buffer; + } +#endif + (void)stamp; /* avoid compiler warnings, we don't use this */ return &version_info; } |