aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-03-01 22:07:46 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-03-01 22:07:46 +0000
commit14e71a04d56c259214a7473f94814540d88fc596 (patch)
treef5bd25fa4d62edd83ae0ae5fdfd7b27979a0a1bb
parentcf23986a700a94973d3a920ac334c9032bc1404e (diff)
new variables added
-rw-r--r--lib/writeout.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/writeout.c b/lib/writeout.c
index ef887e2b1..789ab8cb0 100644
--- a/lib/writeout.c
+++ b/lib/writeout.c
@@ -46,10 +46,15 @@
typedef enum {
VAR_NONE, /* must be the first */
VAR_TOTAL_TIME,
+ VAR_NAMELOOKUP_TIME,
+ VAR_CONNECT_TIME,
+ VAR_PRETRANSFER_TIME,
VAR_SIZE_DOWNLOAD,
VAR_SIZE_UPLOAD,
VAR_SPEED_DOWNLOAD,
VAR_SPEED_UPLOAD,
+ VAR_HTTP_CODE,
+ VAR_EFFECTIVE_URL,
VAR_NUM_OF_VARS /* must be the last */
} replaceid;
@@ -60,7 +65,12 @@ struct variable {
static struct variable replacements[]={
+ {"effective_url", VAR_EFFECTIVE_URL},
+ {"http_code", VAR_HTTP_CODE},
{"total_time", VAR_TOTAL_TIME},
+ {"namelookup_time", VAR_NAMELOOKUP_TIME},
+ {"connect_time", VAR_CONNECT_TIME},
+ {"pretransfer_time", VAR_PRETRANSFER_TIME},
{"size_download", VAR_SIZE_DOWNLOAD},
{"size_upload", VAR_SIZE_UPLOAD},
{"speed_download", VAR_SPEED_DOWNLOAD},
@@ -89,9 +99,24 @@ void WriteOut(struct UrlData *data)
for(i=0; replacements[i].name; i++) {
if(strequal(ptr, replacements[i].name)) {
switch(replacements[i].id) {
+ case VAR_EFFECTIVE_URL:
+ fprintf(stream, "%s", data->url?data->url:"");
+ break;
case VAR_TOTAL_TIME:
fprintf(stream, "%.3f", data->progress.timespent);
break;
+ case VAR_NAMELOOKUP_TIME:
+ fprintf(stream, "%.3f", tvdiff(data->progress.t_nslookup,
+ data->progress.start));
+ break;
+ case VAR_CONNECT_TIME:
+ fprintf(stream, "%.3f", tvdiff(data->progress.t_connect,
+ data->progress.start));
+ break;
+ case VAR_PRETRANSFER_TIME:
+ fprintf(stream, "%.3f", tvdiff(data->progress.t_pretransfer,
+ data->progress.start));
+ break;
case VAR_SIZE_UPLOAD:
fprintf(stream, "%.0f", data->progress.uploaded);
break;