diff options
author | Christian Hesse <mail@eworm.de> | 2016-10-12 15:23:59 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2016-10-12 15:23:59 +0200 |
commit | da27a0580f129c4ff8b969d2c2d67c0dd71f741d (patch) | |
tree | 929166c1a7a60a88304171d328b7affd3d3b5804 | |
parent | eb23dfb9712eef0b26762baabe578f8da89bf80f (diff) | |
download | paccache-da27a0580f129c4ff8b969d2c2d67c0dd71f741d.tar.gz paccache-da27a0580f129c4ff8b969d2c2d67c0dd71f741d.tar.zst |
calculate date/time string only when needed
-rw-r--r-- | pacredir.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -451,14 +451,15 @@ static int ahc_echo(void * cls, request = requests[i]; - /* write the time to buffer ctime, then strip the line break */ - ctime_r(&request->last_modified, ctime); - ctime[strlen(ctime) - 1] = '\0'; - if (request->http_code == MHD_HTTP_OK) { - if (verbose > 0) + if (verbose > 0) { + /* write the time to buffer ctime, then strip the line break */ + ctime_r(&request->last_modified, ctime); + ctime[strlen(ctime) - 1] = '\0'; + write_log(stdout, "Found: %s (%f sec, modified: %s)\n", request->url, request->time_total, ctime); + } } else if (verbose > 0 && request->http_code > 0) { if (verbose > 0) write_log(stderr, "Received HTTP status code %d for %s\n", |