client: fix monitor INIT error handling

data payload only present on success
This commit is contained in:
Michael Davidsaver
2021-01-07 10:10:08 -08:00
parent c76ef3e52f
commit b2b264ee9b
+10 -2
View File
@@ -353,7 +353,7 @@ void Connection::handle_MONITOR()
if(init || final)
from_wire(M, sts);
if(init)
if(init && sts.isSuccess())
from_wire_type(M, rxRegistry, data);
RequestInfo* info=nullptr;
@@ -462,7 +462,15 @@ void Connection::handle_MONITOR()
}
bool notify = false;
if(!init) {
if(init && !sts.isSuccess()) {
log_debug_printf(io, "Server %s channel %s monitor PUSH init error\n",
peerName.c_str(),
mon->chan->name.c_str());
mon->queue.emplace_back(std::move(update));
notify = true;
} else if(!init) {
Guard G(mon->lock);
if(mon->pipeline) {