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

Resolve LIBZMQ-459

Ref: https://zeromq.jira.com/browse/LIBZMQ-459
This commit is contained in:
Martin Hurton 2012-11-02 11:11:14 +01:00 committed by Pieter Hintjens
parent fec6497976
commit 50e9d72dc4

View File

@ -238,8 +238,15 @@ void zmq::stream_engine_t::out_event ()
// If write buffer is empty, try to read new data from the encoder.
if (!outsize) {
// Even when we stop polling as soon as there is no
// data to send, the poller may invoke out_event one
// more time due to 'speculative write' optimisation.
if (unlikely (encoder == NULL)) {
zmq_assert (handshaking);
return;
}
outpos = NULL;
zmq_assert (encoder);
encoder->get_data (&outpos, &outsize);
// If there is no data to send, stop polling for output.