mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-18 17:36:57 +00:00
Fix LIBZMQ-576 - Revert "Merge pull request #76 from hintjens/master"
This reverts commit a0a24a92af78ebb8f61a8a45454d3ff6d2db0a3d, reversing changes made to 8e748064acf877e5322f681c30323d7dc91e2100. See https://zeromq.jira.com/browse/LIBZMQ-576 for details
This commit is contained in:
parent
f5bc82d9a4
commit
ea9af1cadb
@ -124,11 +124,6 @@ namespace zmq
|
|||||||
*size_ = pos;
|
*size_ = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool has_data ()
|
|
||||||
{
|
|
||||||
return to_write > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Prototype of state machine action.
|
// Prototype of state machine action.
|
||||||
|
@ -47,7 +47,6 @@ namespace zmq
|
|||||||
virtual void get_data (unsigned char **data_, size_t *size_,
|
virtual void get_data (unsigned char **data_, size_t *size_,
|
||||||
int *offset_ = NULL) = 0;
|
int *offset_ = NULL) = 0;
|
||||||
|
|
||||||
virtual bool has_data () = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,6 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_, cons
|
|||||||
options (options_),
|
options (options_),
|
||||||
endpoint (endpoint_),
|
endpoint (endpoint_),
|
||||||
plugged (false),
|
plugged (false),
|
||||||
terminating (false),
|
|
||||||
socket (NULL)
|
socket (NULL)
|
||||||
{
|
{
|
||||||
// Put the socket into non-blocking mode.
|
// Put the socket into non-blocking mode.
|
||||||
@ -173,11 +172,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;
|
||||||
}
|
}
|
||||||
@ -279,8 +273,6 @@ void zmq::stream_engine_t::out_event ()
|
|||||||
// this is necessary to prevent losing incomming messages.
|
// this is necessary to prevent losing incomming messages.
|
||||||
if (nbytes == -1) {
|
if (nbytes == -1) {
|
||||||
reset_pollout (handle);
|
reset_pollout (handle);
|
||||||
if (unlikely (terminating))
|
|
||||||
terminate ();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,10 +284,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::activate_out ()
|
void zmq::stream_engine_t::activate_out ()
|
||||||
|
@ -135,7 +135,6 @@ namespace zmq
|
|||||||
std::string endpoint;
|
std::string endpoint;
|
||||||
|
|
||||||
bool plugged;
|
bool plugged;
|
||||||
bool terminating;
|
|
||||||
|
|
||||||
// Socket
|
// Socket
|
||||||
zmq::socket_base_t *socket;
|
zmq::socket_base_t *socket;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user