X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fmeta.c;h=9b2ecc267f38869800e5b9eb436bfde2a60ba554;hb=9e76c464b26b066e1eb3aa5232e573792e28020d;hp=a272baf57e10da72687fed8c7aa91223e626bccc;hpb=19be9cf7150858311f7898fa3fb525d692d02f64;p=tinc diff --git a/src/meta.c b/src/meta.c index a272baf5..9b2ecc26 100644 --- a/src/meta.c +++ b/src/meta.c @@ -31,7 +31,7 @@ #include "utils.h" #include "xalloc.h" -bool send_meta_sptps(void *handle, const char *buffer, size_t length) { +bool send_meta_sptps(void *handle, uint8_t type, const char *buffer, size_t length) { connection_t *c = handle; if(!c) { @@ -39,8 +39,6 @@ bool send_meta_sptps(void *handle, const char *buffer, size_t length) { abort(); } - logger(DEBUG_META, LOG_DEBUG, "send_meta_sptps(%s, %p, %zu)", c->name, buffer, length); - buffer_add(&c->outbuf, buffer, length); event_add(&c->outevent, NULL); @@ -98,8 +96,6 @@ bool receive_meta_sptps(void *handle, uint8_t type, const char *data, uint16_t l abort(); } - logger(DEBUG_META, LOG_DEBUG, "receive_meta_sptps(%s, %d, %p, %hu)", c->name, type, data, length); - if(type == SPTPS_HANDSHAKE) { if(c->allow_request == ACK) return send_ack(c); @@ -161,10 +157,8 @@ bool receive_meta(connection_t *c) { } do { - if(c->protocol_minor >= 2) { - logger(DEBUG_META, LOG_DEBUG, "Receiving %d bytes of SPTPS data", inlen); + if(c->protocol_minor >= 2) return sptps_receive_data(&c->sptps, bufp, inlen); - } if(!c->status.decryptin) { endp = memchr(bufp, '\n', inlen); @@ -179,7 +173,6 @@ bool receive_meta(connection_t *c) { bufp = endp; } else { size_t outlen = inlen; - logger(DEBUG_META, LOG_DEBUG, "Received encrypted %d bytes", inlen); if(!cipher_decrypt(&c->incipher, bufp, inlen, buffer_prepare(&c->inbuf, inlen), &outlen, false) || inlen != outlen) { logger(DEBUG_ALWAYS, LOG_ERR, "Error while decrypting metadata from %s (%s)",