Browse Source

maxchunkcount zero -> no limit

Julius Pfrommer 8 years ago
parent
commit
f69886831d
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/ua_securechannel.c

+ 4 - 3
src/ua_securechannel.c

@@ -139,9 +139,10 @@ UA_SecureChannel_sendChunk(UA_ChunkInfo *ci, UA_ByteString *dst, size_t offset)
     dst->length += UA_SECURE_MESSAGE_HEADER_LENGTH;
     offset += UA_SECURE_MESSAGE_HEADER_LENGTH;
 
-    if(++ci->chunksSoFar > connection->remoteConf.maxChunkCount ||
-       ci->messageSizeSoFar + offset > connection->remoteConf.maxMessageSize)
-        ci->errorCode = UA_STATUSCODE_BADTCPMESSAGETOOLARGE;
+    if(ci->messageSizeSoFar + offset > connection->remoteConf.maxMessageSize)
+        ci->errorCode = UA_STATUSCODE_BADRESPONSETOOLARGE;
+    if(++ci->chunksSoFar > connection->remoteConf.maxChunkCount && connection->remoteConf.maxChunkCount > 0)
+        ci->errorCode = UA_STATUSCODE_BADRESPONSETOOLARGE;
 
     /* Prepare the chunk headers */
     UA_SecureConversationMessageHeader respHeader;