]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
getinfo: add CURLINFO_POSTTRANSFER_TIME_T
authorAlex Snast <alexsn@meta.com>
Mon, 15 Jul 2024 08:52:50 +0000 (11:52 +0300)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 15 Aug 2024 07:02:58 +0000 (09:02 +0200)
Returns the time, in microseconds, from the start until the last byte is
sent by libcurl (i.e. the request is sent off).

Closes #14189

18 files changed:
.github/workflows/linux.yml
docs/cmdline-opts/write-out.md
docs/libcurl/curl_easy_getinfo.md
docs/libcurl/opts/CURLINFO_POSTTRANSFER_TIME_T.md [new file with mode: 0644]
docs/libcurl/opts/Makefile.inc
docs/libcurl/symbols-in-versions
include/curl/curl.h
lib/getinfo.c
lib/progress.c
lib/request.c
lib/urldata.h
src/tool_writeout.c
src/tool_writeout.h
tests/data/test1541
tests/data/test970
tests/data/test972
tests/libtest/lib1541.c
tests/libtest/lib500.c

index 367abddc68ede8aa067f415e2179f6592c6e3265..d378d9294a22703f91f9f35fd0db176465730097 100644 (file)
@@ -169,6 +169,7 @@ jobs:
           - name: hyper
             install_steps: rust hyper valgrind
             configure: LDFLAGS="-Wl,-rpath,$HOME/hyper/target/debug" --with-openssl --with-hyper=$HOME/hyper --enable-debug --enable-websockets
+            tflags: '!500'
             singleuse: --unit
 
           - name: rustls
index acfb59dcc52df941181797ff2e4e6a0ee0ed28e3..3f8af2b5e3e19e16327a5bccf2772c80e3286ff4 100644 (file)
@@ -221,6 +221,10 @@ remote host (or proxy) was completed.
 The time, in seconds, it took from the start until the name resolving was
 completed.
 
+## `time_posttransfer`
+The time it took from the start until the last byte is sent by libcurl.
+In microseconds. (Added in 8.10.0)
+
 ## `time_pretransfer`
 The time, in seconds, it took from the start until the file transfer was just
 about to begin. This includes all pre-transfer commands and negotiations that
index ce328d6c56c34943ecac71e0a19d5b3ead1086aa..7157cd21131bd58f58664af3619002fdeeea51fe 100644 (file)
@@ -180,6 +180,11 @@ See CURLINFO_NUM_CONNECTS(3)
 
 The errno from the last failure to connect. See CURLINFO_OS_ERRNO(3)
 
+## CURLINFO_POSTTRANSFER_TIME_T
+
+The time it took from the start until the last byte is sent by libcurl.
+In microseconds. (Added in 8.10.0) See CURLINFO_POSTTRANSFER_TIME_T(3)
+
 ## CURLINFO_PRETRANSFER_TIME
 
 The time it took from the start until the file transfer is just about to
@@ -375,15 +380,17 @@ An overview of the time values available from curl_easy_getinfo(3)
         |--|--|--CONNECT
         |--|--|--|--APPCONNECT
         |--|--|--|--|--PRETRANSFER
-        |--|--|--|--|--|--STARTTRANSFER
-        |--|--|--|--|--|--|--TOTAL
-        |--|--|--|--|--|--|--REDIRECT
+        |--|--|--|--|--|--POSTTRANSFER
+        |--|--|--|--|--|--|--STARTTRANSFER
+        |--|--|--|--|--|--|--|--TOTAL
+        |--|--|--|--|--|--|--|--REDIRECT
 
 
  CURLINFO_QUEUE_TIME_T(3), CURLINFO_NAMELOOKUP_TIME_T(3),
  CURLINFO_CONNECT_TIME_T(3), CURLINFO_APPCONNECT_TIME_T(3),
