From: Milan Lenco Date: Wed, 15 Nov 2017 10:52:18 +0000 (+0100) Subject: Mock Adapter: Switch back to handlers once the queue is empty. X-Git-Tag: v0.1.0~73^2 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=d86cd12b17106b6c0dfc7424ba4d11d5dbd8253e;p=govpp.git Mock Adapter: Switch back to handlers once the queue is empty. Change-Id: Ifc85a80498521ef218a34072cce470bf32cead9c Signed-off-by: Milan Lenco --- diff --git a/adapter/mock/mock_adapter.go b/adapter/mock/mock_adapter.go index 8c88030..e6b4bc4 100644 --- a/adapter/mock/mock_adapter.go +++ b/adapter/mock/mock_adapter.go @@ -274,6 +274,11 @@ func (a *VppAdapter) SendMsg(clientID uint32, data []byte) error { } if len(replies) > 0 { replies = []api.Message{} + if len(replyHandlers) > 0 { + // Switch back to handlers once the queue is empty to revert back + // the fallthrough effect. + mode = useReplyHandlers + } return nil }