소스 검색

workaround for #496

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);