Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing update of adlist.date_updated #1565

Merged
merged 3 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ set(sources
FTL.h
gc.c
gc.h
gravity-tools.c
gravity-tools.h
log.c
log.h
main.c
Expand Down
2 changes: 1 addition & 1 deletion src/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// LUA dependencies
#include "lua/ftl_lua.h"
// gravity_parseList()
#include "gravity-tools.h"
#include "tools/gravity-parseList.h"
// run_dhcp_discover()
#include "tools/dhcp-discover.h"
// run_arp_scan()
Expand Down
2 changes: 2 additions & 0 deletions src/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ set(tools_sources
arp-scan.h
dhcp-discover.c
dhcp-discover.h
gravity-parseList.c
gravity-parseList.h
)

add_library(tools OBJECT ${tools_sources})
Expand Down
8 changes: 4 additions & 4 deletions src/gravity-tools.c → src/tools/gravity-parseList.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* Network-wide ad blocking via your own hardware.
*
* FTL Engine
* Gravity tools collection routines
* Gravity parseList routines
*
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */

#include "gravity-tools.h"
#include "tools/gravity-parseList.h"
#include "args.h"
#include <regex.h>
#include "database/sqlite3.h"
Expand Down Expand Up @@ -317,7 +317,7 @@ int gravity_parseList(const char *infile, const char *outfile, const char *adlis
}

// Update number of domains on this list
sql = "UPDATE adlist SET number = ?, invalid_domains = ? WHERE id = ?;";
sql = "UPDATE adlist SET number = ?, invalid_domains = ?, date_updated = cast(strftime('%s', 'now') as int) WHERE id = ?;";
if(sqlite3_prepare_v2(db, sql, -1, &stmt, NULL) != SQLITE_OK)
{
printf("%s %s Unable to prepare SQL statement to update adlist properties in database file %s\n",
Expand Down Expand Up @@ -406,4 +406,4 @@ int gravity_parseList(const char *infile, const char *outfile, const char *adlis

// Return success
return EXIT_SUCCESS;
}
}
2 changes: 1 addition & 1 deletion src/gravity-tools.h → src/tools/gravity-parseList.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Network-wide ad blocking via your own hardware.
*
* FTL Engine
* Gravity tools collection prototypes
* Gravity parseList prototypes
*
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */
Expand Down