[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [obfsproxy/master] Don't log transmission on a closed connection.



commit eb5e25534667b2b18c5ee8c7c2f0b06bbb0f6c69
Author: George Kadianakis <desnacked@xxxxxxxxx>
Date:   Fri Dec 16 16:55:48 2011 +0100

    Don't log transmission on a closed connection.
---
 src/network.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/network.c b/src/network.c
index a1fbe41..c36de25 100644
--- a/src/network.c
+++ b/src/network.c
@@ -614,10 +614,11 @@ upstream_read_cb(struct bufferevent *bev, void *arg)
                  bufferevent_get_output(down->buffer))) {
     log_debug("%s: error during transmit.", up->peername);
     conn_free(up);
+  } else {
+    log_debug("%s: transmitted %lu bytes", down->peername,
+              (unsigned long)
+              evbuffer_get_length(bufferevent_get_output(down->buffer)));
   }
-  log_debug("%s: transmitted %lu bytes", down->peername,
-            (unsigned long)
-            evbuffer_get_length(bufferevent_get_output(down->buffer)));
 }
 
 /**
@@ -663,10 +664,11 @@ downstream_read_cb(struct bufferevent *bev, void *arg)
                      bufferevent_get_output(down->buffer)) < 0) {
         log_debug("%s: error during reply.", down->peername);
         conn_free(down);
+      } else {
+        log_debug("%s: transmitted %lu bytes", down->peername,
+                  (unsigned long)
+                  evbuffer_get_length(bufferevent_get_output(down->buffer)));
       }
-      log_debug("%s: transmitted %lu bytes", down->peername,
-                (unsigned long)
-                evbuffer_get_length(bufferevent_get_output(down->buffer)));
     }
   }
 }



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits