From bf730fac63b4bef2fe1617b76c7da82bd7697ae1 Mon Sep 17 00:00:00 2001 From: Antoine Millet Date: Mon, 3 Oct 2011 11:05:24 +0200 Subject: [PATCH] Fixed unknown labels consumption --- sjrpc/core/rpcconnection.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sjrpc/core/rpcconnection.py b/sjrpc/core/rpcconnection.py index de22c4b..2b42164 100644 --- a/sjrpc/core/rpcconnection.py +++ b/sjrpc/core/rpcconnection.py @@ -12,6 +12,7 @@ import socket import logging from sjrpc.core.protocols.rpc import RpcProtocol +from sjrpc.core.protocols import Protocol from sjrpc.core.exceptions import RpcError import pyev @@ -196,6 +197,12 @@ class RpcConnection(object): # Get the registered protocol for the specified label self._proto_receiving = self._protocols.get(label) + + # If frame's label is not binded to a protocol, we create a + # dummy protocol to consume the payload: + if self._proto_receiving is None: + self._proto_receiving = Protocol(self, -1) + self._proto_receiving.start_message(pl_size) self._inbound_buffer = '' self._remains = pl_size -- GitLab