{"action":"created","issue":{"url":"https://api.github.com/repos/acplt/open62541/issues/270","labels_url":"https://api.github.com/repos/acplt/open62541/issues/270/labels{/name}","comments_url":"https://api.github.com/repos/acplt/open62541/issues/270/comments","events_url":"https://api.github.com/repos/acplt/open62541/issues/270/events","html_url":"https://github.com/acplt/open62541/issues/270","id":87086811,"number":270,"title":"BADDECODING error when large message is not complete","user":{"login":"pfpmeijers","id":8824711,"avatar_url":"https://avatars.githubusercontent.com/u/8824711?v=3","gravatar_id":"","url":"https://api.github.com/users/pfpmeijers","html_url":"https://github.com/pfpmeijers","followers_url":"https://api.github.com/users/pfpmeijers/followers","following_url":"https://api.github.com/users/pfpmeijers/following{/other_user}","gists_url":"https://api.github.com/users/pfpmeijers/gists{/gist_id}","starred_url":"https://api.github.com/users/pfpmeijers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfpmeijers/subscriptions","organizations_url":"https://api.github.com/users/pfpmeijers/orgs","repos_url":"https://api.github.com/users/pfpmeijers/repos","events_url":"https://api.github.com/users/pfpmeijers/events{/privacy}","received_events_url":"https://api.github.com/users/pfpmeijers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-06-10T19:56:28Z","updated_at":"2015-06-18T17:15:42Z","closed_at":null,"body":"In case of sending large messages (e.g. large arrays) then BADDECODING errors occur.\r\n\r\nThis is a result from the function UA_Connection_completeMessages() which at open62541.c, line 5386, resets the returned buffer length to -1, in case the message is not complete yet:\r\n    if(end_pos == 0) {\r\n        /* no complete message in current */\r\n        connection->incompleteMessage = current;\r\n        UA_ByteString_init(&current);\r\n    }\r\n\r\nThe following change looks to fix the problem, but don't know if this is the preferred solution, or working in all cases.\r\nIn open62541.c, line 10485, the loop around the client->connection.recv() call, part of the sendReceiveRequest() function, I changed:\r\n   while(retval != UA_STATUSCODE_GOOD);\r\ninto \r\n  while(retval != UA_STATUSCODE_GOOD  || reply.length == -1);\r\n"},"comment":{"url":"https://api.github.com/repos/acplt/open62541/issues/comments/113224790","html_url":"https://github.com/acplt/open62541/issues/270#issuecomment-113224790","issue_url":"https://api.github.com/repos/acplt/open62541/issues/270","id":113224790,"user":{"login":"pfpmeijers","id":8824711,"avatar_url":"https://avatars.githubusercontent.com/u/8824711?v=3","gravatar_id":"","url":"https://api.github.com/users/pfpmeijers","html_url":"https://github.com/pfpmeijers","followers_url":"https://api.github.com/users/pfpmeijers/followers","following_url":"https://api.github.com/users/pfpmeijers/following{/other_user}","gists_url":"https://api.github.com/users/pfpmeijers/gists{/gist_id}","starred_url":"https://api.github.com/users/pfpmeijers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfpmeijers/subscriptions","organizations_url":"https://api.github.com/users/pfpmeijers/orgs","repos_url":"https://api.github.com/users/pfpmeijers/repos","events_url":"https://api.github.com/users/pfpmeijers/events{/privacy}","received_events_url":"https://api.github.com/users/pfpmeijers/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T17:15:42Z","updated_at":"2015-06-18T17:15:42Z","body":"@sten, you can also not reproduce with my script/test app? (I use linux 64\nbits.)\n\n\nOn Thu, Jun 18, 2015 at 6:15 PM, Sten Grüner <notifications@github.com>\nwrote:\n\n> @jpfr <https://github.com/jpfr> do you have a clue, Julius? I cannot\n> reproduce it here (32-bit linux) all array until 32768 perform good, 65536\n> fails as expected\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/acplt/open62541/issues/270#issuecomment-113205968>.\n>\n"}}