* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
VAR_PRIMARY_PORT,
VAR_LOCAL_IP,
VAR_LOCAL_PORT,
+ VAR_HTTP_VERSION,
VAR_NUM_OF_VARS /* must be the last */
} replaceid;
{"remote_port", VAR_PRIMARY_PORT},
{"local_ip", VAR_LOCAL_IP},
{"local_port", VAR_LOCAL_PORT},
+ {"http_version", VAR_HTTP_VERSION},
{NULL, VAR_NONE}
};
&longinfo))
fprintf(stream, "%ld", longinfo);
break;
+ case VAR_HTTP_VERSION:
+ if(CURLE_OK ==
+ curl_easy_getinfo(curl, CURLINFO_HTTP_VERSION,
+ &longinfo)) {
+ const char *version = "0";
+ switch (longinfo) {
+ case CURL_HTTP_VERSION_1_0:
+ version = "1.0";
+ break;
+ case CURL_HTTP_VERSION_1_1:
+ version = "1.1";
+ break;
+ case CURL_HTTP_VERSION_2_0:
+ version = "2";
+ break;
+ }
+
+ fprintf(stream, version);
+ }
+ break;
default:
break;
}