- CURLINFO_PRETRANSFER_TIME_T(3), CURLINFO_STARTTRANSFER_TIME_T(3),
- CURLINFO_TOTAL_TIME_T(3), CURLINFO_REDIRECT_TIME_T(3)
+ CURLINFO_PRETRANSFER_TIME_T(3), CURLINFO_POSTTRANSFER_TIME_T(3),
+ CURLINFO_STARTTRANSFER_TIME_T(3), CURLINFO_TOTAL_TIME_T(3),
+ CURLINFO_REDIRECT_TIME_T(3)
 
 # %PROTOCOLS%
 
diff --git a/docs/libcurl/opts/CURLINFO_POSTTRANSFER_TIME_T.md b/docs/libcurl/opts/CURLINFO_POSTTRANSFER_TIME_T.md
new file mode 100644 (file)
index 0000000..5d81a59
--- /dev/null
@@ -0,0 +1,69 @@
+---
+c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
+SPDX-License-Identifier: curl
+Title: CURLINFO_POSTTRANSFER_TIME_T
+Section: 3
+Source: libcurl
+See-also:
+  - CURLINFO_PRETRANSFER_TIME_T (3)
+  - CURLOPT_TIMEOUT (3)
+  - curl_easy_getinfo (3)
+  - curl_easy_setopt (3)
+Protocol:
+  - All
+Added-in: 8.10.0
+---
+
+# NAME
+
+CURLINFO_POSTTRANSFER_TIME_T - get the time until the last byte is sent
+
+# SYNOPSIS
+
+~~~c
+#include <curl/curl.h>
+
+CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_POSTTRANSFER_TIME_T,
+                           curl_off_t *timep);
+~~~
+
+# DESCRIPTION
+
+Pass a pointer to a curl_off_t to receive the time, in microseconds,
+it took from the start until the last byte is sent by libcurl.
+
+When a redirect is followed, the time from each request is added together.
+
+See also the TIMES overview in the curl_easy_getinfo(3) man page.
+
+# %PROTOCOLS%
+
+# EXAMPLE
+
+~~~c
+int main(void)
+{
+  CURL *curl = curl_easy_init();
+  if(curl) {
+    CURLcode res;
+    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
+    res = curl_easy_perform(curl);
+    if(CURLE_OK == res) {
+      curl_off_t posttransfer;
+      res = curl_easy_getinfo(curl, CURLINFO_POSTTRANSFER_TIME_T, &posttransfer);
+      if(CURLE_OK == res) {
+        printf("Request sent after: %" CURL_FORMAT_CURL_OFF_T ".%06ld us", posttransfer / 1000000,
+               (long)(posttransfer % 1000000));
+      }
+    }
+    /* always cleanup */
+    curl_easy_cleanup(curl);
+  }
+}
+~~~
+
+# %AVAILABILITY%
+
+# RETURN VALUE
+
+Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
index f09c5863d39be6f55f2a5c5461f57b06a85c93b8..edabe37a7534d09e139b4b8f84a9c74fc8d13bd2 100644 (file)
@@ -58,6 +58,7 @@ man_MANS =                                      \
   CURLINFO_OS_ERRNO.3                           \
   CURLINFO_PRETRANSFER_TIME.3                   \
   CURLINFO_PRETRANSFER_TIME_T.3                 \
+  CURLINFO_POSTTRANSFER_TIME_T.3                \
   CURLINFO_PRIMARY_IP.3                         \
   CURLINFO_PRIMARY_PORT.3                       \
   CURLINFO_PRIVATE.3                            \
index ebf2cee2931edb71f46a4c4e5438b5444c7f4c85..69246c013d53f95cc92a2388fb01c758ecdd5b7c 100644 (file)
@@ -462,6 +462,7 @@ CURLINFO_OFF_T                  7.55.0
 CURLINFO_OS_ERRNO               7.12.2
 CURLINFO_PRETRANSFER_TIME       7.4.1
 CURLINFO_PRETRANSFER_TIME_T     7.61.0
+CURLINFO_POSTTRANSFER_TIME_T    8.10.0
 CURLINFO_PRIMARY_IP             7.19.0
 CURLINFO_PRIMARY_PORT           7.21.0
 CURLINFO_PRIVATE                7.10.3
