Skip to content

Commit

Permalink
fix(pubsub): Only check message timeout if message is valid (open6254…
Browse files Browse the repository at this point in the history
…1#6786)

This issue has already been resolved on the master branch with commit
c4686f6.
  • Loading branch information
keba-estr authored and jpfr committed Oct 24, 2024
1 parent c9228e9 commit 68bf6a3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/pubsub/ua_pubsub_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,17 +848,6 @@ UA_DataSetReader_process(UA_Server *server, UA_ReaderGroup *rg,

UA_LOG_DEBUG_READER(server->config.logging, dsr, "Received a network message");

#ifdef UA_ENABLE_PUBSUB_MONITORING
UA_DataSetReader_checkMessageReceiveTimeout(server, dsr);
#endif

if(dsr->state != UA_PUBSUBSTATE_OPERATIONAL &&
dsr->state != UA_PUBSUBSTATE_PREOPERATIONAL) {
UA_LOG_WARNING_READER(server->config.logging, dsr,
"Received a network message but not operational");
return;
}

if(!msg->header.dataSetMessageValid) {
UA_LOG_INFO_READER(server->config.logging, dsr,
"DataSetMessage is discarded: message is not valid");
Expand All @@ -882,6 +871,17 @@ UA_DataSetReader_process(UA_Server *server, UA_ReaderGroup *rg,
return;
}

#ifdef UA_ENABLE_PUBSUB_MONITORING
UA_DataSetReader_checkMessageReceiveTimeout(server, dsr);
#endif

if(dsr->state != UA_PUBSUBSTATE_OPERATIONAL &&
dsr->state != UA_PUBSUBSTATE_PREOPERATIONAL) {
UA_LOG_WARNING_READER(server->config.logging, dsr,
"Received a network message but not operational");
return;
}

/* Process message with raw encoding. We have no field-count information for
* the message. */
if(msg->header.fieldEncoding == UA_FIELDENCODING_RAWDATA) {
Expand Down

0 comments on commit 68bf6a3

Please sign in to comment.