CURLINFO_RESPONSE_CODE replaces CURLINFO_HTTP_CODE

This commit is contained in:
Daniel Stenberg 2003-08-20 15:42:24 +00:00
Родитель d00e4a377b
Коммит 5974309d10
4 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -979,7 +979,7 @@ time_t curl_getdate(const char *p, const time_t *now);
typedef enum { typedef enum {
CURLINFO_NONE, /* first, never use this */ CURLINFO_NONE, /* first, never use this */
CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, 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_TOTAL_TIME = CURLINFO_DOUBLE + 3,
CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
@ -1005,6 +1005,10 @@ typedef enum {
CURLINFO_LASTONE = 23 CURLINFO_LASTONE = 23
} CURLINFO; } 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 { typedef enum {
CURLCLOSEPOLICY_NONE, /* first, never use this */ CURLCLOSEPOLICY_NONE, /* first, never use this */

Просмотреть файл

@ -103,7 +103,7 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
case CURLINFO_EFFECTIVE_URL: case CURLINFO_EFFECTIVE_URL:
*param_charp = data->change.url?data->change.url:(char *)""; *param_charp = data->change.url?data->change.url:(char *)"";
break; break;
case CURLINFO_HTTP_CODE: case CURLINFO_RESPONSE_CODE:
*param_longp = data->info.httpcode; *param_longp = data->info.httpcode;
break; break;
case CURLINFO_HTTP_CONNECTCODE: case CURLINFO_HTTP_CONNECTCODE:

Просмотреть файл

@ -44,7 +44,7 @@ struct
} variables[14] = } variables[14] =
{ {
{"curl_url_effective", CURLINFO_EFFECTIVE_URL, writeenv_STRING}, {"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_total", CURLINFO_TOTAL_TIME, writeenv_DOUBLE},
{"curl_time_namelookup", CURLINFO_NAMELOOKUP_TIME, writeenv_DOUBLE}, {"curl_time_namelookup", CURLINFO_NAMELOOKUP_TIME, writeenv_DOUBLE},
{"curl_time_connect", CURLINFO_CONNECT_TIME, writeenv_DOUBLE}, {"curl_time_connect", CURLINFO_CONNECT_TIME, writeenv_DOUBLE},

Просмотреть файл

@ -118,7 +118,7 @@ void ourWriteOut(CURL *curl, char *writeinfo)
break; break;
case VAR_HTTP_CODE: case VAR_HTTP_CODE:
if(CURLE_OK == if(CURLE_OK ==
curl_easy_getinfo(curl, CURLINFO_HTTP_CODE, &longinfo)) curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &longinfo))
fprintf(stream, "%03d", longinfo); fprintf(stream, "%03d", longinfo);
break; break;
case VAR_HEADER_SIZE: case VAR_HEADER_SIZE: