Skip to content
Permalink
Browse files

curl_version_info: offer quic (and h3) library info

Closes #4216
  • Loading branch information...
bagder committed Aug 12, 2019
1 parent 5518062 commit 1a2df1518ad8653f248e8e9de47f28448d2dc399
Showing with 21 additions and 2 deletions.
  1. +9 −0 docs/libcurl/curl_version_info.3
  2. +2 −1 include/curl/curl.h
  3. +10 −1 lib/version.c
@@ -78,6 +78,15 @@ typedef struct {
(MAJOR << 24) | (MINOR << 12) | PATCH */
const char *brotli_version; /* human readable string. */

/* when 'age is CURLVERSION_SIXTH or alter (7.66.0 or later), these fields
also exist */
unsigned int nghttp2_ver_num; /* Numeric nghttp2 version
(MAJOR << 16) | (MINOR << 8) | PATCH */
const char *nghttp2_version; /* human readable string. */

char *quic_version; /* human readable quic (+ HTTP/3) library +
version or NULL */

} curl_version_info_data;
.fi

@@ -2762,7 +2762,8 @@ typedef struct {
unsigned int nghttp2_ver_num; /* Numeric nghttp2 version
(MAJOR << 16) | (MINOR << 8) | PATCH */
const char *nghttp2_version; /* human readable string. */

char *quic_version; /* human readable quic (+ HTTP/3) library +
version or NULL */
} curl_version_info_data;

#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
@@ -395,7 +395,8 @@ static curl_version_info_data version_info = {
0, /* brotli_ver_num */
NULL, /* brotli version */
0, /* nghttp2 version number */
NULL /* nghttp2 version string */
NULL, /* nghttp2 version string */
NULL /* quic library string */
};

curl_version_info_data *curl_version_info(CURLversion stamp)
@@ -479,6 +480,14 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
}
#endif

#ifdef ENABLE_QUIC
{
static char quicbuffer[80];
Curl_quic_ver(quicbuffer, sizeof(quicbuffer));
version_info.quic_version = quicbuffer;
}
#endif

(void)stamp; /* avoid compiler warnings, we don't use this */

initialized = true;

0 comments on commit 1a2df15

Please sign in to comment.
You can’t perform that action at this time.