Corrected assembly of AndX Response chain

This commit is contained in:
Tal Aloni 2017-07-28 14:04:41 +03:00
parent b08850d7af
commit d715acb050

View file

@ -42,12 +42,17 @@ namespace SMBLibrary.Server
reply.Header = header; reply.Header = header;
for (int index = 0; index < responses.Count; index++) for (int index = 0; index < responses.Count; index++)
{ {
if (responses[index] is SMBAndXCommand || index == responses.Count - 1) if (reply.Commands.Count == 0 ||
reply.Commands[reply.Commands.Count - 1] is SMBAndXCommand)
{ {
reply.Commands.Add(responses[index]); reply.Commands.Add(responses[index]);
responses.RemoveAt(index); responses.RemoveAt(index);
index--; index--;
} }
else
{
break;
}
} }
EnqueueMessage(state, reply); EnqueueMessage(state, reply);
} }