Merge "Fix behavior where the non-blocking sendToCliend would block when there was enough room for the message but not the message header."

This commit is contained in:
Jason Sams
2010-08-05 15:46:10 -07:00
committed by Android (Google) Code Review

View File

@@ -798,7 +798,7 @@ bool Context::sendMessageToClient(void *data, uint32_t cmdID, size_t len, bool w
return false;
}
if (!waitForSpace) {
if (mIO.mToClient.getFreeSpace() < len) {
if (mIO.mToClient.getFreeSpace() <= (len + 8)) {
// Not enough room, and not waiting.
return false;
}