Skip to content

Commit 69853e8

Browse files
committed
disable Persistence, this causing stack smashes using the defaults
1 parent 249cfe5 commit 69853e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mqttlib.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ pub const MqttCnx = struct {
8585
zclientid[clientid.len] = '\x00';
8686

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

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

0 commit comments

Comments
 (0)