Problem: ZMTP 3.1 PING Context not implemented

Solution: if a PING message contains a context, echo it back in the
PONG message. In order to do so, create the PONG message when PING
is received and store it in the engine.
After the PING the engine goes straight to encoding and sending, so
there can always be at most one pending PING.
Add tests for various contexts.
This commit is contained in:
Luca Boccassi
2018-04-28 18:11:37 +01:00
committed by Simon Giesecke
parent 5482b1ca45
commit b331caad06
3 changed files with 81 additions and 28 deletions

View File

@@ -139,6 +139,8 @@ class stream_engine_t : public io_object_t, public i_engine
bool as_server;
msg_t tx_msg;
// Need to store PING payload for PONG
msg_t pong_msg;
handle_t handle;