mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
mqtt: Fixes setting the length of the last will message
It was previously using the length of the topic for the message. It would break if the topic and message were not the same length.
This commit is contained in:
parent
69f2ad9ced
commit
12f20503b4
1 changed files with 1 additions and 1 deletions
|
@ -111,7 +111,7 @@ lws_mqtt_client_send_connect(struct lws *wsi)
|
|||
memcpy(p, c->will.topic->buf, c->will.topic->len);
|
||||
p += c->will.topic->len;
|
||||
if (lws_mqtt_str_is_not_empty(c->will.message)) {
|
||||
lws_ser_wu16be(p, c->will.topic->len);
|
||||
lws_ser_wu16be(p, c->will.message->len);
|
||||
p += 2;
|
||||
memcpy(p, c->will.message->buf,
|
||||
c->will.message->len);
|
||||
|
|
Loading…
Add table
Reference in a new issue