瀏覽代碼

do not try to process an empty message

When no message is complete and no error occurred,
an empty message is returned.
Julius Pfrommer 7 年之前
父節點
當前提交
414032bcf9
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/server/ua_server_binary.c

+ 6 - 0
src/server/ua_server_binary.c

@@ -614,6 +614,12 @@ processBinaryMessage(UA_Server *server, UA_Connection *connection,
                      UA_ByteString *message) {
     UA_Boolean realloced = UA_FALSE;
     UA_StatusCode retval = UA_Connection_completeMessages(connection, message, &realloced);
+
+    /* No failure, but no chunk ready */
+    if(message->length == 0)
+        return;
+
+    /* Failed to complete a chunk */
     if(retval != UA_STATUSCODE_GOOD) {
         if(!realloced)
             connection->releaseRecvBuffer(connection, message);