From 22a85bd4e1f6005455b91bb3edff68d4019526a1 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 27 Jun 2026 13:05:03 +0100 Subject: Increase size field to 64bit and fix scan types 2^31 not big enough for large file downloads, bumped to 64bit. Replace woolly types with specific uintXX_t in scn call. --- src/ingestor.cpp | 6 +++--- src/ingestor.hpp | 7 ++++--- src/schema.sql | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/ingestor.cpp b/src/ingestor.cpp index 16638eb..ff5cd92 100644 --- a/src/ingestor.cpp +++ b/src/ingestor.cpp @@ -192,9 +192,9 @@ namespace WebStat { QuotedString, // path : "%u" : "/foo/bar" QueryString, // query_string : "%q" : "?query=string" or "" std::string_view, // protocol : %r : HTTPS/2.0 - unsigned short, // status : %>s : 200 - unsigned int, // size : %B : 1234 - unsigned int, // duration : %D : 1234 + uint16_t, // status : %>s : 200 + uint64_t, // size : %B : 1234 + uint32_t, // duration : %D : 1234 CLFString, // referrer : "%{Referer}i" : "https://google.com/whatever" or "-" CLFString, // user_agent : "%{User-agent}i" : "Chromium v123.4" or "-" CLFString // content_type : "%{Content-type}o" : "test/plain" or "-" diff --git a/src/ingestor.hpp b/src/ingestor.hpp index 8808ed8..ce4ac09 100644 --- a/src/ingestor.hpp +++ b/src/ingestor.hpp @@ -61,9 +61,10 @@ namespace WebStat { virtual ~Ingestor(); SPECIAL_MEMBERS_DELETE(Ingestor); - using ScanResult = decltype(scn::scan(std::declval(), "")); + using ScanResult + = decltype(scn::scan( + std::declval(), "")); using ScanValues = std::remove_cvref_t()->values())>; [[nodiscard]] static ScanResult scanLogLine(std::string_view); diff --git a/src/schema.sql b/src/schema.sql index bd0dcfe..81080ff 100644 --- a/src/schema.sql +++ b/src/schema.sql @@ -107,7 +107,7 @@ CREATE TABLE access_log( path integer NOT NULL, query_string integer, status smallint NOT NULL, - size integer NOT NULL, + size bigint NOT NULL, duration interval second(6) NOT NULL, referrer integer, user_agent integer, -- cgit v1.3