]> sjero.net Git - wget/blobdiff - src/http.c
[svn] New timer functions. Published in <sxs8zkp28vk.fsf@florida.arsdigita.de>.
[wget] / src / http.c
index 7b9578d19d35288a844810a7be8a0cc9ba773f7d..22fabdc6360793f05d7f4d160480a9af6adb9a39 100644 (file)
@@ -526,6 +526,7 @@ gethttp (struct urlinfo *u, struct http_stat *hs, int *dt)
   static SSL_CTX *ssl_ctx = NULL;
   SSL *ssl = NULL;
 #endif /* HAVE_SSL */
+  struct wget_timer *timer;
   char *cookies = NULL;
 
   /* Whether this connection will be kept alive after the HTTP request
@@ -1333,12 +1334,13 @@ Accept: %s\r\n\
      should be some overhead information.  */
   if (opt.save_headers)
     fwrite (all_headers, 1, all_length, fp);
-  reset_timer ();
+  timer = wtimer_new ();
   /* Get the contents of the document.  */
   hs->res = get_contents (sock, fp, &hs->len, hs->restval,
                          (contlen != -1 ? contlen : 0),
                          &rbuf, keep_alive);
-  hs->dltime = elapsed_time ();
+  hs->dltime = wtimer_elapsed (timer);
+  wtimer_delete (timer);
   {
     /* Close or flush the file.  We have to be careful to check for
        error here.  Checking the result of fwrite() is not enough --