From 6ae1eeb2ea3a2d91b065df17f8f62eb907e93e56 Mon Sep 17 00:00:00 2001 From: Carsten Schafer Date: Wed, 20 Aug 2025 14:10:16 -0400 Subject: [PATCH] Upgrade to debian bookworm, resolve compile issues, work around IOExceptions test Signed-off-by: Carsten Schafer --- Dockerfile | 4 ++-- src/AP_WS_Connection.cpp | 13 ++++++++++--- src/framework/MicroService.h | 1 + src/framework/MicroServiceFuncs.h | 1 + src/storage/storage_device.cpp | 19 +++++++++---------- 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index b1409954..536ce980 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG DEBIAN_VERSION=11.5-slim +ARG DEBIAN_VERSION=bookworm ARG POCO_VERSION=poco-tip-v2 ARG CPPKAFKA_VERSION=tip-v1 ARG VALIJASON_VERSION=tip-v1.0.2 @@ -100,7 +100,7 @@ RUN mkdir -p $APP_ROOT $APP_CONFIG && \ RUN apt-get update && apt-get install --no-install-recommends -y \ librdkafka++1 gosu gettext ca-certificates bash jq curl wget \ - libmariadb-dev-compat libpq5 unixodbc postgresql-client libfmt7 sqlite3 + libmariadb-dev-compat libpq5 unixodbc postgresql-client libfmt9 sqlite3 COPY readiness_check /readiness_check COPY test_scripts/curl/cli /cli diff --git a/src/AP_WS_Connection.cpp b/src/AP_WS_Connection.cpp index 0ea49640..65ae503b 100644 --- a/src/AP_WS_Connection.cpp +++ b/src/AP_WS_Connection.cpp @@ -627,8 +627,15 @@ namespace OpenWifi { bool KillConnection=false; try { - int Op, flags; - auto IncomingSize = WS_->receiveFrame(IncomingFrame, flags); + int Op, flags; + int IncomingSize; + //auto TS = Poco::Timespan(360, 0); + + //if (WS_->poll(TS, 1)) { + IncomingSize = WS_->receiveFrame(IncomingFrame, flags); + //} else{ + // return; + //} Op = flags & Poco::Net::WebSocket::FRAME_OP_BITMASK; @@ -775,7 +782,7 @@ namespace OpenWifi { E.displayText(), IncomingFrame.begin() == nullptr ? "" : IncomingFrame.begin(), State_.sessionId)); - KillConnection=true; + //KillConnection=true; } catch (const Poco::Exception &E) { poco_warning(Logger_, fmt::format("Exception({}): Text:{} Payload:{} Session:{}", CId_, diff --git a/src/framework/MicroService.h b/src/framework/MicroService.h index a991316f..b75ef625 100644 --- a/src/framework/MicroService.h +++ b/src/framework/MicroService.h @@ -14,6 +14,7 @@ #include #include #include +#include // This must be defined for poco_debug and poco_trace macros to function. diff --git a/src/framework/MicroServiceFuncs.h b/src/framework/MicroServiceFuncs.h index 2d22392e..25e06821 100644 --- a/src/framework/MicroServiceFuncs.h +++ b/src/framework/MicroServiceFuncs.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include "framework/OpenWifiTypes.h" diff --git a/src/storage/storage_device.cpp b/src/storage/storage_device.cpp index db65e0ee..885653c5 100644 --- a/src/storage/storage_device.cpp +++ b/src/storage/storage_device.cpp @@ -202,15 +202,14 @@ namespace OpenWifi { std::string st; std::string whereClause = ""; - if(!platform.empty()) { + if (!platform.empty()) { if (includeProvisioned == false) { - - whereClause = fmt::format("WHERE entity='' and venue='' and DeviceType='" + platform + "'"); + //whereClause = fmt::format("WHERE entity='' and venue='' and DeviceType='" + platform + "'"); + whereClause = fmt::format("WHERE entity='' and venue='' and DeviceType='{}'", platform); } else { - whereClause = fmt::format("WHERE DeviceType='" + platform + "'"); + //whereClause = fmt::format("WHERE DeviceType='" + platform + "'"); + whereClause = fmt::format("WHERE DeviceType='{}'", platform); } - - //st = "SELECT SerialNumber From Devices WHERE DeviceType='" + platform + "' "; } else { if (includeProvisioned == false) { @@ -218,7 +217,7 @@ namespace OpenWifi { } //st = "SELECT SerialNumber From Devices "; } - + st = fmt::format("SELECT SerialNumber From Devices {}", whereClause); if (orderBy.empty()) @@ -896,9 +895,9 @@ namespace OpenWifi { if (includeProvisioned == false) { whereClause = fmt::format("WHERE DeviceType='{}' and entity='' and venue=''",platform); } else { - whereClause = fmt::format("WHERE DeviceType='{}'", platform); + whereClause = fmt::format("WHERE DeviceType='{}'", platform); } - + } st = @@ -907,7 +906,7 @@ namespace OpenWifi { ComputeRange(From, HowMany)); //Logger().information(fmt::format(" GetDevices st is {} ", st)); - + Select << ConvertParams(st), Poco::Data::Keywords::into(Records); Select.execute();