commit 7c84d72e5b92e710ef560f493d836d722a65e4bb Author: David Fifield david@bamsoftware.com Date: Thu Apr 10 12:01:01 2014 -0700
Disable read/write deadlines when done reading or writing.
I was getting long hangs during bootstrapping on Windows 8 in a VM. It seemed to happen most often right after receiving a payload of maximum size, which mostly happens only during bootstrapping. Increasing the timeout to 10 s made it go away. Even though we reset the timeout before every read and write operation, my guess is there's some implicit read or write that was reusing the timeout of the most recent operation. When payloads were big, they took a little more time to process, and failed. --- firefox/components/main.js | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/firefox/components/main.js b/firefox/components/main.js index cff6ef0..2890b37 100644 --- a/firefox/components/main.js +++ b/firefox/components/main.js @@ -184,6 +184,7 @@ MeekHTTPHelper.LocalConnectionHandler.prototype = { output.write32(data.length); MeekHTTPHelper.refreshDeadline(this.transport, deadline); output.writeByteArray(data, data.length); + MeekHTTPHelper.refreshDeadline(this.transport, null); } finally { output.close(); } @@ -301,6 +302,7 @@ MeekHTTPHelper.RequestReader.prototype = { converter.charset = "UTF-8"; var s = converter.convertFromByteArray(this.buf, this.buf.length); var req = JSON.parse(s); + MeekHTTPHelper.refreshDeadline(this.transport, null); this.callback(req); }, };