p2p: stop buffered dispatch after fatal notifications

(cherry picked from commit f397f3920998aa8f57f86c9539fd720d288c7e18)
This commit is contained in:
selsta
2026-10-04 18:50:22 -04:00
committed by such-gitea
parent 333e916fbc
commit af216147b0
4 changed files with 61 additions and 51 deletions
@@ -562,7 +562,13 @@ public:
return false;
}
else
m_config.m_pcommands_handler->notify(m_current_head.m_command, buff_to_invoke, m_connection_context);
{
const int notify_result = m_config.m_pcommands_handler->notify(
m_current_head.m_command, buff_to_invoke, m_connection_context
);
if(notify_result < 0)
return false;
}
}
// reuse small buffer
if (!temp.empty() && temp.capacity() <= 64 * 1024)
@@ -285,7 +285,7 @@ namespace epee
#define END_INVOKE_MAP2() \
LOG_ERROR("Unknown command:" << command); \
on_levin_traffic(context, false, false, true, in_buff.size(), "invalid-command"); \
return LEVIN_ERROR_CONNECTION_HANDLER_NOT_DEFINED; \
return is_notify ? LEVIN_OK : LEVIN_ERROR_CONNECTION_HANDLER_NOT_DEFINED; \
} \
catch (const std::exception &e) { \
MERROR("Error in handle_invoke_map: " << e.what()); \