Merge branch 'master' of git://tinc-vpn.org/tinc into 1.1
[tinc] / src / meta.c
index 5735da7..29dd824 100644 (file)
@@ -88,7 +88,7 @@ bool receive_meta(connection_t *c) {
        buffer_compact(&c->inbuf, MAXBUFSIZE);
 
        if(sizeof inbuf <= c->inbuf.len) {
-               logger(LOG_ERR, "Input buffer full for %s (%s)\n", c, c->hostname);
+               logger(LOG_ERR, "Input buffer full for %s (%s)", c->name, c->hostname);
                return false;
        }
 
@@ -138,6 +138,7 @@ bool receive_meta(connection_t *c) {
                                char *tcpbuffer = buffer_read(&c->inbuf, c->tcplen);
                                if(tcpbuffer) {
                                        receive_tcppacket(c, tcpbuffer, c->tcplen);
+                                       c->tcplen = 0;
                                        continue;
                                } else {
                                        break;