Commit 1bc4379e authored by dalecurtis@google.com's avatar dalecurtis@google.com

Don't use select() in SyncSocket when handle > FD_SETSIZE.

BUG=314364
TEST=audio playback still works, just glitches in 48->44
R=ajwong@chromium.org

Review URL: https://codereview.chromium.org/49303008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232845 0039d316-1c4b-4281-b951-d872f2087c98
parent db55ba35
......@@ -125,7 +125,13 @@ size_t SyncSocket::ReceiveWithTimeout(void* buffer,
DCHECK_GT(length, 0u);
DCHECK_LE(length, kMaxMessageLength);
DCHECK_NE(handle_, kInvalidHandle);
CHECK_LT(handle_, FD_SETSIZE);
// TODO(dalecurtis): There's an undiagnosed issue on OSX where we're seeing
// large numbers of open files which prevents select() from being used. In
// this case, the best we can do is Peek() to see if we can Receive() now or
// return a timeout error (0) if not. See http://crbug.com/314364.
if (handle_ >= FD_SETSIZE)
return Peek() < length ? 0 : Receive(buffer, length);
// Only timeouts greater than zero and less than one second are allowed.
DCHECK_GT(timeout.InMicroseconds(), 0);
......
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