diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-02-25 07:40:49 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-02-25 07:40:49 +0000 |
commit | 95e601e2b142063642923f4ab2bb5cb32960520e (patch) | |
tree | cff478eba983532fd6a66afc9967c6e22932d160 /src | |
parent | b1ffe7b74a4235efa70908d9052922171fd51e14 (diff) |
"Yet Another Geek" made %{content_type} work in the -w/--writeout option.
Diffstat (limited to 'src')
-rw-r--r-- | src/writeout.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/writeout.c b/src/writeout.c index a786d2d07..70457929c 100644 --- a/src/writeout.c +++ b/src/writeout.c @@ -46,6 +46,7 @@ typedef enum { VAR_HEADER_SIZE, VAR_REQUEST_SIZE, VAR_EFFECTIVE_URL, + VAR_CONTENT_TYPE, VAR_NUM_OF_VARS /* must be the last */ } replaceid; @@ -69,6 +70,7 @@ static struct variable replacements[]={ {"size_upload", VAR_SIZE_UPLOAD}, {"speed_download", VAR_SPEED_DOWNLOAD}, {"speed_upload", VAR_SPEED_UPLOAD}, + {"content_type", VAR_CONTENT_TYPE}, {NULL, 0} }; @@ -165,6 +167,11 @@ void ourWriteOut(CURL *curl, char *writeinfo) curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; + case VAR_CONTENT_TYPE: + if(CURLE_OK == + curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &stringp)) + fputs(stringp, stream); + break; default: break; } |