CURLINFO_RESPONSE_CODE replaces CURLINFO_HTTP_CODE
This commit is contained in:
Родитель
d00e4a377b
Коммит
5974309d10
|
@ -979,7 +979,7 @@ time_t curl_getdate(const char *p, const time_t *now);
|
|||
typedef enum {
|
||||
CURLINFO_NONE, /* first, never use this */
|
||||
CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
|
||||
CURLINFO_HTTP_CODE = CURLINFO_LONG + 2,
|
||||
CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
|
||||
CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
|
||||
CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
|
||||
CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
|
||||
|
@ -1005,6 +1005,10 @@ typedef enum {
|
|||
CURLINFO_LASTONE = 23
|
||||
} CURLINFO;
|
||||
|
||||
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
|
||||
CURLINFO_HTTP_CODE */
|
||||
#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
|
||||
|
||||
typedef enum {
|
||||
CURLCLOSEPOLICY_NONE, /* first, never use this */
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
|
|||
case CURLINFO_EFFECTIVE_URL:
|
||||
*param_charp = data->change.url?data->change.url:(char *)"";
|
||||
break;
|
||||
case CURLINFO_HTTP_CODE:
|
||||
case CURLINFO_RESPONSE_CODE:
|
||||
*param_longp = data->info.httpcode;
|
||||
break;
|
||||
case CURLINFO_HTTP_CONNECTCODE:
|
||||
|
|
|
@ -44,7 +44,7 @@ struct
|
|||
} variables[14] =
|
||||
{
|
||||
{"curl_url_effective", CURLINFO_EFFECTIVE_URL, writeenv_STRING},
|
||||
{"curl_http_code", CURLINFO_HTTP_CODE, writeenv_LONG},
|
||||
{"curl_http_code", CURLINFO_RESPONSE_CODE, writeenv_LONG},
|
||||
{"curl_time_total", CURLINFO_TOTAL_TIME, writeenv_DOUBLE},
|
||||
{"curl_time_namelookup", CURLINFO_NAMELOOKUP_TIME, writeenv_DOUBLE},
|
||||
{"curl_time_connect", CURLINFO_CONNECT_TIME, writeenv_DOUBLE},
|
||||
|
|
|
@ -118,7 +118,7 @@ void ourWriteOut(CURL *curl, char *writeinfo)
|
|||
break;
|
||||
case VAR_HTTP_CODE:
|
||||
if(CURLE_OK ==
|
||||
curl_easy_getinfo(curl, CURLINFO_HTTP_CODE, &longinfo))
|
||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &longinfo))
|
||||
fprintf(stream, "%03d", longinfo);
|
||||
break;
|
||||
case VAR_HEADER_SIZE:
|
||||
|
|
Загрузка…
Ссылка в новой задаче