summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-09-10 16:32:06 +0200
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-09-10 16:32:06 +0200
commitf674c9269e04546da22e45ef6fff9303441680ea (patch)
treea4004c734f24b0d674f527d028e94e8d871ba64e /src
parent93e70ee583489034c9f3b92fb87b374707afd5d5 (diff)
ZMQII-2: SIGSEGV in zmq_connecter_init_t::read
Diffstat (limited to 'src')
-rw-r--r--src/zmq_decoder.cpp2
-rw-r--r--src/zmq_encoder.cpp2
-rw-r--r--src/zmq_engine.cpp2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/zmq_decoder.cpp b/src/zmq_decoder.cpp
index b461234..e51d802 100644
--- a/src/zmq_decoder.cpp
+++ b/src/zmq_decoder.cpp
@@ -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);
diff --git a/src/zmq_encoder.cpp b/src/zmq_encoder.cpp
index 55e1a83..44b919b 100644
--- a/src/zmq_encoder.cpp
+++ b/src/zmq_encoder.cpp
@@ -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);
diff --git a/src/zmq_engine.cpp b/src/zmq_engine.cpp
index 298dd57..3ed9ba5 100644
--- a/src/zmq_engine.cpp
+++ b/src/zmq_engine.cpp
@@ -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;
}