[tor-commits] [flashproxy/master] Call the complete_callback only once.

dcf at torproject.org dcf at torproject.org
Mon Apr 9 04:08:42 UTC 2012


commit 3859bdc7d66d62188b1869fa095d6d3f30b14e68
Author: David Fifield <david at bamsoftware.com>
Date:   Sat Mar 31 17:12:06 2012 -0700

    Call the complete_callback only once.
---
 flashproxy.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/flashproxy.js b/flashproxy.js
index e55e26b..78b40aa 100644
--- a/flashproxy.js
+++ b/flashproxy.js
@@ -360,6 +360,7 @@ function FlashProxy()
         this.c2r_schedule = [];
         this.r2c_schedule = [];
 
+        this.running = true;
         this.flush_timeout_id = null;
 
         /* This callback function can be overridden by external callers. */
@@ -390,8 +391,10 @@ function FlashProxy()
             log(ws.label + ": closed.");
             this.flush();
 
-            if (is_closed(this.client_s) && is_closed(this.relay_s))
+            if (this.running && is_closed(this.client_s) && is_closed(this.relay_s)) {
+                this.running = false;
                 this.complete_callback();
+            }
         }.bind(this);
 
         this.onmessage_client_to_relay = function(event) {





More information about the tor-commits mailing list