Mock Adapter: Switch back to handlers once the queue is empty. 31/9431/1
authorMilan Lenco <milan.lenco@pantheon.tech>
Wed, 15 Nov 2017 10:52:18 +0000 (11:52 +0100)
committerMilan Lenco <milan.lenco@pantheon.tech>
Wed, 15 Nov 2017 15:58:00 +0000 (16:58 +0100)
Change-Id: Ifc85a80498521ef218a34072cce470bf32cead9c
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
adapter/mock/mock_adapter.go

index 8c88030..e6b4bc4 100644 (file)
@@ -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
                }