0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-30 01:06:55 +08:00

Problem: assertion triggered in stream_connecter_base::close

Solution: change into regular control flow condition
This commit is contained in:
Simon Giesecke 2019-02-11 11:23:48 -05:00
parent 2759f459df
commit 7fbd977184

View File

@ -130,17 +130,19 @@ void zmq::stream_connecter_base_t::rm_handle ()
void zmq::stream_connecter_base_t::close () void zmq::stream_connecter_base_t::close ()
{ {
zmq_assert (_s != retired_fd); // TODO before, this was an assertion for _s != retired_fd, but this does not match usage of close
if (_s != retired_fd) {
#ifdef ZMQ_HAVE_WINDOWS #ifdef ZMQ_HAVE_WINDOWS
const int rc = closesocket (_s); const int rc = closesocket (_s);
wsa_assert (rc != SOCKET_ERROR); wsa_assert (rc != SOCKET_ERROR);
#else #else
const int rc = ::close (_s); const int rc = ::close (_s);
errno_assert (rc == 0); errno_assert (rc == 0);
#endif #endif
_socket->event_closed (make_unconnected_connect_endpoint_pair (_endpoint), _socket->event_closed (
_s); make_unconnected_connect_endpoint_pair (_endpoint), _s);
_s = retired_fd; _s = retired_fd;
}
} }
void zmq::stream_connecter_base_t::in_event () void zmq::stream_connecter_base_t::in_event ()