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

[tor-commits] [stegotorus/master] * Downgrade "connection reset" from log_warn to log_info.



commit 38e21c79e997422cad8117ed3b9e48bc0b4e4d33
Author: Zack Weinberg <zackw@xxxxxxx>
Date:   Wed Mar 28 20:34:04 2012 -0700

    * Downgrade "connection reset" from log_warn to log_info.
    * Do not allow a nosteg_rr connection to become usable again after it has
      transmitted, just because its receive method gets called again.
---
 src/network.cc        |    4 ++--
 src/steg/nosteg_rr.cc |    7 +++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/network.cc b/src/network.cc
index 794e4e2..7eac64d 100644
--- a/src/network.cc
+++ b/src/network.cc
@@ -333,7 +333,7 @@ upstream_event_cb(struct bufferevent *bev, short what, void *arg)
 
   if (what & (BEV_EVENT_ERROR|BEV_EVENT_EOF|BEV_EVENT_TIMEOUT)) {
     if (what & BEV_EVENT_ERROR)
-      log_warn(ckt, "network error in %s: %s",
+      log_info(ckt, "network error in %s: %s",
                (what & BEV_EVENT_READING) ? "read" : "write",
                evutil_socket_error_to_string(EVUTIL_SOCKET_ERROR()));
     else if (what & BEV_EVENT_EOF)
@@ -377,7 +377,7 @@ downstream_event_cb(struct bufferevent *bev, short what, void *arg)
 
   if (what & (BEV_EVENT_ERROR|BEV_EVENT_EOF|BEV_EVENT_TIMEOUT)) {
     if (what & BEV_EVENT_ERROR)
-      log_warn(conn, "network error in %s: %s",
+      log_info(conn, "network error in %s: %s",
                (what & BEV_EVENT_READING) ? "read" : "write",
                evutil_socket_error_to_string(EVUTIL_SOCKET_ERROR()));
     else if (what & BEV_EVENT_EOF)
diff --git a/src/steg/nosteg_rr.cc b/src/steg/nosteg_rr.cc
index a586d0a..70e376e 100644
--- a/src/steg/nosteg_rr.cc
+++ b/src/steg/nosteg_rr.cc
@@ -42,6 +42,7 @@ namespace {
 struct nosteg_rr : steg_t
 {
   bool can_transmit : 1;
+  bool did_transmit : 1;
   STEG_DECLARE_METHODS(nosteg_rr);
 };
 }
@@ -50,7 +51,8 @@ STEG_DEFINE_MODULE(nosteg_rr);
 
 nosteg_rr::nosteg_rr(bool is_clientside)
   : steg_t(is_clientside),
-    can_transmit(is_clientside)
+    can_transmit(is_clientside),
+    did_transmit(false)
 {
 }
 
@@ -79,6 +81,7 @@ nosteg_rr::transmit(struct evbuffer *source, conn_t *conn)
     return -1;
   }
 
+  did_transmit = true;
   can_transmit = false;
   conn->cease_transmission();
 
@@ -101,7 +104,7 @@ nosteg_rr::receive(conn_t *conn, struct evbuffer *dest)
 
   if (is_clientside) {
     conn->expect_close();
-  } else {
+  } else if (!did_transmit) {
     can_transmit = true;
     conn->transmit_soon(100);
   }



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