Fix debug assertion on inconsistent sescmd result

The slave backend would be closed twice if it would both respond with a
different result and be closed due to a hangup before the master
responded.

Added a test case that reproduced the problem.
This commit is contained in:
Markus Mäkelä
2020-01-21 11:33:04 +02:00
parent 4f1ae70765
commit c04d6748d3
4 changed files with 122 additions and 1 deletions

View File

@ -65,7 +65,7 @@ static void discard_if_response_differs(SRWBackend backend,
uint8_t slave_response,
SSessionCommand sescmd)
{
if (master_response != slave_response)
if (master_response != slave_response && backend->in_use())
{
uint8_t cmd = sescmd->get_command();
std::string query = sescmd->to_string();