X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fprotocol_key.c;h=745845a650ebd0453660e53301a0cbc056459931;hb=HEAD;hp=25dbc55e5c04b7533e9eb0f6c5eeb62214cc648e;hpb=777055274c4a1959318330800e449a2bc27835fb;p=meshlink diff --git a/src/protocol_key.c b/src/protocol_key.c index 25dbc55e..745845a6 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -345,6 +345,10 @@ bool req_key_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { return true; } + size_t len = strlen(request); + from->in_forward += len + SPTPS_OVERHEAD; + to->out_forward += len + SPTPS_OVERHEAD; + send_request(mesh, to->nexthop->connection, NULL, "%s", request); } @@ -411,6 +415,11 @@ bool ans_key_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { return false; } + /* TODO: find a good way to avoid the use of strlen() */ + size_t len = strlen(request); + from->in_forward += len + SPTPS_OVERHEAD; + to->out_forward += len + SPTPS_OVERHEAD; + /* Append the known UDP address of the from node, if we have a confirmed one */ if(!*address && from->status.udp_confirmed && from->address.sa.sa_family != AF_UNSPEC) { char *reflexive_address, *reflexive_port;