Stasik0 преди 9 години
родител
ревизия
8a808b24f5
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      src/server/ua_subscription.c

+ 3 - 0
src/server/ua_subscription.c

@@ -470,6 +470,9 @@ void MonitoredItem_QueuePushDataValue(UA_Server *server, UA_MonitoredItem *monit
     newValueAsByteString.length = 512; // Todo: Hack! We should make a copy of the value, not encode it. UA_calcSizeBinary(&newvalue->value, &UA_TYPES[UA_TYPES_DATAVALUE]);
     newValueAsByteString.data   = UA_malloc(newValueAsByteString.length);
     UA_StatusCode retval = UA_encodeBinary(&newvalue->value, &UA_TYPES[UA_TYPES_DATAVALUE], &newValueAsByteString, &encodingOffset);
+    //FIXME: Stasik0 workaround to fix due to the absence of calcSizeBinary #496, still a better solution is needed to ensure the comparisson works for values greater than 512 bytes
+    newValueAsByteString.length = encodingOffset;
+
     if(retval != UA_STATUSCODE_GOOD)
         UA_ByteString_deleteMembers(&newValueAsByteString);