keep generated decode output and append it to error prefix on error

This commit is contained in:
John
2024-06-28 18:11:40 +02:00
parent 6e59fd2c87
commit a8362bd087
+7 -2
View File
@@ -382,10 +382,15 @@ void MainLoop::run() {
scanRetry = 0; // restart scan counting scanRetry = 0; // restart scan counting
} }
if (!req->isHttp() && (ostream.tellp() == 0 || result != RESULT_OK)) { if (!req->isHttp() && (ostream.tellp() == 0 || result != RESULT_OK)) {
if (reqMode.listenMode != lm_direct) { string suffix;
ostream.str(""); if (result == RESULT_EMPTY && ostream.tellp() > 0) {
suffix = ostream.str();
} }
ostream.str("");
ostream << getResultCode(result); ostream << getResultCode(result);
if (!suffix.empty()) {
ostream << " " << suffix;
}
} }
const auto resp = ostream.str(); const auto resp = ostream.str();
req->log(&resp); req->log(&resp);