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

Unified Diff: tools/battor_agent/battor_connection_impl.cc

Issue 2217513002: [battor_agent] Clear pending read buffer if it contains an irrevocable error. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/battor_agent/battor_connection_impl.cc
diff --git a/tools/battor_agent/battor_connection_impl.cc b/tools/battor_agent/battor_connection_impl.cc
index cf33c2ab97b18e1359f077f192117aae2840b6b5..d04f8c76fa2cfe00b9db34733e4586443f689236 100644
--- a/tools/battor_agent/battor_connection_impl.cc
+++ b/tools/battor_agent/battor_connection_impl.cc
@@ -258,8 +258,10 @@ void BattOrConnectionImpl::OnBytesRead(int bytes_read,
if (parse_message_error != ParseMessageError::NONE) {
LogSerial(StringPrintf(
- "Read failed due to the message containing an irrecoverable error: %d.",
+ "Read failed due to the message containing an irrecoverable error: %d, "
+ "clearing the pending read buffer.",
parse_message_error));
+ already_read_buffer_.clear();
EndReadBytes(false, BATTOR_MESSAGE_TYPE_CONTROL, nullptr);
return;
}
« 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