Chromium Code Reviews| Index: base/sync_socket_posix.cc |
| diff --git a/base/sync_socket_posix.cc b/base/sync_socket_posix.cc |
| index c408de52238e90bbd7a76a927d5c65bedd32beb7..b306207457abded6a87157d0cecca1c416da20d1 100644 |
| --- a/base/sync_socket_posix.cc |
| +++ b/base/sync_socket_posix.cc |
| @@ -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 |
| + // extremely high numbers of open files which prevents select() from being |
| + // used. When this is true, the best we can do is Peek() to see if we can |
| + // Receive() now and return an error if not. See http://crbug.com/314364. |
|
awong
2013/11/04 23:25:23
Please clarify why returning 0 doesn't turn into d
DaleCurtis
2013/11/04 23:32:25
Clarified that the 0 return value is a timeout err
|
| + 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); |