index 67c816cfb53a35aede58ee404cdf90a62a901967..e37394174ac7dfb6e42a15d2a59de8c9b9d8aecc 100644 (file)
@@ -2953,7 +2953,8 @@ typedef enum {
   CURLINFO_CONN_ID          = CURLINFO_OFF_T + 64,
   CURLINFO_QUEUE_TIME_T     = CURLINFO_OFF_T + 65,
   CURLINFO_USED_PROXY       = CURLINFO_LONG + 66,
-  CURLINFO_LASTONE          = 66
+  CURLINFO_POSTTRANSFER_TIME_T = CURLINFO_OFF_T + 67,
+  CURLINFO_LASTONE          = 67
 } CURLINFO;
 
 /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
index 03bf85ae65eaa725717b5b22ee510bc7fbcbd9a9..c05d3c9d37fa829668b55a0a3f5ccdbcb30e4f79 100644 (file)
@@ -53,6 +53,7 @@ CURLcode Curl_initinfo(struct Curl_easy *data)
   pro->t_connect = 0;
   pro->t_appconnect = 0;
   pro->t_pretransfer = 0;
+  pro->t_posttransfer = 0;
   pro->t_starttransfer = 0;
   pro->timespent = 0;
   pro->t_redirect = 0;
@@ -368,6 +369,7 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info,
     case CURLINFO_CONNECT_TIME_T:
     case CURLINFO_APPCONNECT_TIME_T:
     case CURLINFO_PRETRANSFER_TIME_T:
+    case CURLINFO_POSTTRANSFER_TIME_T:
     case CURLINFO_STARTTRANSFER_TIME_T:
     case CURLINFO_REDIRECT_TIME_T:
     case CURLINFO_SPEED_DOWNLOAD_T:
@@ -418,6 +420,9 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info,
   case CURLINFO_PRETRANSFER_TIME_T:
     *param_offt = data->progress.t_pretransfer;
     break;
+  case CURLINFO_POSTTRANSFER_TIME_T:
+    *param_offt = data->progress.t_posttransfer;
+    break;
   case CURLINFO_STARTTRANSFER_TIME_T:
     *param_offt = data->progress.t_starttransfer;
     break;
index 67f4ba9c305e86ebddbdef47e81ae92aa58d632e..52fecf2d6fa06742b2f64761112fc923ef8dae2b 100644 (file)
@@ -217,7 +217,7 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer,
       break;
     }
   case TIMER_POSTRANSFER:
