X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fmeta.c;h=849a0c6947a409807c396bf769c28567d5aa4360;hb=9eca49329db0c3b0a80114045cf214eaeaf3d5c2;hp=cf6b9d446d82067ee3739afdbecd25bce1247313;hpb=90c7fafe594cf6d03c15a072a3d749f3e4d78482;p=tinc diff --git a/src/meta.c b/src/meta.c index cf6b9d44..849a0c69 100644 --- a/src/meta.c +++ b/src/meta.c @@ -85,10 +85,10 @@ bool receive_meta(connection_t *c) { - If not, keep stuff in buffer and exit. */ - buffer_compact(&c->inbuf); + buffer_compact(&c->inbuf, MAXBUFSIZE); if(sizeof inbuf <= c->inbuf.len) { - logger(LOG_ERR, "Input buffer full for %s (%s)\n"); + logger(LOG_ERR, "Input buffer full for %s (%s)", c->name, c->hostname); return false; } @@ -137,6 +137,7 @@ bool receive_meta(connection_t *c) { if(c->tcplen) { char *tcpbuffer = buffer_read(&c->inbuf, c->tcplen); if(tcpbuffer) { + c->tcplen = 0; receive_tcppacket(c, tcpbuffer, c->tcplen); continue; } else {