make sure the last output message is sent

This commit is contained in:
Florian Lüke 2023-07-11 20:30:46 +02:00
parent 4f8da45a67
commit 20a4323fa2
2 changed files with 18 additions and 1 deletions

@ -1 +1 @@
Subproject commit c04c2114583d3f067e4f95036c3d2b805a423073 Subproject commit 8edc5890087e9794175013fbc5658c95fe0624b3

View file

@ -554,6 +554,23 @@ void listfile_parser_nng(
} }
} }
if (parserContext.outputMessage)
{
const auto msgSize = nng_msg_len(parserContext.outputMessage);
if (auto res = send_message_retry(outputSocket, parserContext.outputMessage, 0, "listfile_parser_nng"))
{
nng_msg_free(parserContext.outputMessage);
parserContext.outputMessage = nullptr;
spdlog::error("listfile_parser_nng: send_message_retry: {}:", nng_strerror(res));
}
parserContext.outputMessage = nullptr;
spdlog::debug("listfile_parser_nng: sent message {} of size {}",
outputMessageNumber, msgSize);
}
if (inputMsg) if (inputMsg)
{ {
nng_msg_free(inputMsg); nng_msg_free(inputMsg);