]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Use Last-Modified header
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 10 Mar 2016 14:03:29 +0000 (14:03 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 10 Mar 2016 14:03:29 +0000 (14:03 +0000)
src/libutil/map.c

index 0a4f2d74ec48f0fe6941959616bc562d7378eddd..35e0b9a278bcd7e291a90ec5f277a73230270289 100644 (file)
@@ -259,6 +259,13 @@ http_map_finish (struct rspamd_http_connection *conn,
        if (msg->code == 200) {
 
                if (cbd->stage == map_load_file) {
+                       if (msg->last_modified) {
+                               cbd->data->last_checked = msg->last_modified;
+                       }
+                       else {
+                               cbd->data->last_checked = msg->date;
+                       }
+
                        /* Maybe we need to check signature ? */
                        if (map->is_signed) {
                                close (cbd->out_fd);
@@ -386,7 +393,6 @@ http_map_finish (struct rspamd_http_connection *conn,
                map->fin_callback (map->pool, &cbd->cbdata);
 
                *map->user_data = cbd->cbdata.cur_data;
-               cbd->data->last_checked = msg->date;
                msg_info_pool ("read map data from %s", cbd->data->host);
        }
        else if (msg->code == 304 && cbd->stage == map_load_file) {