mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-15 10:18:01 +08:00
Merge pull request #19 from rodgert/master
Revert previous accidental push directly to zeromq/zeromq4-1
This commit is contained in:
commit
5b6b850d9a
@ -208,7 +208,6 @@ int zmq::stream_t::xrecv (msg_t *msg_)
|
|||||||
// We have received a frame with TCP data.
|
// We have received a frame with TCP data.
|
||||||
// Rather than sendig this frame, we keep it in prefetched
|
// Rather than sendig this frame, we keep it in prefetched
|
||||||
// buffer and send a frame with peer's ID.
|
// buffer and send a frame with peer's ID.
|
||||||
|
|
||||||
blob_t identity = pipe->get_identity ();
|
blob_t identity = pipe->get_identity ();
|
||||||
rc = msg_->init_size (identity.size ());
|
rc = msg_->init_size (identity.size ());
|
||||||
errno_assert (rc == 0);
|
errno_assert (rc == 0);
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "stream_engine.hpp"
|
#include "stream_engine.hpp"
|
||||||
#include "io_thread.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.
|
// application so that it knows a peer has connected.
|
||||||
msg_t connector;
|
msg_t connector;
|
||||||
connector.init();
|
connector.init();
|
||||||
if (metadata)
|
push_raw_msg_to_session (&connector);
|
||||||
connector.set_metadata(metadata);
|
|
||||||
push_msg_to_session (&connector);
|
|
||||||
session->flush ();
|
|
||||||
connector.close();
|
connector.close();
|
||||||
|
session->flush ();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// start optional timer, to prevent handshake hanging on no input
|
// start optional timer, to prevent handshake hanging on no input
|
||||||
@ -802,6 +801,7 @@ void zmq::stream_engine_t::mechanism_ready ()
|
|||||||
// Compile metadata.
|
// Compile metadata.
|
||||||
typedef metadata_t::dict_t properties_t;
|
typedef metadata_t::dict_t properties_t;
|
||||||
properties_t properties;
|
properties_t properties;
|
||||||
|
properties_t::const_iterator it;
|
||||||
|
|
||||||
// If we have a peer_address, add it to metadata
|
// If we have a peer_address, add it to metadata
|
||||||
if (!peer_address.empty()) {
|
if (!peer_address.empty()) {
|
||||||
|
@ -96,11 +96,11 @@ namespace zmq
|
|||||||
int next_handshake_command (msg_t *msg);
|
int next_handshake_command (msg_t *msg);
|
||||||
int process_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 pull_msg_from_session (msg_t *msg_);
|
||||||
int push_msg_to_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 write_credential (msg_t *msg_);
|
||||||
int pull_and_encode (msg_t *msg_);
|
int pull_and_encode (msg_t *msg_);
|
||||||
int decode_and_push (msg_t *msg_);
|
int decode_and_push (msg_t *msg_);
|
||||||
|
@ -74,13 +74,12 @@ test_stream_to_dealer (void)
|
|||||||
rc = zmq_msg_init (&identity);
|
rc = zmq_msg_init (&identity);
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
rc = zmq_msg_recv (&identity, stream, 0);
|
rc = zmq_msg_recv (&identity, stream, 0);
|
||||||
|
assert (rc > 0);
|
||||||
|
assert (zmq_msg_more (&identity));
|
||||||
|
|
||||||
// Verify the existence of Peer-Address metadata
|
// Verify the existence of Peer-Address metadata
|
||||||
assert (streq (zmq_msg_gets (&identity, "Peer-Address"), "127.0.0.1"));
|
assert (streq (zmq_msg_gets (&identity, "Peer-Address"), "127.0.0.1"));
|
||||||
|
|
||||||
assert (rc > 0);
|
|
||||||
assert (zmq_msg_more (&identity));
|
|
||||||
|
|
||||||
// Second frame is zero
|
// Second frame is zero
|
||||||
byte buffer [255];
|
byte buffer [255];
|
||||||
rc = zmq_recv (stream, buffer, 255, 0);
|
rc = zmq_recv (stream, buffer, 255, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user