From ea57bfda4fa7f7f038a42d56ad27650be3becd82 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 5 Nov 2013 10:02:26 +0100 Subject: handle db file signatures correctly --- pacredir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pacredir.c b/pacredir.c index 3d9760c..59fc153 100644 --- a/pacredir.c +++ b/pacredir.c @@ -299,8 +299,9 @@ static int ahc_echo(void * cls, struct MHD_Connection * connection, const char * /* clear context pointer */ *ptr = NULL; - /* process db file request */ - if (strlen(basename) > 3 && strcmp(basename + strlen(basename) - 3, ".db") == 0) { + /* process db file (and signature) request */ + if ((strlen(basename) > 3 && strcmp(basename + strlen(basename) - 3, ".db") == 0) || + (strlen(basename) > 7 && strcmp(basename + strlen(basename) - 7, ".db.sig") == 0)) { /* get timestamp of local file */ filename = malloc(strlen(SYNCPATH) + strlen(basename) + 2); sprintf(filename, SYNCPATH "/%s", basename); -- cgit v1.2.3-70-g09d2