[zeromq-dev] Associating messages to authenticated clients

Goswin von Brederlow goswin-v-b at web.de
Mon Jan 27 16:41:22 CET 2014

On Mon, Jan 27, 2014 at 07:54:24AM -0600, Pieter Hintjens wrote:
> On Mon, Jan 27, 2014 at 5:33 AM, Goswin von Brederlow <goswin-v-b at web.de> wrote:
> > I added the mechanism pointer to the message itself increasing its
> > size and breaking ABI. That is a big problem.
> > a) only messages with contents need the pointer so the pointer could
> > be moved into the union next to the content pointer.
> Currently small messages would use the VSM structure. You could force
> all messages into contents, if there is metadata. Or, if you used a
> separate method for receiving such messages.

Or make small 4/8 byte smaller and put the pointer at the end of the
VSM structure. Messages would then switch to contents 4/8 byte earlier
but the API wouldn't change since the message type is abstract to the
> > 2) memory management> I think the mechanism structure must be extended to have a reference
> > count.
> Sounds right.
> > 3) API to access metadata, properties, ...
> > I'm not sure how metadata and properties are suposed to be set and
> > used. Should each have their own retrieval function? Or is one generic
> > function similar to getsockopt enough? Maybe user_id and metadata
> > should even just be another property?
> >
> > I just added zmq_msg_get_user_id() as a proof-of-concept. Seemed to be
> > the simplest thing to test the idea.
> There are a set of fixed properties that are easiest to access via
> individual methods. And there is generic metadata that we'd access
> using a single "get" method.
> > 4) write access to the metadata
> Unless you have a specific problem where modifying metadata in the
> application is the simplest solution, I'd stay away from this. It
> sounds like a bad idea anyhow.
> -Pieter

Ok. I will put that on my ToDo then. But I won't have time to work on
this in the next 2 weeks or so as other matters are more pressing.

If anyone wants to work a bit on this then feel free to send me a pull
request. Or send one to the main repository if you finish the feature.


PS: don't forget test cases for all socket types and security mechanisms.

More information about the zeromq-dev mailing list