X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fprotocol_auth.c;h=0a107e4c2820f19caa88dea3c6e5f41cab3f99c9;hb=HEAD;hp=a0d350d5b9ff83700439b02802ad5882c739b668;hpb=9e9fdbba951622418c11b1ddc117072daa99f0ae;p=meshlink diff --git a/src/protocol_auth.c b/src/protocol_auth.c index a0d350d5..0a107e4c 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -44,7 +44,7 @@ extern bool node_write_devclass(meshlink_handle_t *mesh, node_t *n); bool send_id(meshlink_handle_t *mesh, connection_t *c) { - return send_request(mesh, c, NULL, "%d %s %d.%d %s", ID, mesh->self->name, PROT_MAJOR, PROT_MINOR, mesh->appname); + return send_request(mesh, c, NULL, "%d %s %d.%d %s %u", ID, mesh->self->name, PROT_MAJOR, PROT_MINOR, mesh->appname, 0); } static bool commit_invitation(meshlink_handle_t *mesh, connection_t *c, const void *data) { @@ -188,7 +188,7 @@ bool id_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { char name[MAX_STRING_SIZE]; - if(sscanf(request, "%*d " MAX_STRING " %d.%d", name, &c->protocol_major, &c->protocol_minor) < 2) { + if(sscanf(request, "%*d " MAX_STRING " %d.%d %*s %u", name, &c->protocol_major, &c->protocol_minor, &c->flags) < 2) { logger(mesh, MESHLINK_ERROR, "Got bad %s from %s", "ID", c->name); return false; } @@ -380,6 +380,7 @@ bool ack_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { n->devclass = devclass; n->status.dirty = true; + n->status.tiny = c->flags & PROTOCOL_TINY; n->last_successfull_connection = mesh->loop.now.tv_sec; @@ -420,7 +421,9 @@ bool ack_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { /* Send him everything we know */ - send_everything(mesh, c); + if(!(c->flags & PROTOCOL_TINY)) { + send_everything(mesh, c); + } /* Create an edge_t for this connection */