Skip to content

Commit

Permalink
fix bug: coredump if set linger and immediate together
Browse files Browse the repository at this point in the history
In function session_base_t::reconnect, if we set immediate to 1 and set linger, we will get into first block of reconnect function, and set pipe to NULL, but we forget to cancel timer of linger. Once timer tiggered, we will get coredump. Solution: cancel timer in the end of set pipe to NULL
  • Loading branch information
laplaceyang committed Jun 2, 2017
1 parent bcc30f2 commit 67a6594
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/session_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,11 @@ void zmq::session_base_t::reconnect ()
pipe->terminate (false);
terminating_pipes.insert (pipe);
pipe = NULL;

if (has_linger_timer) {
cancel_timer (linger_timer_id);
has_linger_timer = false;
}
}

reset ();
Expand Down

0 comments on commit 67a6594

Please sign in to comment.