]> sjero.net Git - wget/blobdiff - src/http.c
[svn] Allocate a timer directly in get_contents.
[wget] / src / http.c
index a886f4883834d39e6533cc29d7a576173730a62e..4313176f33c7bdc457f2fed4453fde90e5e8b41d 100644 (file)
@@ -546,7 +546,6 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
   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
@@ -1344,13 +1343,12 @@ Refusing to truncate existing file `%s'.\n\n"), *hs->local_file);
      should be some overhead information.  */
   if (opt.save_headers)
     fwrite (all_headers, 1, all_length, fp);
-  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 = wtimer_elapsed (timer);
-  wtimer_delete (timer);
+                         &rbuf, keep_alive, &hs->dltime);
+
   {
     /* Close or flush the file.  We have to be careful to check for
        error here.  Checking the result of fwrite() is not enough --