diff options
author | Martin Hurton <hurtonm@gmail.com> | 2012-04-05 15:32:45 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-04-07 07:01:37 +0200 |
commit | 5fe5588351801dadb0c71584ca2c390f4ae2c57a (patch) | |
tree | 58da1db285e442cc8efdc75ebfa32d6ed7a1d295 | |
parent | 79f9c65133801d3a4a634dc59d418af68cf39508 (diff) |
Fix identity exchange for inproc transport
The socket connecting using the inproc transport never
received the identity of the remote peer.
-rw-r--r-- | src/socket_base.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp index 26aa209..0e856ff 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -425,6 +425,19 @@ int xs::socket_base_t::connect (const char *addr_) pipes [0]->flush (); } + // If required, send the identity of the peer to the local socket. + if (peer.options.send_identity) { + msg_t id; + rc = id.init_size (peer.options.identity_size); + xs_assert (rc == 0); + memcpy (id.data (), peer.options.identity, + peer.options.identity_size); + id.set_flags (msg_t::identity); + bool written = ppair [1]->write (&id); + xs_assert (written); + ppair [1]->flush (); + } + // Attach remote end of the pipe to the peer socket. Note that peer's // seqnum was incremented in find_endpoint function. We don't need it // increased here. |