[tor-commits] [meek/master] Also reset the poll interval to 0 when we had something to send.

dcf at torproject.org dcf at torproject.org
Mon May 5 18:20:04 UTC 2014


commit f86c7d5ce0fbe3fd0922a0cb6f8a0ac01e5895dc
Author: David Fifield <david at bamsoftware.com>
Date:   Sun May 4 23:32:34 2014 -0700

    Also reset the poll interval to 0 when we had something to send.
    
    There could be a delay, for example, when you first clicked a link after
    letting the browser idle for a while. The local data from tor would be
    read immediately, but it could be that nothing was availble to be read
    from the remote peer immediately. There would be a wait up until the
    next polling interval before any data was received.
---
 meek-client/meek-client.go |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/meek-client/meek-client.go b/meek-client/meek-client.go
index 25ce0ad..229bfd2 100644
--- a/meek-client/meek-client.go
+++ b/meek-client/meek-client.go
@@ -154,12 +154,13 @@ loop:
 			}
 		*/
 
-		if nw > 0 {
-			// If we received anything, poll again immediately.
+		if nw > 0 || len(buf) > 0 {
+			// If we sent or received anything, poll again
+			// immediately.
 			interval = 0
 		} else if interval == 0 {
-			// The first time we don't receive anything, wait a
-			// while.
+			// The first time we don't send or receive anything,
+			// wait a while.
 			interval = initPollInterval
 		} else {
 			// After that, wait a little longer.



More information about the tor-commits mailing list