uProxy-p2p
uProxy-p2p copied to clipboard
chrome sockets.tcp setPaused should pause before invoking callback
Problem
- Currently sockets.tcp.setPaused() will immediately invoke its callback, even if there's a pending read() on the socket, that will cause an onReceive event to fire after the callback's complete.
- You can't currently abort a read once it's in-flight, and there's no way to always be sure that all the data you're going to receive before pausing has been received.
Fix
- Buffer received data when pausing
- Return it when reading.
- Looks like Read() size isn't an issue for libNSS -- it's got a read loop to pull as much data as needed.
- Currently diagnosing why libNSS is unhappy.
We currently have a way to workaround this issue in our XMPP code, so changing this to P2 (not a must-have for web store launch)