From 2b291efe08198038a495bac53d8899466b9d8366 Mon Sep 17 00:00:00 2001 From: Andreas Ebner Date: Fri, 21 Jun 2024 09:42:28 +0200 Subject: [PATCH] fix(server) check history backend for event support in history-read service --- src/server/ua_services_attribute.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/server/ua_services_attribute.c b/src/server/ua_services_attribute.c index 755305c1e6b..48ef05e0843 100644 --- a/src/server/ua_services_attribute.c +++ b/src/server/ua_services_attribute.c @@ -1990,6 +1990,14 @@ Service_HistoryRead(UA_Server *server, UA_Session *session, return; } + /* Check if the configured History-Backend supports the requested history type */ + if(!readHistory){ + UA_LOG_INFO_SESSION(server->config.logging, session, + "The configured HistoryBackend does not support the selected history-type."); + response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTSUPPORTED; + return; + } + /* Something to do? */ if(request->nodesToReadSize == 0) { response->responseHeader.serviceResult = UA_STATUSCODE_BADNOTHINGTODO;