mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-17 16:43:58 +00:00
Merge pull request #46 from vortechs2000/fix-libzmq-576
Fix LIBZMQ-576 - Revert "Merge pull request #510 from miniway/master"
This commit is contained in:
commit
a37c198c7d
@ -127,11 +127,6 @@ namespace zmq
|
|||||||
(static_cast <T*> (this)->*next) ();
|
(static_cast <T*> (this)->*next) ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool has_data ()
|
|
||||||
{
|
|
||||||
return to_write > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Prototype of state machine action.
|
// Prototype of state machine action.
|
||||||
|
@ -43,7 +43,6 @@ namespace zmq
|
|||||||
// Load a new message into encoder.
|
// Load a new message into encoder.
|
||||||
virtual void load_msg (msg_t *msg_) = 0;
|
virtual void load_msg (msg_t *msg_) = 0;
|
||||||
|
|
||||||
virtual bool has_data () = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,6 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_,
|
|||||||
options (options_),
|
options (options_),
|
||||||
endpoint (endpoint_),
|
endpoint (endpoint_),
|
||||||
plugged (false),
|
plugged (false),
|
||||||
terminating (false),
|
|
||||||
read_msg (&stream_engine_t::read_identity),
|
read_msg (&stream_engine_t::read_identity),
|
||||||
write_msg (&stream_engine_t::write_identity),
|
write_msg (&stream_engine_t::write_identity),
|
||||||
io_error (false),
|
io_error (false),
|
||||||
@ -183,11 +182,6 @@ void zmq::stream_engine_t::unplug ()
|
|||||||
|
|
||||||
void zmq::stream_engine_t::terminate ()
|
void zmq::stream_engine_t::terminate ()
|
||||||
{
|
{
|
||||||
if (!terminating && encoder && encoder->has_data ()) {
|
|
||||||
// Give io_thread a chance to send in the buffer
|
|
||||||
terminating = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
unplug ();
|
unplug ();
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
@ -314,8 +308,6 @@ void zmq::stream_engine_t::out_event ()
|
|||||||
// this is necessary to prevent losing incoming messages.
|
// this is necessary to prevent losing incoming messages.
|
||||||
if (nbytes == -1) {
|
if (nbytes == -1) {
|
||||||
reset_pollout (handle);
|
reset_pollout (handle);
|
||||||
if (unlikely (terminating))
|
|
||||||
terminate ();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,10 +319,6 @@ void zmq::stream_engine_t::out_event ()
|
|||||||
if (unlikely (handshaking))
|
if (unlikely (handshaking))
|
||||||
if (outsize == 0)
|
if (outsize == 0)
|
||||||
reset_pollout (handle);
|
reset_pollout (handle);
|
||||||
|
|
||||||
if (unlikely (terminating))
|
|
||||||
if (outsize == 0)
|
|
||||||
terminate ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void zmq::stream_engine_t::restart_output ()
|
void zmq::stream_engine_t::restart_output ()
|
||||||
|
@ -162,7 +162,6 @@ namespace zmq
|
|||||||
std::string endpoint;
|
std::string endpoint;
|
||||||
|
|
||||||
bool plugged;
|
bool plugged;
|
||||||
bool terminating;
|
|
||||||
|
|
||||||
int (stream_engine_t::*read_msg) (msg_t *msg_);
|
int (stream_engine_t::*read_msg) (msg_t *msg_);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user