1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

-w supports size_header and size_request

This commit is contained in:
Daniel Stenberg 2000-10-04 13:08:17 +00:00
parent 5865860ad6
commit ccd0f07c41

View File

@ -59,6 +59,8 @@ typedef enum {
VAR_SPEED_DOWNLOAD, VAR_SPEED_DOWNLOAD,
VAR_SPEED_UPLOAD, VAR_SPEED_UPLOAD,
VAR_HTTP_CODE, VAR_HTTP_CODE,
VAR_HEADER_SIZE,
VAR_REQUEST_SIZE,
VAR_EFFECTIVE_URL, VAR_EFFECTIVE_URL,
VAR_NUM_OF_VARS /* must be the last */ VAR_NUM_OF_VARS /* must be the last */
} replaceid; } replaceid;
@ -76,6 +78,8 @@ static struct variable replacements[]={
{"time_namelookup", VAR_NAMELOOKUP_TIME}, {"time_namelookup", VAR_NAMELOOKUP_TIME},
{"time_connect", VAR_CONNECT_TIME}, {"time_connect", VAR_CONNECT_TIME},
{"time_pretransfer", VAR_PRETRANSFER_TIME}, {"time_pretransfer", VAR_PRETRANSFER_TIME},
{"size_header", VAR_HEADER_SIZE},
{"size_request", VAR_REQUEST_SIZE},
{"size_download", VAR_SIZE_DOWNLOAD}, {"size_download", VAR_SIZE_DOWNLOAD},
{"size_upload", VAR_SIZE_UPLOAD}, {"size_upload", VAR_SIZE_UPLOAD},
{"speed_download", VAR_SPEED_DOWNLOAD}, {"speed_download", VAR_SPEED_DOWNLOAD},
@ -120,6 +124,16 @@ void ourWriteOut(CURL *curl, char *writeinfo)
curl_easy_getinfo(curl, CURLINFO_HTTP_CODE, &longinfo)) curl_easy_getinfo(curl, CURLINFO_HTTP_CODE, &longinfo))
fprintf(stream, "%03d", longinfo); fprintf(stream, "%03d", longinfo);
break; break;
case VAR_HEADER_SIZE:
if(CURLE_OK ==
curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &longinfo))
fprintf(stream, "%d", longinfo);
break;
case VAR_REQUEST_SIZE:
if(CURLE_OK ==
curl_easy_getinfo(curl, CURLINFO_REQUEST_SIZE, &longinfo))
fprintf(stream, "%d", longinfo);
break;
case VAR_TOTAL_TIME: case VAR_TOTAL_TIME:
if(CURLE_OK == if(CURLE_OK ==
curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &doubleinfo)) curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &doubleinfo))