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

[tor-commits] [flashproxy/js] Don't close the other half of the proxy pair if there is buffered data.



commit b724fe09e39f90eade0f42ac8f5b3ec6da2a9751
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Sat Apr 7 02:25:04 2012 -0700

    Don't close the other half of the proxy pair if there is buffered data.
---
 flashproxy.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/flashproxy.js b/flashproxy.js
index 4e42106..726b3ee 100644
--- a/flashproxy.js
+++ b/flashproxy.js
@@ -573,11 +573,11 @@ function ProxyPair(client_addr, relay_addr, rate_limit) {
             }
         }
 
-        if (is_closed(this.relay_s) && !is_closed(this.client_s) && this.r2c_schedule.length === 0) {
+        if (is_closed(this.relay_s) && !is_closed(this.client_s) && this.client_s.bufferedAmount === 0 && this.r2c_schedule.length === 0) {
             log("Client: closing.");
             this.client_s.close();
         }
-        if (is_closed(this.client_s) && !is_closed(this.relay_s) && this.c2r_schedule.length === 0) {
+        if (is_closed(this.client_s) && !is_closed(this.relay_s) && this.relay_s.bufferedAmount === 0 && this.c2r_schedule.length === 0) {
             log("Relay: closing.");
             this.relay_s.close();
         }



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