client track opByIOID per channel

needed to handle CMD_DESTROY_CHANNEL
This commit is contained in:
Michael Davidsaver
2020-03-01 19:57:13 -08:00
parent 1f91eb9e5d
commit e668038250
5 changed files with 21 additions and 6 deletions
+4 -2
View File
@@ -46,6 +46,7 @@ struct InfoOp : public OperationBase
// This opens up a race with an in-flight reply.
chan->conn->opByIOID.erase(ioid);
chan->opByIOID.erase(ioid);
}
state = Done;
chan.reset();
@@ -113,6 +114,7 @@ void Connection::handle_GET_FIELD()
}
std::shared_ptr<Operation> op;
InfoOp* info;
{
auto it = opByIOID.find(ioid);
if(it==opByIOID.end()
@@ -121,11 +123,11 @@ void Connection::handle_GET_FIELD()
log_warn_printf(io, "Server %s sends stale GET_FIELD\n", peerName.c_str());
return;
}
info = static_cast<InfoOp*>(op.get());
opByIOID.erase(it);
info->chan->opByIOID.erase(ioid);
}
auto info = static_cast<InfoOp*>(op.get());
if(info->state!=InfoOp::Waiting) {
log_warn_printf(io, "Server %s ignore second reply to GET_FIELD\n", peerName.c_str());
return;