]> git.meshlink.io Git - meshlink/blobdiff - src/protocol_misc.c
We can safely delete a connection_t in terminate_connection() now.
[meshlink] / src / protocol_misc.c
index 52e97e5448193f9260a86d605e80e4996cebd89b..1e0bc50d8f9749d47cbd0ab7f32cedbd38d09c7f 100644 (file)
@@ -90,9 +90,7 @@ bool error_h(connection_t *c)
        ifdebug(ERROR) logger(LOG_NOTICE, _("Error message from %s (%s): %d: %s"),
                           c->name, c->hostname, err, errorstring);
 
-       terminate_connection(c, c->status.active);
-
-       return true;
+       return false;
 }
 
 bool send_termreq(connection_t *c)
@@ -106,9 +104,7 @@ bool termreq_h(connection_t *c)
 {
        cp();
 
-       terminate_connection(c, c->status.active);
-
-       return true;
+       return false;
 }
 
 bool send_ping(connection_t *c)
@@ -116,7 +112,7 @@ bool send_ping(connection_t *c)
        cp();
 
        c->status.pinged = true;
-       c->last_ping_time = now;
+       c->last_ping_time = time(NULL);
 
        return send_request(c, "%d", PING);
 }