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

Unified Diff: mojo/system/raw_channel_posix.cc

Issue 462563003: Mojo: Plumb "connection broken" out of RawChannel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « mojo/system/raw_channel.cc ('k') | mojo/system/raw_channel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/raw_channel_posix.cc
diff --git a/mojo/system/raw_channel_posix.cc b/mojo/system/raw_channel_posix.cc
index 88638883b2318c7813c4526fbaf3bbfcc6129f5f..469f5398ab2eaeaf252175fe3d7f188db88fa392 100644
--- a/mojo/system/raw_channel_posix.cc
+++ b/mojo/system/raw_channel_posix.cc
@@ -211,14 +211,18 @@ RawChannel::IOResult RawChannelPosix::Read(size_t* bytes_read) {
return IO_FAILED_SHUTDOWN;
}
- if (errno != EAGAIN && errno != EWOULDBLOCK) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK)
+ return ScheduleRead();
+
+ IOResult rv = IO_FAILED_UNKNOWN;
+ if (errno == ECONNRESET)
+ rv = IO_FAILED_BROKEN;
+ else
PLOG(WARNING) << "recvmsg";
- // Make sure that |OnFileCanReadWithoutBlocking()| won't be called again.
- read_watcher_.reset();
- return IO_FAILED_UNKNOWN;
- }
- return ScheduleRead();
+ // Make sure that |OnFileCanReadWithoutBlocking()| won't be called again.
+ read_watcher_.reset();
+ return rv;
}
RawChannel::IOResult RawChannelPosix::ScheduleRead() {
« no previous file with comments | « mojo/system/raw_channel.cc ('k') | mojo/system/raw_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698