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

Unified Diff: remoting/protocol/socket_reader_base.cc

Issue 6277003: Simplified MessageReader and MessageDecoder classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 11 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 | « remoting/protocol/socket_reader_base.h ('k') | remoting/protocol/video_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/socket_reader_base.cc
diff --git a/remoting/protocol/socket_reader_base.cc b/remoting/protocol/socket_reader_base.cc
index 41648bc9242ebefb70541a639c65a9ec06e976ce..743120df0bd35772b810b361e7dbb2a14fc05e75 100644
--- a/remoting/protocol/socket_reader_base.cc
+++ b/remoting/protocol/socket_reader_base.cc
@@ -24,10 +24,6 @@ SocketReaderBase::SocketReaderBase()
SocketReaderBase::~SocketReaderBase() { }
-void SocketReaderBase::Close() {
- closed_ = true;
-}
-
void SocketReaderBase::Init(net::Socket* socket) {
DCHECK(socket);
socket_ = socket;
@@ -56,8 +52,11 @@ void SocketReaderBase::HandleReadResult(int result) {
if (result > 0) {
OnDataReceived(read_buffer_, result);
} else {
- if (result != net::ERR_IO_PENDING)
+ if (result == net::ERR_CONNECTION_CLOSED) {
+ closed_ = true;
+ } else if (result != net::ERR_IO_PENDING) {
LOG(ERROR) << "Read() returned error " << result;
+ }
}
}
« no previous file with comments | « remoting/protocol/socket_reader_base.h ('k') | remoting/protocol/video_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698