mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +00:00
Merge pull request #2551 from cesanta/mqttpayload
Avoid calling mg_send on no actual payload
This commit is contained in:
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -3990,7 +3990,7 @@ void mg_mqtt_pub(struct mg_connection *c, const struct mg_mqtt_opts *opts) {
|
|||||||
|
|
||||||
if (c->is_mqtt5) mg_send_mqtt_properties(c, opts->props, opts->num_props);
|
if (c->is_mqtt5) mg_send_mqtt_properties(c, opts->props, opts->num_props);
|
||||||
|
|
||||||
mg_send(c, opts->message.ptr, opts->message.len);
|
if (opts->message.len > 0) mg_send(c, opts->message.ptr, opts->message.len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mg_mqtt_sub(struct mg_connection *c, const struct mg_mqtt_opts *opts) {
|
void mg_mqtt_sub(struct mg_connection *c, const struct mg_mqtt_opts *opts) {
|
||||||
|
|||||||
+1
-1
@@ -338,7 +338,7 @@ void mg_mqtt_pub(struct mg_connection *c, const struct mg_mqtt_opts *opts) {
|
|||||||
|
|
||||||
if (c->is_mqtt5) mg_send_mqtt_properties(c, opts->props, opts->num_props);
|
if (c->is_mqtt5) mg_send_mqtt_properties(c, opts->props, opts->num_props);
|
||||||
|
|
||||||
mg_send(c, opts->message.ptr, opts->message.len);
|
if (opts->message.len > 0) mg_send(c, opts->message.ptr, opts->message.len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mg_mqtt_sub(struct mg_connection *c, const struct mg_mqtt_opts *opts) {
|
void mg_mqtt_sub(struct mg_connection *c, const struct mg_mqtt_opts *opts) {
|
||||||
|
|||||||
Reference in new issue
Block a user