]> git.meshlink.io Git - meshlink/blobdiff - src/protocol_misc.c
Improve support for submeshes.
[meshlink] / src / protocol_misc.c
index 5ec01d9253405e82849779905f02b66a42bf0ee0..d0401b93be299bddd5e232fda3f3bf6688ee6d58 100644 (file)
@@ -72,7 +72,7 @@ bool send_ping(meshlink_handle_t *mesh, connection_t *c) {
        c->status.pinged = true;
        c->last_ping_time = mesh->loop.now.tv_sec;
 
-       return send_request(mesh, c, "%d", PING);
+       return send_request(mesh, c, NULL, "%d", PING);
 }
 
 bool ping_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
@@ -81,7 +81,7 @@ bool ping_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
 }
 
 bool send_pong(meshlink_handle_t *mesh, connection_t *c) {
-       return send_request(mesh, c, "%d", PONG);
+       return send_request(mesh, c, NULL, "%d", PONG);
 }
 
 bool pong_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
@@ -94,8 +94,11 @@ bool pong_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
        if(c->outgoing) {
                c->outgoing->timeout = 0;
                c->outgoing->cfg = NULL;
-               if(c->outgoing->ai)
+
+               if(c->outgoing->ai) {
                        freeaddrinfo(c->outgoing->ai);
+               }
+
                c->outgoing->ai = NULL;
                c->outgoing->aip = NULL;
        }