mirror of
https://github.com/curl/curl.git
synced 2026-08-25 22:03:47 +03:00
http: add CURLINFO_HTTP_VERSION and %{http_version}
Adds access to the effectively used http version to both libcurl and curl. Closes #799
This commit is contained in:
parent
4bffaad85f
commit
071c561394
7 changed files with 104 additions and 2 deletions
|
|
@ -198,6 +198,22 @@ static CURLcode getinfo_long(struct SessionHandle *data, CURLINFO info,
|
|||
case CURLINFO_RTSP_CSEQ_RECV:
|
||||
*param_longp = data->state.rtsp_CSeq_recv;
|
||||
break;
|
||||
case CURLINFO_HTTP_VERSION:
|
||||
switch (data->info.httpversion) {
|
||||
case 10:
|
||||
*param_longp = CURL_HTTP_VERSION_1_0;
|
||||
break;
|
||||
case 11:
|
||||
*param_longp = CURL_HTTP_VERSION_1_1;
|
||||
break;
|
||||
case 20:
|
||||
*param_longp = CURL_HTTP_VERSION_2_0;
|
||||
break;
|
||||
default:
|
||||
*param_longp = CURL_HTTP_VERSION_NONE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return CURLE_UNKNOWN_OPTION;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue