diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-11-15 11:25:39 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-11-15 11:25:39 +0000 |
commit | 8475a0df2f58a67466065249b5cb4df7ddb5bc12 (patch) | |
tree | 28fd2b93b65d6adfc684da1e4b080885f3be71d0 /src | |
parent | ccc4c9c02c7889996c1e7627191c536c081131fa (diff) |
new -w variables supported
Diffstat (limited to 'src')
-rw-r--r-- | src/writeout.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/writeout.c b/src/writeout.c index b60319b48..b396eeb70 100644 --- a/src/writeout.c +++ b/src/writeout.c @@ -57,6 +57,8 @@ typedef enum { VAR_EFFECTIVE_URL, VAR_CONTENT_TYPE, VAR_NUM_CONNECTS, + VAR_REDIRECT_TIME, + VAR_REDIRECT_COUNT, VAR_NUM_OF_VARS /* must be the last */ } replaceid; @@ -82,6 +84,8 @@ static struct variable replacements[]={ {"speed_upload", VAR_SPEED_UPLOAD}, {"content_type", VAR_CONTENT_TYPE}, {"num_connects", VAR_NUM_CONNECTS}, + {"time_redirect", VAR_REDIRECT_TIME}, + {"num_redirects", VAR_REDIRECT_COUNT}, {NULL, VAR_NONE} }; @@ -138,6 +142,16 @@ void ourWriteOut(CURL *curl, char *writeinfo) curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &longinfo)) fprintf(stream, "%ld", longinfo); break; + case VAR_REDIRECT_COUNT: + if(CURLE_OK == + curl_easy_getinfo(curl, CURLINFO_REDIRECT_COUNT, &longinfo)) + fprintf(stream, "%ld", longinfo); + break; + case VAR_REDIRECT_TIME: + if(CURLE_OK == + curl_easy_getinfo(curl, CURLINFO_REDIRECT_TIME, &doubleinfo)) + fprintf(stream, "%.3f", doubleinfo); + break; case VAR_TOTAL_TIME: if(CURLE_OK == curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &doubleinfo)) |