]> granicus.if.org Git - curl/commitdiff
curl_version_info: offer quic (and h3) library info
authorDaniel Stenberg <daniel@haxx.se>
Mon, 12 Aug 2019 08:04:50 +0000 (10:04 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 12 Aug 2019 11:37:08 +0000 (13:37 +0200)
Closes #4216

docs/libcurl/curl_version_info.3
include/curl/curl.h
lib/version.c

index 07cdf0c47bc002d92738f9fde32543304c33e8d1..0c400674003420392cbd4ca185147ef4344046ee 100644 (file)
@@ -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
 
index 9429355a946cf397121963b328922d31f1434e18..9131f117d4d403e4940ec35ba45d233e48d2dedb 100644 (file)
@@ -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 */
index c1b5a1c51ab51cfcfdc857006fffdf980446a83f..5a969b9436da965ed58a0337859a9c9069cbdb32 100644 (file)
@@ -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;