[zeromq-dev] Router drops empty first frame on inproc://

Pieter Hintjens ph at imatix.com
Tue Feb 4 21:13:58 CET 2014


Hi all,

Issue https://github.com/zeromq/libzmq/issues/872 causes message
corruption over inproc and dealer-router.

Test case is at:
https://github.com/zeromq/issues/commit/58bd49421e8b2d06761eda838cbe311b754d7f62

The fault is IMO in router.cpp, around line 414:

        if (msg.size () == 0) {
            //  Fall back on the auto-generation
            unsigned char buf [5];
            buf [0] = 0;
            put_uint32 (buf + 1, next_rid++);
            identity = blob_t (buf, sizeof buf);
            msg.close ();
        }

which replaces an empty initial message with an ID frame. If the first
message isn't empty, the ID frame isn't generated at all.

Anyone have an idea?

-Pieter



More information about the zeromq-dev mailing list