Commit Graph

79 Commits

Author SHA1 Message Date
Flavio Fernandes
d6f07ed4e4 Adafruit_MQTT::publishPacket: Protect against memory corruption.
Avoid memory corruption from happening when data payload provided
in Adafruit_MQTT::publishPacket is greater than MAXBUFFERSIZE.

In order to do that, a helper function is being added to calculate
how much space is available for the payload after subtracting what
is used as the header.

Pull request https://github.com/adafruit/Adafruit_MQTT_Library/pull/166
Fixes https://github.com/adafruit/Adafruit_MQTT_Library/issues/109
Fixes https://github.com/adafruit/Adafruit_MQTT_Library/issues/122

Signed-off-by: Flavio Fernandes <flavio@flaviof.com>
2021-04-02 12:14:39 -04:00
Lucas Jandrew
f3f5c18c6d Reformatted with clang-format 2020-11-06 10:20:52 -05:00
Brent Rubell
4a409caf16
Merge branch 'master' into better-ping-handling 2020-08-04 10:38:19 -04:00
dherrada
148cfb3591
Moved to actions, no doxygen 2020-06-25 09:56:46 -04:00
Lucas Jandrew
8e8245d734 Removed code from my previous PR 2020-02-24 01:11:43 -05:00
Lucas Jandrew
5ea3e3ba72 Handle publish packets when they're not the expected packet type 2020-02-23 22:42:43 -05:00
Lucas Jandrew
259cba0837 Adds retain support for publishing messages 2020-02-19 19:15:27 -05:00
brentru
8780dd5491 increase mqtt sub. limit for non 32u4/328p devices 2018-08-27 14:51:29 -04:00
Todd Treece
3553074d45 bump lib to 0.17.0 2016-12-29 16:09:07 -05:00
Todd Treece
ae18e8a6c4 add platform ifdef for subscription length limit 2016-11-20 19:57:21 -05:00
Todd Treece
ceeedc2b3c bump to 0.16.1 2016-08-15 17:11:54 -04:00
Todd Treece
b61d7e7024 remove flashstring helper constructors & methods 2016-08-15 13:05:51 -04:00
Todd Treece
c56e1b935f bump to v0.16.0 2016-08-10 11:27:37 -04:00
ladyada
bdd08d443e fix esp, remove debug 2016-08-09 21:37:07 -04:00
ladyada
4b57d0ddcb remove progmem support (only FONA really needed it and its OK) 2016-08-09 15:52:08 -04:00
Todd Treece
ae113941a1 add version constants & bump version in library.properties 2016-08-05 14:59:40 -04:00
Todd Treece
49eda71d17 fix io callback scope issue 2016-07-29 15:06:54 -04:00
Todd Treece
ad83c09d20 add new sub callback typedef for io wrapper 2016-07-29 09:27:00 -04:00
Todd Treece
f793f8d2d0 allow unauthenticated connections to mqtt brokers 2016-07-13 15:57:00 -04:00
ladyada
82873050b6 add error output on dropped packets, and mqtt w/callbacks example 2016-07-08 17:16:07 -04:00
ladyada
4269d87492 callback support 2016-07-08 17:01:40 -04:00
ladyada
9ed79466b2 shorter suback timeout 2016-07-08 15:21:47 -04:00
ladyada
5d133c3852 updated publish half for long packet sendings! 2016-07-06 18:32:21 -04:00
ladyada
b26b4eb32c max receivable MQTT packet is 16 bits (tested with 300 byte packet receive)
also fixd buffer printer to have 16 bit length
2016-07-06 17:20:02 -04:00
Todd Treece
39f1169559 increase connect timeout to allow for 5 second ban response 2016-06-28 14:53:08 -04:00
ladyada
ab1a0938b9 smarter packet reading makes for faster publish-handling! also, retries subscriptions 3 times 2016-05-18 15:23:41 -04:00
ladyada
8f595cdb95 properly process packets until you get the one you want (prep for callback w/good retain support) 2016-02-08 23:36:25 -05:00
ladyada
79dd62468f add support for reading retained subscriptions (only works for one subscription since the pub packet gets eaten otherwise 2016-02-01 18:42:28 -05:00
Stuart Feichtinger
0d8c841af5 Clean up duplicate functions 2016-01-31 15:33:58 -06:00
Stuart Feichtinger
2876ac43dd Added generic buffer
Crashes when publishing to more than one stream
2016-01-17 19:27:20 -06:00
Kevin Townsend
9fb6fbf1e8 Updated WICED Feather macro 2016-01-05 16:11:27 +09:00
Kevin Townsend
bb7cdb5059 Added ARDUINO_STM32F2_FEATHER check 2015-12-03 11:49:10 +01:00
ladyada
dbc989ac1d essentially, add Zero support by shimming in the missing functions 2015-11-11 10:22:26 -05:00
ladyada
7c2b558ee9 ping flushes input, tries multiple times 2015-10-22 13:03:55 -04:00
Todd Treece
2aed9ae737 remove defaults from mqtt constructors 2015-10-22 10:09:16 -04:00
Todd Treece
371b16bfab Merge branch 'master' of github.com:adafruit/Adafruit_MQTT_Library into 3.1.1 2015-10-21 15:38:55 -04:00
ladyada
632c2f2cfe back compatible ping() 2015-10-21 00:15:27 -04:00
ladyada
286245ab62 compile fix & #ifdef the MQTT version 2015-10-21 00:05:46 -04:00
ladyada
15713af468 switch to MQTT 3.1.1 by default 2015-10-20 23:51:03 -04:00
Todd Treece
9a11d83cf5 removes client id from all example sketches 2015-10-05 15:26:02 -04:00
Todd Treece
b48265faed support anon auth & generated client id in constructor 2015-10-05 14:54:37 -04:00
Todd Treece
16da46aece renames disconnect to disconnectServer and adds disconnectPacket 2015-10-05 14:07:49 -04:00
Todd Treece
b9c9a28883 adds packet ids for publish QoS > 0
also adds packet id counter so packet ids aren't
static values. this is a step in the direction
of QoS 1 support
2015-10-05 11:21:05 -04:00
Todd Treece
765a2feaff remove broken while loop from ping() 2015-10-05 10:38:09 -04:00
Todd Treece
0fbd734646 adds unsubscribe & unsubscribePacket functions 2015-10-05 10:33:33 -04:00
Todd Treece
e9e154ab52 adds will support to the connect packet 2015-10-05 09:45:27 -04:00
Todd Treece
e60be3e972 adds unsubscribePacket method def 2015-10-05 09:27:31 -04:00
Todd Treece
b2a198af5a adds unsubscribe() method def 2015-10-05 09:26:06 -04:00
Todd Treece
b9a04c8be5 adds will() method def 2015-10-05 09:25:07 -04:00
Todd Treece
78d733aee3 define the missing MQTT control packets 2015-10-05 09:14:17 -04:00