summaryrefslogtreecommitdiff
path: root/src/zmq_init.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-04-29 07:19:22 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-04-29 07:19:22 +0200
commitb2eb84f8ca2fc2b8a2af6cd2c54c0abc4535cfc4 (patch)
tree76a2cf52187979a3c2deea324bd2915e6b406d17 /src/zmq_init.cpp
parent10fbc78e5cab494c3af727f5ea451fdced1c9d95 (diff)
Substantial simplification of uuid_t
The string format of UUID is not used in 0MQ. Further on, it turns out that UUIDs have fixed microarchitecture-agnostic binary layout (see RFC4122). Thus, the conversion to string and back to binary can be avoided. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/zmq_init.cpp')
-rw-r--r--src/zmq_init.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/zmq_init.cpp b/src/zmq_init.cpp
index ca7c66d..ea3b55d 100644
--- a/src/zmq_init.cpp
+++ b/src/zmq_init.cpp
@@ -47,10 +47,9 @@ zmq::zmq_init_t::zmq_init_t (io_thread_t *io_thread_,
alloc_assert (engine);
// Generate an unique identity.
- unsigned char identity [uuid_t::uuid_blob_len + 1];
- identity [0] = 0;
- memcpy (identity + 1, uuid_t ().to_blob (), uuid_t::uuid_blob_len);
- peer_identity.assign (identity, uuid_t::uuid_blob_len + 1);
+ peer_identity.resize (17);
+ peer_identity [0] = 0;
+ generate_uuid (&peer_identity [1]);
// Create a list of props to send.
msg_t msg;