twitter-archive / CocoaSPDY

SPDY for iOS and OS X
Apache License 2.0
2.39k stars 233 forks source link

Consider breaking up large data sends to prevent priority inversion #120

Open kgoodier opened 9 years ago

kgoodier commented 9 years ago

In SPDYSession, in _sendData, the entire input stream is sent in a tight loop, assuming:

  1. The send window never closes
  2. The input stream supplies data

It's possible that a large upload on a slow network will block higher-priority requests that come in after the data upload has started. By breaking up large uploads into multiple data frames and processing any higher-priority operations in between, this priority inversion may be avoided.