diff options
author | Curl Upstream <curl-library@cool.haxx.se> | 2020-08-19 07:37:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-08-19 16:44:30 (GMT) |
commit | 7ceb56989f8ab3a4e1b1f2c48c9a0f382b85ec04 (patch) | |
tree | 936c40c921e79b8eabd623181d78167188bbc810 /lib/getinfo.c | |
parent | 4446fda8e019a0138bec1aa2d83a720d63019ff9 (diff) | |
download | CMake-7ceb56989f8ab3a4e1b1f2c48c9a0f382b85ec04.zip CMake-7ceb56989f8ab3a4e1b1f2c48c9a0f382b85ec04.tar.gz CMake-7ceb56989f8ab3a4e1b1f2c48c9a0f382b85ec04.tar.bz2 |
curl 2020-08-19 (9d954e49)
Code extracted from:
https://github.com/curl/curl.git
at commit 9d954e49bce3706a9a2efb119ecd05767f0f2a9e (curl-7_72_0).
Diffstat (limited to 'lib/getinfo.c')
-rw-r--r-- | lib/getinfo.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c index 6d5bd5f..82691dc 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -78,6 +78,7 @@ CURLcode Curl_initinfo(struct Curl_easy *data) info->conn_local_ip[0] = '\0'; info->conn_primary_port = 0; info->conn_local_port = 0; + info->retry_after = 0; info->conn_scheme = 0; info->conn_protocol = 0; @@ -95,6 +96,34 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info, case CURLINFO_EFFECTIVE_URL: *param_charp = data->change.url?data->change.url:(char *)""; break; + case CURLINFO_EFFECTIVE_METHOD: { + const char *m = data->set.str[STRING_CUSTOMREQUEST]; + if(!m) { + if(data->set.opt_no_body) + m = "HEAD"; + else { + switch(data->state.httpreq) { + case HTTPREQ_POST: + case HTTPREQ_POST_FORM: + case HTTPREQ_POST_MIME: + m = "POST"; + break; + case HTTPREQ_PUT: + m = "PUT"; + break; + default: /* this should never happen */ + case HTTPREQ_GET: + m = "GET"; + break; + case HTTPREQ_HEAD: + m = "HEAD"; + break; + } + } + } + *param_charp = m; + } + break; case CURLINFO_CONTENT_TYPE: *param_charp = data->info.contenttype; break; |