Commit 8b502df2 authored by Joel Martin's avatar Joel Martin

Tolerate some bufferedAmount.

Only delay sending data if bufferedAmount is greater than 1000.

This seems to match the intention of the spec better. bufferedAmount
does not mean that we can't send, it's just an indication that the
network is becoming saturated. But Opera 11 native WebSockets seems to
have a bug that bufferedAmount isn't set back to zero correctly so
we'll be a bit more tolerant.
parent cabecf89
...@@ -166,7 +166,10 @@ function decode_message(data) { ...@@ -166,7 +166,10 @@ function decode_message(data) {
// //
function flush() { function flush() {
if (websocket.bufferedAmount === 0) { if (websocket.bufferedAmount !== 0) {
Util.Debug("bufferedAmount: " + websocket.bufferedAmount);
}
if (websocket.bufferedAmount < 1000) {
//Util.Debug("arr: " + arr); //Util.Debug("arr: " + arr);
//Util.Debug("sQ: " + sQ); //Util.Debug("sQ: " + sQ);
if (sQ) { if (sQ) {
...@@ -175,7 +178,8 @@ function flush() { ...@@ -175,7 +178,8 @@ function flush() {
} }
return true; return true;
} else { } else {
Util.Debug("Delaying send"); Util.Info("Delaying send, bufferedAmount: " +
websocket.bufferedAmount);
return false; return false;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment