1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

ss: mqtt: fix wrong QoS value on Birth message

This commit is contained in:
Chunho Lee 2022-02-02 16:46:20 -08:00 committed by Andy Green
parent 84956d280a
commit 3a98dbb918

View file

@ -1,7 +1,7 @@
/*
* libwebsockets - small server side websockets and web server implementation
*
* Copyright (C) 2019 - 2021 Andy Green <andy@warmcat.com>
* Copyright (C) 2019 - 2022 Andy Green <andy@warmcat.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -187,6 +187,7 @@ secstream_mqtt_publish(struct lws *wsi, uint8_t *buf, size_t buflen,
mqpp.topic_len = (uint16_t)strlen(mqpp.topic);
mqpp.packet_id = (uint16_t)(h->txord - 1);
mqpp.qos = qos;
mqpp.payload = buf;
if (h->writeable_len)
mqpp.payload_len = (uint32_t)h->writeable_len;
@ -196,8 +197,6 @@ secstream_mqtt_publish(struct lws *wsi, uint8_t *buf, size_t buflen,
lwsl_notice("%s: payload len %d\n", __func__,
(int)mqpp.payload_len);
mqpp.qos = h->policy->u.mqtt.qos;
if (lws_mqtt_client_send_publish(wsi, &mqpp,
(const char *)buf,
(uint32_t)buflen,