|
@@ -13,7 +13,7 @@ UA_ByteString UA_Connection_completeMessages(UA_Connection *connection, UA_ByteS
|
|
|
if(received.length == -1)
|
|
|
return received;
|
|
|
|
|
|
- /* concat received to the incomplete message we have */
|
|
|
+ /* concat the existing incomplete message with the new message */
|
|
|
UA_ByteString current;
|
|
|
if(connection->incompleteMessage.length < 0)
|
|
|
current = received;
|
|
@@ -58,14 +58,15 @@ UA_ByteString UA_Connection_completeMessages(UA_Connection *connection, UA_ByteS
|
|
|
end_pos += length;
|
|
|
}
|
|
|
|
|
|
- if(current.length == 0) { /* throw everything away */
|
|
|
+ if(current.length == 0) {
|
|
|
+ /* throw everything away */
|
|
|
UA_String_deleteMembers(¤t);
|
|
|
current.length = -1;
|
|
|
return current;
|
|
|
}
|
|
|
|
|
|
- /* retain the incomplete message at the end */
|
|
|
if(end_pos == 0) {
|
|
|
+ /* no complete message in current */
|
|
|
connection->incompleteMessage = current;
|
|
|
UA_String_init(current);
|
|
|
} else if(current.length != end_pos) {
|