-    /* this is the normal end-of-transfer thing */
+    delta = &data->progress.t_posttransfer;
     break;
   case TIMER_REDIRECT:
     data->progress.t_redirect = Curl_timediff_us(timestamp,
index c42f2e667782f3d682feb3b1ccbe329b2adec985..a38be46833de25cf9ad5b8019bb16f96ab211042 100644 (file)
@@ -258,6 +258,7 @@ CURLcode Curl_req_set_upload_done(struct Curl_easy *data)
   data->req.upload_done = TRUE;
   data->req.keepon &= ~(KEEP_SEND|KEEP_SEND_TIMED); /* we are done sending */
 
+  Curl_pgrsTime(data, TIMER_POSTRANSFER);
   Curl_creader_done(data, data->req.upload_aborted);
 
   if(data->req.upload_aborted) {
index 096665440ca2e3e7a37a243ad70bd2e01101d7f6..d16e00dfe508522bacf362fd381e7ea6d80b70cd 100644 (file)
@@ -1091,6 +1091,7 @@ struct Progress {
   timediff_t t_connect;
   timediff_t t_appconnect;
   timediff_t t_pretransfer;
+  timediff_t t_posttransfer;
   timediff_t t_starttransfer;
   timediff_t t_redirect;
 
index 20945cf48034ed1d414e2e480e13a6ccc1a2bb69..7892b68a8b380dbc07ed679e8ef593f101832a52 100644 (file)
@@ -119,6 +119,8 @@ static const struct writeoutvar variables[] = {
   {"time_connect", VAR_CONNECT_TIME, CURLINFO_CONNECT_TIME_T, writeTime},
   {"time_namelookup", VAR_NAMELOOKUP_TIME, CURLINFO_NAMELOOKUP_TIME_T,
    writeTime},
+  {"time_posttransfer", VAR_POSTTRANSFER_TIME, CURLINFO_POSTTRANSFER_TIME_T,
+   writeTime},
   {"time_pretransfer", VAR_PRETRANSFER_TIME, CURLINFO_PRETRANSFER_TIME_T,
    writeTime},
   {"time_redirect", VAR_REDIRECT_TIME, CURLINFO_REDIRECT_TIME_T, writeTime},
index 36b218cc447ab37d2e9ddd32cf09f92905824ef1..77ceaff1c4c8a8c3708594134fd0c6091abf5a63 100644 (file)
@@ -77,6 +77,7 @@ typedef enum {
   VAR_NUM_RETRY,
   VAR_ONERROR,
   VAR_PRETRANSFER_TIME,
+  VAR_POSTTRANSFER_TIME,
   VAR_PRIMARY_IP,
   VAR_PRIMARY_PORT,
   VAR_PROXY_SSL_VERIFY_RESULT,
index 5094c3513cfcc2e7b1740de1def4f11a32531b9f..9b29f43534e35a80653c9769fbee0abfd7ac5ea7 100644 (file)
@@ -36,6 +36,7 @@ Transfer-Encoding: chunked
 datad474
 CURLINFO_CONNECT_TIME_T on done is OK
 CURLINFO_PRETRANSFER_TIME_T on done is OK
+CURLINFO_POSTTRANSFER_TIME_T on done is OK
 CURLINFO_STARTTRANSFER_TIME_T on done is OK
 CURLINFO_APPCONNECT_TIME_T on done is OK
 CURLINFO_SPEED_DOWNLOAD_T on done is OK
index bf1235da580fd2281c81f84f863b3a75a3d131b1..98997973850349888aea4ca6e40f319cc965f54e 100644 (file)
@@ -59,7 +59,7 @@ Accept: */*
 \r
 </protocol>
 <stdout nonewline="yes">
-{"certs":"","conn_id":0,"content_type":"text/html","errormsg":null,"exitcode":0,"filename_effective":"%LOGDIR/out%TESTNUMBER","ftp_entry_path":null,"http_code":200,"http_connect":0,"http_version":"1.1","local_ip":"127.0.0.1","local_port":13,"method":"GET","num_certs":0,"num_connects":1,"num_headers":9,"num_redirects":0,"num_retries":0,"proxy_ssl_verify_result":0,"proxy_used":0,"redirect_url":null,"referer":null,"remote_ip":"%HOSTIP","remote_port":%HTTPPORT,"response_code":200,"scheme":"http","size_download":445,"size_header":4019,"size_request":4019,"size_upload":0,"speed_download":13,"speed_upload":13,"ssl_verify_result":0,"time_appconnect":0.000013,"time_connect":0.000013,"time_namelookup":0.000013,"time_pretransfer":0.000013,"time_redirect":0.000013,"time_starttransfer":0.000013,"time_total":0.000013,"url":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","url.fragment":null,"url.host":"127.0.0.1","url.options":null,"url.password":null,"url.path":"/%TESTNUMBER","url.port":"%HTTPPORT","url.query":null,"url.scheme":"http","url.user":null,"url.zoneid":null,"url_effective":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","urle.fragment":null,"urle.host":"127.0.0.1","urle.options":null,"urle.password":null,"urle.path":"/%TESTNUMBER","urle.port":"%HTTPPORT","urle.query":null,"urle.scheme":"http","urle.user":null,"urle.zoneid":null,"urlnum":0,"xfer_id":0,"curl_version":"curl-unit-test-fake-version"}
+{"certs":"","conn_id":0,"content_type":"text/html","errormsg":null,"exitcode":0,"filename_effective":"%LOGDIR/out%TESTNUMBER","ftp_entry_path":null,"http_code":200,"http_connect":0,"http_version":"1.1","local_ip":"127.0.0.1","local_port":13,"method":"GET","num_certs":0,"num_connects":1,"num_headers":9,"num_redirects":0,"num_retries":0,"proxy_ssl_verify_result":0,"proxy_used":0,"redirect_url":null,"referer":null,"remote_ip":"%HOSTIP","remote_port":%HTTPPORT,"response_code":200,"scheme":"http","size_download":445,"size_header":4019,"size_request":4019,"size_upload":0,"speed_download":13,"speed_upload":13,"ssl_verify_result":0,"time_appconnect":0.000013,"time_connect":0.000013,"time_namelookup":0.000013,"time_posttransfer":0.000013,"time_pretransfer":0.000013,"time_redirect":0.000013,"time_starttransfer":0.000013,"time_total":0.000013,"url":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","url.fragment":null,"url.host":"127.0.0.1","url.options":null,"url.password":null,"url.path":"/%TESTNUMBER","url.port":"%HTTPPORT","url.query":null,"url.scheme":"http","url.user":null,"url.zoneid":null,"url_effective":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","urle.fragment":null,"urle.host":"127.0.0.1","urle.options":null,"urle.password":null,"urle.path":"/%TESTNUMBER","urle.port":"%HTTPPORT","urle.query":null,"urle.scheme":"http","urle.user":null,"urle.zoneid":null,"urlnum":0,"xfer_id":0,"curl_version":"curl-unit-test-fake-version"}
 </stdout>
 </verify>
 </testcase>
index c6def2986717ed110492068787fd184a4e4ca3e1..01bd2ed5fe7f87eb5be5565e312d325e89523353 100644 (file)
@@ -60,7 +60,7 @@ Accept: */*
 \r
 </protocol>
 <stdout mode="text">
-{"certs":"","conn_id":0,"content_type":"text/html","errormsg":null,"exitcode":0,"filename_effective":"%LOGDIR/out%TESTNUMBER","ftp_entry_path":null,"http_code":200,"http_connect":0,"http_version":"1.1","local_ip":"127.0.0.1","local_port":13,"method":"GET","num_certs":0,"num_connects":1,"num_headers":9,"num_redirects":0,"num_retries":0,"proxy_ssl_verify_result":0,"proxy_used":0,"redirect_url":null,"referer":null,"remote_ip":"%HOSTIP","remote_port":%HTTPPORT,"response_code":200,"scheme":"http","size_download":445,"size_header":4019,"size_request":4019,"size_upload":0,"speed_download":13,"speed_upload":13,"ssl_verify_result":0,"time_appconnect":0.000013,"time_connect":0.000013,"time_namelookup":0.000013,"time_pretransfer":0.000013,"time_redirect":0.000013,"time_starttransfer":0.000013,"time_total":0.000013,"url":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","url.fragment":null,"url.host":"127.0.0.1","url.options":null,"url.password":null,"url.path":"/%TESTNUMBER","url.port":"%HTTPPORT","url.query":null,"url.scheme":"http","url.user":null,"url.zoneid":null,"url_effective":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","urle.fragment":null,"urle.host":"127.0.0.1","urle.options":null,"urle.password":null,"urle.path":"/%TESTNUMBER","urle.port":"%HTTPPORT","urle.query":null,"urle.scheme":"http","urle.user":null,"urle.zoneid":null,"urlnum":0,"xfer_id":0,"curl_version":"curl-unit-test-fake-version"}
+{"certs":"","conn_id":0,"content_type":"text/html","errormsg":null,"exitcode":0,"filename_effective":"%LOGDIR/out%TESTNUMBER","ftp_entry_path":null,"http_code":200,"http_connect":0,"http_version":"1.1","local_ip":"127.0.0.1","local_port":13,"method":"GET","num_certs":0,"num_connects":1,"num_headers":9,"num_redirects":0,"num_retries":0,"proxy_ssl_verify_result":0,"proxy_used":0,"redirect_url":null,"referer":null,"remote_ip":"%HOSTIP","remote_port":%HTTPPORT,"response_code":200,"scheme":"http","size_download":445,"size_header":4019,"size_request":4019,"size_upload":0,"speed_download":13,"speed_upload":13,"ssl_verify_result":0,"time_appconnect":0.000013,"time_connect":0.000013,"time_namelookup":0.000013,"time_posttransfer":0.000013,"time_pretransfer":0.000013,"time_redirect":0.000013,"time_starttransfer":0.000013,"time_total":0.000013,"url":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","url.fragment":null,"url.host":"127.0.0.1","url.options":null,"url.password":null,"url.path":"/%TESTNUMBER","url.port":"%HTTPPORT","url.query":null,"url.scheme":"http","url.user":null,"url.zoneid":null,"url_effective":"http://%HOSTIP:%HTTPPORT/%TESTNUMBER","urle.fragment":null,"urle.host":"127.0.0.1","urle.options":null,"urle.password":null,"urle.path":"/%TESTNUMBER","urle.port":"%HTTPPORT","urle.query":null,"urle.scheme":"http","urle.user":null,"urle.zoneid":null,"urlnum":0,"xfer_id":0,"curl_version":"curl-unit-test-fake-version"}
 </stdout>
 </verify>
 </testcase>
index f326211d46efb9093a5e28a5ff1e61939c87c6b0..640a2f16900992accd80bb773dc85c4c5bb9e364 100644 (file)
@@ -137,6 +137,7 @@ CURLcode test(char *URL)
 
   check_time(curls, KN(CURLINFO_CONNECT_TIME_T), "done");
   check_time(curls, KN(CURLINFO_PRETRANSFER_TIME_T), "done");
+  check_time(curls, KN(CURLINFO_POSTTRANSFER_TIME_T), "done");
   check_time(curls, KN(CURLINFO_STARTTRANSFER_TIME_T), "done");
   /* no SSL, must be 0 */
   check_time0(curls, KN(CURLINFO_APPCONNECT_TIME_T), "done");
index b117862903526aa25800ad1604302b65ac000b6f..8b27aef04abb9e9c62b2407112d09640d6dcbd4f 100644 (file)
@@ -101,6 +101,7 @@ CURLcode test(char *URL)
         curl_off_t time_namelookup;
         curl_off_t time_connect;
         curl_off_t time_pretransfer;
+        curl_off_t time_posttransfer;
         curl_off_t time_starttransfer;
         curl_off_t time_total;
         fprintf(moo, "IP %s\n", ipstr);
@@ -108,6 +109,8 @@ CURLcode test(char *URL)
         curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME_T, &time_connect);
         curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME_T,
                           &time_pretransfer);
+        curl_easy_getinfo(curl, CURLINFO_POSTTRANSFER_TIME_T,
+                          &time_posttransfer);
         curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME_T,
                           &time_starttransfer);
         curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME_T, &time_total);
@@ -128,6 +131,14 @@ CURLcode test(char *URL)
                   (time_pretransfer / 1000000),
                   (long)(time_pretransfer % 1000000));
         }
+        if(time_pretransfer > time_posttransfer) {
+          fprintf(moo, "pretransfer vs posttransfer: %" CURL_FORMAT_CURL_OFF_T
+                  ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n",
+                  (time_pretransfer / 1000000),
+                  (long)(time_pretransfer % 1000000),
+                  (time_posttransfer / 1000000),
+                  (long)(time_posttransfer % 1000000));
+        }
         if(time_pretransfer > time_starttransfer) {
           fprintf(moo, "pretransfer vs starttransfer: %" CURL_FORMAT_CURL_OFF_T
                   ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n",
@@ -143,6 +154,13 @@ CURLcode test(char *URL)
                   (long)(time_starttransfer % 1000000),
                   (time_total / 1000000), (long)(time_total % 1000000));
         }
+        if(time_posttransfer > time_total) {
+          fprintf(moo, "posttransfer vs total: %" CURL_FORMAT_CURL_OFF_T
+                  ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n",
+                  (time_posttransfer / 1000000),
+                  (long)(time_posttransfer % 1000000),
+                  (time_total / 1000000), (long)(time_total % 1000000));
+        }
 
         fclose(moo);
       }