-
Notifications
You must be signed in to change notification settings - Fork 46
Description
The protocol specification at http://tarantool.org/doc/box-protocol.html mandates a fixed 5-byte MP_UINT value for the BODY + HEADER SIZE field in a message header. That's how responses are encoded by the Tarantool server and requests are encoded by other drivers (I checked tarantool-php).
tarantool-python, however, encodes this field as a variable-length MP_UINT, so it can take 1 to 5 bytes, depending on the request size. The server handles it correctly, it does not enforce the fixed 5-byte field length and accepts an arbitrary MP_UINT. tarantool-python expects a fixed 5-byte field in responses (from Connection._read_response):
# Read packet length
length = msgpack.unpackb(self._recv(5))
# Read the packet
return self._recv(length)
Even though it works when talking to the server (because it always replies with a fixed 5-bytes size values), it's still a violation of the protocol spec. For example, if a proxy wants to reply to a PING request by echoing PING packet data in response (which would be correct assuming clients encode PING requests correctly), tarantool-python does not accept such a response. In other words, it sends garbage out, but expects valid replies back in.