From: Simon Ruderich Date: Sun, 4 Aug 2013 20:41:44 +0000 (+0200) Subject: Reduce calls to LOG() in read_from_write_to() and read_from_write_to_tls(). X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=112cce261d537006fd97ab43512bca2ffbbb3c7d;hp=b7ce41b809a3b3533d398c0da8fd9787c149434c;p=tlsproxy%2Ftlsproxy.git Reduce calls to LOG() in read_from_write_to() and read_from_write_to_tls(). --- 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) {