]> git.meshlink.io Git - meshlink/commitdiff
Only show meta connection related debug messages when debug level >= 4
authorGuus Sliepen <guus@tinc-vpn.org>
Thu, 11 Dec 2008 14:03:52 +0000 (14:03 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Thu, 11 Dec 2008 14:03:52 +0000 (14:03 +0000)
src/meta.c
src/net_socket.c

index 524a6ce03254d5d4651c465fdf971dbabeb66cd8..cb4b03e163eee94bd1fff6cf1727b5fc66783f84 100644 (file)
@@ -53,13 +53,13 @@ bool send_meta(connection_t *c, const char *buffer, int length) {
                        return false;
                }
                
-               logger(LOG_DEBUG, _("Encrypted write %p %p %p %d"), c, c->buffer, outbuf, length);
+               ifdebug(META) logger(LOG_DEBUG, _("Encrypted write %p %p %p %d"), c, c->buffer, outbuf, length);
                bufferevent_write(c->buffer, (void *)outbuf, length);
-               logger(LOG_DEBUG, _("Done."));
+               ifdebug(META) logger(LOG_DEBUG, _("Done."));
        } else {
-               logger(LOG_DEBUG, _("Unencrypted write %p %p %p %d"), c, c->buffer, buffer, length);
+               ifdebug(META) logger(LOG_DEBUG, _("Unencrypted write %p %p %p %d"), c, c->buffer, buffer, length);
                bufferevent_write(c->buffer, (void *)buffer, length);
-               logger(LOG_DEBUG, _("Done."));
+               ifdebug(META) logger(LOG_DEBUG, _("Done."));
        }
 
        return true;
@@ -115,7 +115,7 @@ bool receive_meta(connection_t *c) {
                        inlen -= endp - bufp;
                        bufp = endp;
                } else {
-                       logger(LOG_DEBUG, _("Received encrypted %d bytes"), inlen);
+                       ifdebug(META) logger(LOG_DEBUG, _("Received encrypted %d bytes"), inlen);
                        evbuffer_expand(c->buffer->input, c->buffer->input->off + inlen);
                        result = EVP_DecryptUpdate(c->inctx, (unsigned char *)c->buffer->input->buffer + c->buffer->input->off, &outlen, (unsigned char *)bufp, inlen);
                        if(!result || outlen != inlen) {
index 0b9a13248ece76c252a59f3468e7e4eafce3b4e6..a6fe54bcea57bafb45f9d87e6743357be2ed363f 100644 (file)
@@ -355,7 +355,7 @@ void handle_meta_read(struct bufferevent *event, void *data) {
 }
 
 void handle_meta_write(struct bufferevent *event, void *data) {
-       logger(LOG_DEBUG, _("handle_meta_write() called"));
+       ifdebug(META) logger(LOG_DEBUG, _("handle_meta_write() called"));
 }
 
 void handle_meta_connection_error(struct bufferevent *event, short what, void *data) {