[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [flashproxy/master] Call flush while any data is buffered.
commit a9491dd508f8bf1fe11a371f99b332bafd428743
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date: Sat Apr 7 04:44:46 2012 -0700
Call flush while any data is buffered.
This is so that an open socket can be closed after sending all its data,
after its partner has closed.
---
flashproxy.js | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/flashproxy.js b/flashproxy.js
index 726b3ee..bbadc46 100644
--- a/flashproxy.js
+++ b/flashproxy.js
@@ -582,7 +582,8 @@ function ProxyPair(client_addr, relay_addr, rate_limit) {
this.relay_s.close();
}
- if (this.r2c_schedule.length > 0 || this.c2r_schedule.length > 0)
+ if (this.r2c_schedule.length > 0 || this.client_s.bufferedAmount > 0
+ || this.c2r_schedule.length > 0 || this.relay_s.bufferedAmount > 0)
this.flush_timeout_id = setTimeout(this.flush.bind(this), this.rate_limit.when() * 1000);
};
}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits