Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
olsky committed Jun 9, 2016
1 parent 2a00282 commit dbc3e73
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
17 changes: 14 additions & 3 deletions c/mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#define PACK_MAJOR 1
#define PACK_MINOR 0
#define PACK_REVISION 5
#define PACK_REVISION 6
#define PACK_VERSION_NUMBER (PACK_MAJOR*10000+PACK_MINOR*100+PACK_REVISION)

#define MKATOM(n) ATOM_ ## n = PL_new_atom(#n);
Expand Down Expand Up @@ -708,7 +708,7 @@ c_mqtt_pub(term_t conn, term_t topic, term_t payload, term_t options)
//char buf[buf_len];
char* mqtt_topic = NULL;
char* mqtt_payload = NULL;
char* payload_type = NULL;
// char* payload_type = NULL;
int qos = 0;
int retain = 0;

Expand Down Expand Up @@ -805,7 +805,8 @@ c_mqtt_pub(term_t conn, term_t topic, term_t payload, term_t options)

CLEANUP:
PL_free(mqtt_topic);
PL_free(payload_type);
PL_free(mqtt_payload);
// PL_free(payload_type);

return result;
}
Expand Down Expand Up @@ -1069,6 +1070,16 @@ c_mqtt_connect(term_t conn, term_t host, term_t port, term_t options)
CLEANUP:
PL_free(mqtt_host);
PL_free(client_id);
PL_free(alias);

PL_free(hook_module);
PL_free(hook_on_log);
PL_free(hook_on_connect);
PL_free(hook_on_disconnect);
PL_free(hook_on_message);
PL_free(hook_on_publish);
PL_free(hook_on_subscribe);
PL_free(hook_on_unsubscribe);

return result;
}
Expand Down
Binary file modified lib/x86_64-linux/mqtt.so
Binary file not shown.
4 changes: 2 additions & 2 deletions pack.pl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name(mqtt).
title('mqtt - pub/sub pack for SWI-Prolog using mosquitto').
version('1.0.5').
version('1.0.6').
author('Oleh Lozynskyy', '[email protected]').
packager('Oleh Lozynskyy', '[email protected]').
maintainer('Oleh Lozynskyy', '[email protected]').
home('https://github.com/olsky/swi-mqtt-pack').
download('https://github.com/olsky/swi-mqtt-pack/releases/download/v1.0.5/mqtt-1.0.5.zip').
download('https://github.com/olsky/swi-mqtt-pack/releases/download/v1.0.6/mqtt-1.0.6.zip').
2 changes: 1 addition & 1 deletion prolog/mqtt.pl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
gensym(mqtt_conn_, A),
gensym(swi_mqtt_client, Cid),

mqtt_connect(Connection, Host, Port, [alias(A), client_id(Cid), keepalive(10), is_async(false)]),
mqtt_connect(Connection, Host, Port, [alias(A), client_id(Cid), keepalive(60), is_async(false)]),
true.

% mqtt_connect(-Connection, +Host, +Port, [Options])
Expand Down

0 comments on commit dbc3e73

Please sign in to comment.