Merge pull request #320 from shripchenko/master

ZMQ BUG FOUND + fixes for zmq_unbind() / zmq_disconnect() usage corner cases
This commit is contained in:
Pieter Hintjens
2012-04-21 09:52:46 -07:00
7 changed files with 113 additions and 6 deletions

View File

@@ -552,6 +552,12 @@ int zmq::socket_base_t::term_endpoint (const char *addr_)
return -1;
}
// Process pending commands, if any, since there could be pending unprocessed process_own()'s
// (from launch_child() for example) we're asked to terminate now.
int rc = process_commands (0, false);
if (unlikely (rc != 0))
return -1;
// Find the endpoints range (if any) corresponding to the addr_ string.
std::pair <endpoints_t::iterator, endpoints_t::iterator> range = endpoints.equal_range (std::string (addr_));
if (range.first == range.second)