diff options
author | Paul Gevers <elbrus@debian.org> | 2021-06-21 21:39:58 +0200 |
---|---|---|
committer | Paul Gevers <elbrus@debian.org> | 2021-06-25 21:00:48 +0200 |
commit | e1f963ad34d9d70d252a7485dfd71deb5af57721 (patch) | |
tree | 1f8809a912f57662350974dcbea4810582f3b09e | |
parent | 21a80e8ef7c609ca6be5347929f3af97bcc2f496 (diff) |
Add fix-regression-microseconds-instead-of-seconds.patch
Closes: #989064
-rw-r--r-- | debian/patches/fix-regression-microseconds-instead-of-seconds.patch | 87 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 88 insertions, 0 deletions
diff --git a/debian/patches/fix-regression-microseconds-instead-of-seconds.patch b/debian/patches/fix-regression-microseconds-instead-of-seconds.patch new file mode 100644 index 00000000..4bec1e8e --- /dev/null +++ b/debian/patches/fix-regression-microseconds-instead-of-seconds.patch @@ -0,0 +1,87 @@ +From bc7ecc71c0c11d22fdbe6415a7945bfc43dc3c33 Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg <daniel@haxx.se> +Date: Tue, 15 Dec 2020 08:09:29 +0100 +Subject: [PATCH] =?UTF-8?q?too=C4=BA=5Fwriteout:=20fix=20the=20-w=20time?= + =?UTF-8?q?=20output=20units?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fix regression from commit fc813f80e1bcac (#6248) that changed the unit +to microseconds instead of seconds with fractions + +Reported-by: 不确定 +Fixes #6321 +Closes #6322 +--- + src/tool_writeout.c | 22 +++++++++++++++------- + 1 file changed, 15 insertions(+), 7 deletions(-) + +diff --git a/src/tool_writeout.c b/src/tool_writeout.c +index c12738c439aa..8b9f590053e5 100644 +--- a/src/tool_writeout.c ++++ b/src/tool_writeout.c +@@ -106,6 +106,14 @@ static const struct writeoutvar variables[] = { + 0, JSON_NONE} + }; + ++static void us2sec(FILE *stream, curl_off_t us) ++{ ++ curl_off_t secs = us / 1000000; ++ us %= 1000000; ++ fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU ".%06" CURL_FORMAT_CURL_OFF_TU, ++ secs, us); ++} ++ + void ourWriteOut(CURL *curl, struct per_transfer *per, const char *writeinfo) + { + FILE *stream = stdout; +@@ -190,41 +198,41 @@ void ourWriteOut(CURL *curl, struct per_transfer *per, const char *writeinfo) + case VAR_REDIRECT_TIME: + if(CURLE_OK == + curl_easy_getinfo(curl, CURLINFO_REDIRECT_TIME_T, &offinfo)) +- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo); ++ us2sec(stream, offinfo); + break; + case VAR_TOTAL_TIME: + if(CURLE_OK == + curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME_T, &offinfo)) +- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo); ++ us2sec(stream, offinfo); + break; + case VAR_NAMELOOKUP_TIME: + if(CURLE_OK == + curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME_T, + &offinfo)) +- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo); ++ us2sec(stream, offinfo); + break; + case VAR_CONNECT_TIME: + if(CURLE_OK == + curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME_T, &offinfo)) +- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo); ++ us2sec(stream, offinfo); + break; + case VAR_APPCONNECT_TIME: + if(CURLE_OK == + curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME_T, + &offinfo)) +- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo); ++ us2sec(stream, offinfo); + break; + case VAR_PRETRANSFER_TIME: + if(CURLE_OK == + curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME_T, + &offinfo)) +- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo); ++ us2sec(stream, offinfo); + break; + case VAR_STARTTRANSFER_TIME: + if(CURLE_OK == + curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME_T, + &offinfo)) +- fprintf(stream, "%" CURL_FORMAT_CURL_OFF_TU, offinfo); ++ us2sec(stream, offinfo); + break; + case VAR_SIZE_UPLOAD: + if(CURLE_OK == diff --git a/debian/patches/series b/debian/patches/series index 48fa80b2..6f8097b7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -7,6 +7,7 @@ 13_fix-man-formatting.patch 14_transfer-strip-credentials-from-the-auto-referer-hea.patch 15_vtls-add-isproxy-argument-to-Curl_ssl_get-addsession.patch +fix-regression-microseconds-instead-of-seconds.patch # do not add patches below 90_gnutls.patch |