From 370b8c9bb1af509e4bc2f1bb24a6858f4521fc79 Mon Sep 17 00:00:00 2001 From: Kapp Arnaud Date: Thu, 20 Aug 2015 01:03:34 +0200 Subject: [PATCH] Problem: Identity frame from router has no metadata The routing id (identity) frame return when reading from a router doesn't have the same metadata as the "real" message that follows. For example, The ZAP "User-Id" property is missing. This patch attach the "data message"'s metadata to the "identity message" when it is read from the router. --- src/router.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/router.cpp b/src/router.cpp index 29e53cdb..545a25f8 100644 --- a/src/router.cpp +++ b/src/router.cpp @@ -326,6 +326,8 @@ int zmq::router_t::xrecv (msg_t *msg_) errno_assert (rc == 0); memcpy (msg_->data (), identity.data (), identity.size ()); msg_->set_flags (msg_t::more); + if (prefetched_msg.metadata()) + msg_->set_metadata(prefetched_msg.metadata()); identity_sent = true; }