aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2014-06-16 12:24:50 +0200
committerGravatar Christian Hesse <mail@eworm.de>2014-06-16 12:24:50 +0200
commit39f4363447961e50cec3eb6baa6df8bb80371860 (patch)
tree58149068de9b411751bd3b392607b3e2cb7a3499
parent1b8d77c7217bd5244c8272df43ffa71d915c74ae (diff)
downloadpacredir-39f4363447961e50cec3eb6baa6df8bb80371860.tar.gz
pacredir-39f4363447961e50cec3eb6baa6df8bb80371860.tar.zst
print modification datprint modification date
-rw-r--r--pacredir.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pacredir.c b/pacredir.c
index cee1bdb..11153c9 100644
--- a/pacredir.c
+++ b/pacredir.c
@@ -309,6 +309,7 @@ static int ahc_echo(void * cls, struct MHD_Connection * connection, const char *
struct request * request = NULL;
long http_code = 0, last_modified = 0;
double time_total = INFINITY;
+ char ctime[26];
/* we want the filename, not the path */
basename = uri;
@@ -406,8 +407,11 @@ static int ahc_echo(void * cls, struct MHD_Connection * connection, const char *
request = requests[i];
+ ctime_r(&request->last_modified, ctime);
+ ctime[strlen(ctime) - 1] = 0;
+
if (request->http_code == MHD_HTTP_OK)
- write_log(stdout, "Found: %s (%f sec)\n", request->url, request->time_total);
+ write_log(stdout, "Found: %s (%f sec, modified: %s)\n", request->url, request->time_total, ctime);
if (request->http_code == MHD_HTTP_OK &&
/* for db files choose the most recent server */