clowwindy / ShadowSPDY

Deprecated. Use Shadowsocks instead.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slow download speed

clowwindy opened this issue · comments

According to SPDY Protocol - Draft 3.1

The receiver of a frame sends a WINDOW_UPDATE frame as it consumes data and frees up space in flow control windows. Separate WINDOW_UPDATE frames are sent for the stream and connection level flow control windows.

But node-spdy only sends WINDOW_UPDATE frames when window size is 0. Therefore when download speed is around 500KB/s the speed is limited by RTT.

// connection.js

// ### function sendWindowUpdate (force)
// #### @force {Boolean} send even if windowSize is positive
// Send WINDOW_UPDATE if needed
//
Connection.prototype._sendWindowUpdate = function sendWindowUpdate(force) {
  var state = this._spdyState;

  if (state.version < 3.1 && (!state.isServer || !state.autoSpdy31) ||
      state.windowSize > 0 && !force) {
    return;
  }
  // ...
}

Fixed in c3b6ea0