From 112cce261d537006fd97ab43512bca2ffbbb3c7d Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 4 Aug 2013 22:41:44 +0200 Subject: [PATCH] Reduce calls to LOG() in read_from_write_to() and read_from_write_to_tls(). --- src/connection.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/connection.c b/src/connection.c index 5a08de7..e83bc86 100644 --- a/src/connection.c +++ b/src/connection.c @@ -618,6 +618,8 @@ static void transfer_data(int client, int server) { fds[1].events = POLLIN | POLLPRI | POLLHUP | POLLERR; fds[1].revents = 0; + LOG(DEBUG, "transfer_data(): %d -> %d", client, server); + for (;;) { int result = poll(fds, 2 /* fd count */, -1 /* no timeout */); if (result < 0) { @@ -658,8 +660,6 @@ static int read_from_write_to(int from, int to) { ssize_t size_written; char buffer[4096]; - LOG(DEBUG, "read_from_write_to(): %d -> %d", from, to); - size_read = read(from, buffer, sizeof(buffer)); if (size_read < 0) { LOG_PERROR(WARNING, "read_from_write_to(): read()"); @@ -750,10 +750,10 @@ static int read_from_write_to_tls(gnutls_session_t from, char buffer[16384]; if (buffer_size > sizeof(buffer)) { + LOG(WARNING, "read_from_write_to_tls(): reduced buffer size to %ld", + (long int)(sizeof(buffer))); buffer_size = sizeof(buffer); } - LOG(DEBUG, "read_from_write_to_tls(): used buffer size: %ld", - (long int)buffer_size); size_read = gnutls_record_recv(from, buffer, buffer_size); if (size_read < 0) { -- 2.45.2