Hi all,

Here are some thoughts after having tested curvezmq and analysed the source code :

1) A czmq zmsg extension to curvezmq would be nice. I assume it would be included in curvezmq.

2) It looks like the second s_encrypt in s_produce_initiate can use precom since it is (c'->S'). Same on the server side, precom could be computed earlier inside s_produce_welcome to be used as of s_process_initiate in the second s_decrypt.

3) It is writen in the TODO lines : "don't assert, but raise error on connection". In my understanding, the error may be returned (process function prototypes changed from return value void to int), and used by curvezmq_codec_execute to reset the state machine. On the server side, there shall not exist exception from bad client messages.

4) It may be a good idea to test the possible NULL return value from the s_produce_ functions.

5) verbose should be passed to server_task

6) In s_process_hello, the signature should be compared to the original one.

7) In s_process_ready, the client metadata are overwritten by server's ones. Is it the expected behaviour ?

8) In s_process_ready, no size check is performed ws the hard-coded limit 1,000, what can lead to memory violation. Would it be preferable to malloc the metadata ?

and a question :

1) What would be the best design to handle several clients starting an handshake on the same server socket in the same time ? I think of a hash table with the sender id as a key, and a struct {lifetime; curvezmq_codec_t*} as its value. The lifetime would be reset each time a valid message is received.

I hope it is usefull ;-) .

Cheers,

Laurent.
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to