]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
Reduce calls to LOG() in read_from_write_to() and read_from_write_to_tls().
authorSimon Ruderich <simon@ruderich.org>
Sun, 4 Aug 2013 20:41:44 +0000 (22:41 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sun, 4 Aug 2013 20:41:44 +0000 (22:41 +0200)
src/connection.c

index 5a08de7431f07733179982b48e3cf7bac8e4d737..e83bc864975403198bf792701f01e1f7f850b576 100644 (file)
@@ -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) {