1
0
mirror of https://github.com/FreeRTOS/coreMQTT synced 2025-05-16 23:34:43 +08:00

8 Commits

Author SHA1 Message Date
Archit Aggarwal
0a2172b896
Fixes in internal logic of sending packets (#124)
* Fix issue of data recv being interrupted

* Rename elapsedTimeMs variable to its express its new meaning

* Use configuration const for recvExact timeout

* Remove timeout check from discardPacket and address CI check failures

* Fix more CI check failures

* Remove another unused local variable

* Re-instate timeout in discard to reduce scope of changes

* Remove unused variable again

* Fix failing unit test

* Rename new config macro, and attempt to fix CBMC failures

* Doc: Improvement suggestions from code review

Co-authored-by: Muneeb Ahmed <54290492+muneebahmed10@users.noreply.github.com>

* Fix quality check failures

* Add test case to check partial network reads with zero timeout duration for ProcessLoop

* style: Improving naming

* Address complexity failure

* Address comments

* Doc: Add blocking time equation of Receive/ProcessLoop functions in their API doc

* Improvement in API doc

* Set MQTT_RECV_POLLING_TIMEOUT_MS so that recvExact runs in one iteration always for cbmc.

* doc: Add information about zero return value for Transport_Recv_t

* fix: prevent possibility of infinite loop in timeout logic of ProcessLoop

* style: Minor changes

* hygiene: minor name fix

* fix: Possibility of infinite loop in sendPacket

* Add the new configuration to doxygen

* test: Add mock transport send function that always returns zero

* fix: Issues in sendPacket and sendPublish

* test: add test for sendPacket timeout

* Update Timer Overflow test

* test: temporarily comment out unused variable

* test: fix the timer overflow test

* Address review comments

* style: make log messages concise

Co-authored-by: Muneeb Ahmed <54290492+muneebahmed10@users.noreply.github.com>

Co-authored-by: Muneeb Ahmed <54290492+muneebahmed10@users.noreply.github.com>
Co-authored-by: Sarena Meas <sarem@amazon.com>
2020-12-07 10:37:26 -08:00
Archit Aggarwal
b581fc4172
Bugfix: Fix interrupted network read operation (#120)
### Problem

The `MQTT_ProcessLoop` and `MQTT_ReceiveLoop` read incoming MQTT packet payload over the network by calling the `recvExact` function. The `recvExact` function can be called multiple times to read the expected number of bytes for the MQTT packet but it also implements a timeout functionality of receiving the expected number of payload within the timeout value passed to the function.
This causes problems when the `Transport_Recv` call returns less than requested number of bytes, and there is a timeout (for example, when calling `MQTT_ProcessLoop` with 0ms duration) which causes the function to assume failure instead of reading the remaining payload of the MQTT packet by calling `Transport_Recv` again. Thus, in such cases, the MQTT connection is severed prematurely even though there is a high probability of receiving the remaining bytes of the MQTT packet over the network.

### Solution
Instead of implementing a timeout on the entire duration of receiving the expected number of remaining MQTT packet bytes in `recvExact`, the use of timeout is being changed to be relevant only on the total time of receiving 0 bytes over the network over multiple calls to `Transport_Recv`.
As this modified meaning of the timeout duration is now unrelated to the timeout duration that the `MQTT_ProcessLoop` or `MQTT_ReceiveLoop` functions are called, a new configuration constant for the `recvExact` timeout value, `MQTT_RECV_POLLING_TIMEOUT_MS`, has been added to the library which will carry a default value of 10ms. 

Co-authored-by: Sarena Meas <sarem@amazon.com>
2020-12-04 19:49:40 -08:00
SarenaAWS
4b8674a806
Update all references from master to main. (#110) 2020-11-18 12:27:01 -08:00
Sukhmani Minhas
7c2361792c
Update memory estimates for the coreMQTT source code using the ARM GCC toolchain. (#101) 2020-11-03 12:16:50 -08:00
SarenaAWS
651832c359
Delete irrelevant comment about memory estimation. (#65)
* Delete irrelevant comment about memory estimation.

* Update the library name and the version to uppercase V.

* Update config.doxyfile
2020-09-16 11:40:19 -07:00
Oscar Michael Abrina
8a2f465e00
Update code sizes in documentation (#54)
* Update code sizes after adding verison number

* Round as much as possible when multiplying by 1024

* Add code size when no optimisation is used

* Update totals

* Change MQTT RC1 to coreMQTT

* Add link to gcc arm toolchain

* Update link

* Use english spellings

Co-authored-by: Gary Wicker <14828980+gkwicker@users.noreply.github.com>
2020-09-14 19:54:08 -07:00
Archit Aggarwal
28a0d090e3
Update MQTT 3.1.1 compliance text in doxygen and change log (#57)
* Update wording about 3.1.1 compliance

* Address review comments
2020-09-14 15:40:28 -07:00
Oscar Michael Abrina
ff2725df6f
Change file extension (#58) 2020-09-14 13:53:53 -07:00