diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-06-27 13:05:03 +0100 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-06-27 13:05:03 +0100 |
| commit | 22a85bd4e1f6005455b91bb3edff68d4019526a1 (patch) | |
| tree | 1b11874bfc8fa270cff32954157d2cdf7ca66fc5 | |
| parent | 1a7c5329d07d9d961899aa7c85f9bd56fc06cb2d (diff) | |
| download | webstat-22a85bd4e1f6005455b91bb3edff68d4019526a1.tar.bz2 webstat-22a85bd4e1f6005455b91bb3edff68d4019526a1.tar.xz webstat-22a85bd4e1f6005455b91bb3edff68d4019526a1.zip | |
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.
| -rw-r--r-- | src/ingestor.cpp | 6 | ||||
| -rw-r--r-- | src/ingestor.hpp | 7 | ||||
| -rw-r--r-- | 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::string_view, std::string_view, uint64_t, std::string_view, - QuotedString, QueryString, std::string_view, unsigned short, unsigned int, unsigned int, CLFString, - CLFString, CLFString>(std::declval<std::string_view>(), "")); + using ScanResult + = decltype(scn::scan<std::string_view, std::string_view, uint64_t, std::string_view, QuotedString, + QueryString, std::string_view, uint16_t, uint64_t, uint32_t, CLFString, CLFString, CLFString>( + std::declval<std::string_view>(), "")); using ScanValues = std::remove_cvref_t<decltype(std::declval<WebStat::Ingestor::ScanResult>()->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, |
