Commit 47c0b6ec authored by somdoron's avatar somdoron

problem: dgram doesn't need to prefetch messages

parent d7919326
...@@ -40,7 +40,6 @@ zmq::dgram_t::dgram_t (class ctx_t *parent_, uint32_t tid_, int sid_) : ...@@ -40,7 +40,6 @@ zmq::dgram_t::dgram_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
socket_base_t (parent_, tid_, sid_), socket_base_t (parent_, tid_, sid_),
pipe (NULL), pipe (NULL),
last_in (NULL), last_in (NULL),
prefetched (false),
more_out (false) more_out (false)
{ {
options.type = ZMQ_DGRAM; options.type = ZMQ_DGRAM;
...@@ -115,7 +114,7 @@ int zmq::dgram_t::xsend (msg_t *msg_) ...@@ -115,7 +114,7 @@ int zmq::dgram_t::xsend (msg_t *msg_)
// This is the last part of the message. // This is the last part of the message.
more_out = false; more_out = false;
} }
// Push the message into the pipe. // Push the message into the pipe.
if (!pipe->write (msg_)) { if (!pipe->write (msg_)) {
errno = EAGAIN; errno = EAGAIN;
...@@ -148,24 +147,11 @@ int zmq::dgram_t::xrecv (msg_t *msg_) ...@@ -148,24 +147,11 @@ int zmq::dgram_t::xrecv (msg_t *msg_)
} }
last_in = pipe; last_in = pipe;
if (prefetched) {
msg_->reset_flags (msg_t::more);
prefetched = false;
}
else {
msg_->set_flags (msg_t::more);
prefetched = true;
}
return 0; return 0;
} }
bool zmq::dgram_t::xhas_in () bool zmq::dgram_t::xhas_in ()
{ {
// We may already have a message pre-fetched.
if (prefetched)
return true;
if (!pipe) if (!pipe)
return false; return false;
......
...@@ -68,9 +68,6 @@ namespace zmq ...@@ -68,9 +68,6 @@ namespace zmq
zmq::pipe_t *last_in; zmq::pipe_t *last_in;
blob_t saved_credential; blob_t saved_credential;
// True iff there is a message held in the pre-fetch buffer.
bool prefetched;
// If true, more outgoing message parts are expected. // If true, more outgoing message parts are expected.
bool more_out; bool more_out;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment