Removed extraneous error checking
parent
b7288edd9a
commit
44ca4d4db1
|
|
@ -149,12 +149,11 @@ void Communication::readTask() {
|
|||
if(packetizer->input(readBytes)) {
|
||||
for(auto& packet : packetizer->output()) {
|
||||
std::shared_ptr<Message> msg;
|
||||
if(!decoder->decode(msg, packet)) {
|
||||
err(APIError::Unknown); // TODO Use specific error
|
||||
if(!decoder->decode(msg, packet))
|
||||
continue;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lk(messageCallbacksLock);
|
||||
|
||||
for(auto& cb : messageCallbacks) {
|
||||
if(!closing) { // We might have closed while reading or processing
|
||||
cb.second.callIfMatch(msg);
|
||||
|
|
|
|||
|
|
@ -35,10 +35,7 @@ bool ICommunication::readWait(std::vector<uint8_t>& bytes, std::chrono::millisec
|
|||
|
||||
bytes.resize(actuallyRead);
|
||||
|
||||
bool ret = actuallyRead > 0;
|
||||
if(!ret)
|
||||
err(APIError::FailedToRead);
|
||||
return ret;
|
||||
return actuallyRead > 0;
|
||||
}
|
||||
|
||||
bool ICommunication::write(const std::vector<uint8_t>& bytes) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue