diff options
Diffstat (limited to 'src/tool_writeout_json.c')
-rw-r--r-- | src/tool_writeout_json.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/tool_writeout_json.c b/src/tool_writeout_json.c index 70235c209..dfe51b9ff 100644 --- a/src/tool_writeout_json.c +++ b/src/tool_writeout_json.c @@ -105,7 +105,7 @@ static int writeString(FILE *str, CURL *curl, const char *key, CURLINFO ci) static int writeLong(FILE *str, CURL *curl, const char *key, CURLINFO ci) { - curl_off_t val = 0; + long val = 0; if(CURLE_OK == curl_easy_getinfo(curl, ci, &val)) { fprintf(str, "\"%s\":%ld", key, val); return 1; @@ -113,6 +113,16 @@ static int writeLong(FILE *str, CURL *curl, const char *key, CURLINFO ci) return 0; } +static int writeOffset(FILE *str, CURL *curl, const char *key, CURLINFO ci) +{ + curl_off_t val = 0; + if(CURLE_OK == curl_easy_getinfo(curl, ci, &val)) { + fprintf(str, "\"%s\":%" CURL_FORMAT_CURL_OFF_T, key, val); + return 1; + } + return 0; +} + static int writeFilename(FILE *str, const char *key, const char *filename) { if(filename) { @@ -160,6 +170,9 @@ void ourWriteOutJSON(const struct writeoutvar mappings[], CURL *curl, case JSON_LONG: ok = writeLong(stream, curl, name, cinfo); break; + case JSON_OFFSET: + ok = writeOffset(stream, curl, name, cinfo); + break; case JSON_TIME: ok = writeTime(stream, curl, name, cinfo); break; |