ZMQII-2: SIGSEGV in zmq_connecter_init_t::read

This commit is contained in:
Martin Sustrik 2009-09-10 16:32:06 +02:00
parent 93e70ee583
commit f674c9269e
3 changed files with 4 additions and 2 deletions

View File

@ -70,7 +70,7 @@ bool zmq::zmq_decoder_t::message_ready ()
{
// Message is completely read. Push it further and start reading
// new message.
if (!destination->write (&in_progress))
if (!destination || !destination->write (&in_progress))
return false;
next_step (tmpbuf, 1, &zmq_decoder_t::one_byte_size_ready);

View File

@ -54,7 +54,7 @@ bool zmq::zmq_encoder_t::message_ready ()
// Note that new state is set only if write is successful. That way
// unsuccessful write will cause retry on the next state machine
// invocation.
if (!source->read (&in_progress))
if (!source || !source->read (&in_progress))
return false;
size_t size = zmq_msg_size (&in_progress);

View File

@ -66,6 +66,8 @@ void zmq::zmq_engine_t::plug (i_inout *inout_)
void zmq::zmq_engine_t::unplug ()
{
rm_fd (handle);
encoder.set_inout (NULL);
decoder.set_inout (NULL);
inout = NULL;
}