summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-08-12 10:04:50 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-08-12 13:37:08 +0200
commit1a2df1518ad8653f248e8e9de47f28448d2dc399 (patch)
tree4e0a2ede1693337571baaaaf014e4d70ee0ec6f8
parent551806255fb484eff52e36273dbd20c593e19542 (diff)
downloadcurl-1a2df1518ad8653f248e8e9de47f28448d2dc399.tar.gz
curl_version_info: offer quic (and h3) library info
Closes #4216
-rw-r--r--docs/libcurl/curl_version_info.39
-rw-r--r--include/curl/curl.h3
-rw-r--r--lib/version.c11
3 files changed, 21 insertions, 2 deletions
diff --git a/docs/libcurl/curl_version_info.3 b/docs/libcurl/curl_version_info.3
index 07cdf0c47..0c4006740 100644
--- a/docs/libcurl/curl_version_info.3
+++ b/docs/libcurl/curl_version_info.3
@@ -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
diff --git a/include/curl/curl.h b/include/curl/curl.h
index 9429355a9..9131f117d 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -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 */
diff --git a/lib/version.c b/lib/version.c
index c1b5a1c51..5a969b943 100644
--- a/lib/version.c
+++ b/lib/version.c
@@ -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;