Currently, the Agent drops the connection in case a partial packet is received. Which is not correct given that coreMQTT can handle partial packets correctly.
This PR fixes that by resetting the return value of the processCommand function when coreMQTT returns MQTTNeedMoreBytes.
Test Steps
Make sure that the server sends partial MQTT packets to the client. Without these changes, the library will terminate the connection.
With this change in place the library will not drop the connection and work correctly.
Checklist:
[x] I have tested my changes. No regression in existing tests.
[x] I have modified and/or added unit-tests to cover the code changes in this Pull Request.
Description
Currently, the Agent drops the connection in case a partial packet is received. Which is not correct given that coreMQTT can handle partial packets correctly.
This PR fixes that by resetting the return value of the
processCommand
function when coreMQTT returnsMQTTNeedMoreBytes
.Test Steps
Make sure that the server sends partial MQTT packets to the client. Without these changes, the library will terminate the connection. With this change in place the library will not drop the connection and work correctly.
Checklist:
Related Issue
https://github.com/FreeRTOS/coreMQTT-Agent/issues/102
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.