Merge pull request #213 from morphis/f/correctly-close-adb-connection

Close connection when adbd connection is closed
This commit is contained in:
Simon Fels 2017-05-02 18:23:33 +02:00 committed by GitHub
commit e10a5fd0a5

View file

@ -156,7 +156,8 @@ void AdbMessageProcessor::on_host_read_size(
const boost::system::error_code &error, std::size_t bytes_read) {
if (error) {
state_ = closed_by_host;
BOOST_THROW_EXCEPTION(std::runtime_error(error.message()));
messenger_->close();
return;
}
messenger_->send(reinterpret_cast<const char *>(host_buffer_.data()), bytes_read);