Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: webrtc/base/physicalsocketserver.cc

Issue 2678353006: Getting rid of "benign blocking error" log spam. (Closed)
Patch Set: Don't log for EWOULDBLOCK. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/physicalsocketserver.cc
diff --git a/webrtc/base/physicalsocketserver.cc b/webrtc/base/physicalsocketserver.cc
index 6970388844e4a9475d62a38a0201108ebe43bd47..ad401f7ceb86ab123bb43045dc6c4602591c1c76 100644
--- a/webrtc/base/physicalsocketserver.cc
+++ b/webrtc/base/physicalsocketserver.cc
@@ -689,6 +689,13 @@ int SocketDispatcher::GetDescriptor() {
}
bool SocketDispatcher::IsDescriptorClosed() {
+ if (udp_) {
+ // The MSG_PEEK trick doesn't work for UDP, since (at least in some
+ // circumstances) it requires reading an entire UDP packet, which would be
+ // bad for performance here. So, just check whether |s_| has been closed,
+ // which should be sufficient.
+ return s_ == INVALID_SOCKET;
+ }
// We don't have a reliable way of distinguishing end-of-stream
// from readability. So test on each readable call. Is this
// inefficient? Probably.
@@ -706,6 +713,8 @@ bool SocketDispatcher::IsDescriptorClosed() {
case EBADF:
// Returned during ungraceful peer shutdown.
case ECONNRESET:
+ // The normal blocking error.
+ case EWOULDBLOCK:
return true;
nisse-webrtc 2017/02/09 09:29:54 Return value should be true for EBADF and ECONNRES
Taylor Brandstetter 2017/02/09 10:21:43 Oops, fixed.
default:
// Assume that all other errors are just blocking errors, meaning the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698