0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-15 02:07:59 +08:00

Merge pull request #19 from rodgert/master

Revert previous accidental push directly to zeromq/zeromq4-1
This commit is contained in:
Pieter Hintjens 2015-02-18 21:18:43 +01:00
commit 5b6b850d9a
4 changed files with 8 additions and 10 deletions

View File

@ -208,7 +208,6 @@ int zmq::stream_t::xrecv (msg_t *msg_)
// We have received a frame with TCP data.
// Rather than sendig this frame, we keep it in prefetched
// buffer and send a frame with peer's ID.
blob_t identity = pipe->get_identity ();
rc = msg_->init_size (identity.size ());
errno_assert (rc == 0);

View File

@ -36,6 +36,7 @@
#include <string.h>
#include <new>
#include <sstream>
#include <iostream>
#include "stream_engine.hpp"
#include "io_thread.hpp"
@ -206,11 +207,9 @@ void zmq::stream_engine_t::plug (io_thread_t *io_thread_,
// application so that it knows a peer has connected.
msg_t connector;
connector.init();
if (metadata)
connector.set_metadata(metadata);
push_msg_to_session (&connector);
session->flush ();
push_raw_msg_to_session (&connector);
connector.close();
session->flush ();
}
else {
// start optional timer, to prevent handshake hanging on no input
@ -802,6 +801,7 @@ void zmq::stream_engine_t::mechanism_ready ()
// Compile metadata.
typedef metadata_t::dict_t properties_t;
properties_t properties;
properties_t::const_iterator it;
// If we have a peer_address, add it to metadata
if (!peer_address.empty()) {

View File

@ -96,11 +96,11 @@ namespace zmq
int next_handshake_command (msg_t *msg);
int process_handshake_command (msg_t *msg);
int push_raw_msg_to_session (msg_t *msg);
int pull_msg_from_session (msg_t *msg_);
int push_msg_to_session (msg_t *msg);
int push_raw_msg_to_session (msg_t *msg);
int write_credential (msg_t *msg_);
int pull_and_encode (msg_t *msg_);
int decode_and_push (msg_t *msg_);

View File

@ -74,13 +74,12 @@ test_stream_to_dealer (void)
rc = zmq_msg_init (&identity);
assert (rc == 0);
rc = zmq_msg_recv (&identity, stream, 0);
assert (rc > 0);
assert (zmq_msg_more (&identity));
// Verify the existence of Peer-Address metadata
assert (streq (zmq_msg_gets (&identity, "Peer-Address"), "127.0.0.1"));
assert (rc > 0);
assert (zmq_msg_more (&identity));
// Second frame is zero
byte buffer [255];
rc = zmq_recv (stream, buffer, 255, 0);