mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-03 12:58:05 +01:00
Merge pull request #1631 from swansontec/master
Do not crash on unusual connection-failure cases
This commit is contained in:
commit
c775c509da
@ -347,16 +347,10 @@ zmq::fd_t zmq::tcp_connecter_t::connect ()
|
|||||||
#ifdef ZMQ_HAVE_WINDOWS
|
#ifdef ZMQ_HAVE_WINDOWS
|
||||||
zmq_assert (rc == 0);
|
zmq_assert (rc == 0);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
if (err != WSAECONNREFUSED
|
if (err == WSAEBADF ||
|
||||||
&& err != WSAETIMEDOUT
|
err == WSAENOPROTOOPT ||
|
||||||
&& err != WSAECONNABORTED
|
err == WSAENOTSOCK ||
|
||||||
&& err != WSAEHOSTUNREACH
|
err == WSAENOBUFS)
|
||||||
&& err != WSAENETUNREACH
|
|
||||||
&& err != WSAENETDOWN
|
|
||||||
&& err != WSAEACCES
|
|
||||||
&& err != WSAEINVAL
|
|
||||||
&& err != WSAEADDRINUSE
|
|
||||||
&& err != WSAEADDRNOTAVAIL)
|
|
||||||
{
|
{
|
||||||
wsa_assert_no (err);
|
wsa_assert_no (err);
|
||||||
}
|
}
|
||||||
@ -370,14 +364,10 @@ zmq::fd_t zmq::tcp_connecter_t::connect ()
|
|||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
errno = err;
|
errno = err;
|
||||||
errno_assert (
|
errno_assert (
|
||||||
errno == ECONNREFUSED ||
|
errno != EBADF &&
|
||||||
errno == ECONNRESET ||
|
errno != ENOPROTOOPT &&
|
||||||
errno == ETIMEDOUT ||
|
errno != ENOTSOCK &&
|
||||||
errno == EHOSTUNREACH ||
|
errno != ENOBUFS);
|
||||||
errno == ENETUNREACH ||
|
|
||||||
errno == ENETDOWN ||
|
|
||||||
errno == EINVAL ||
|
|
||||||
errno == EADDRNOTAVAIL);
|
|
||||||
return retired_fd;
|
return retired_fd;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user