Skip to content

Commit

Permalink
disable Persistence, this causing stack smashes using the defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
frett27 committed Sep 18, 2020
1 parent 249cfe5 commit 69853e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mqttlib.zig
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ pub const MqttCnx = struct {
zclientid[clientid.len] = '\x00';

// convert to C the input parameters (ensuring the sentinel)
const result = cmqtt.MQTTClient_create(&handle, zServerAddress.ptr, zclientid.ptr, 0, null);
const MQTTCLIENT_PERSISTENCE_NONE = 1;
const result = cmqtt.MQTTClient_create(&handle, zServerAddress.ptr, zclientid.ptr, MQTTCLIENT_PERSISTENCE_NONE, null);

if (result > 0) return error.MQTTCreateError;
const HEADER = [_]u8{ 'M', 'Q', 'T', 'C' };
Expand Down Expand Up @@ -162,6 +163,7 @@ pub const MqttCnx = struct {
.retained = 0,
.dup = 0,
.msgid = 0,
// below, these are MQTTV5 specific properties
.properties = cmqtt.MQTTProperties{
.count = 0,
.max_count = 0,
Expand Down

0 comments on commit 69853e8

Please sign in to comment.