server: adjust handling of invalid SID

Downgrade severity as invalid SIDs are an
unavoidable possibility after server
channel destroy.
This commit is contained in:
Michael Davidsaver
2020-08-08 16:09:35 -07:00
parent e52ae674ca
commit 280919b3ec
5 changed files with 25 additions and 14 deletions
+10 -3
View File
@@ -472,8 +472,9 @@ void ServerConn::handle_MONITOR()
auto& chan = lookupSID(sid);
if(opByIOID.find(ioid)!=opByIOID.end()) {
log_err_printf(connsetup, "Client %s reuses existing ioid %u\n", peerName.c_str(), unsigned(ioid));
if(!chan || opByIOID.find(ioid)!=opByIOID.end()) {
log_err_printf(connsetup, "Client %s reuses existing sid %u ioid %u\n",
peerName.c_str(), unsigned(sid), unsigned(ioid));
bev.reset();
return;
}
@@ -540,7 +541,13 @@ void ServerConn::handle_MONITOR()
return;
}
auto& chan = lookupSID(sid);
auto chan(op->chan.lock());
if(!chan || chan->sid!=sid) {
log_err_printf(connio, "Client %s MONITOR inconsistent sid %u:%u ioid %u\n",
peerName.c_str(), unsigned(sid), unsigned(chan ? chan->sid : -1), ioid);
bev.reset();
return;
}
// pvAccessCPP won't accept ack and start/stop in the same message,
// although it will accept destroy in any !INIT message.