Backported fix for #1399

Problem: asserts if EINVAL recieved on read/write

This causes assertion failures after network reconnects.

Solution: allow EINVAL as a possible condition after read/write.

Fixes #829
Fixes #1399

Patch provided by Michele Dionisio @mdionisio, thanks :)
This commit is contained in:
Pieter Hintjens 2015-11-01 09:04:31 +01:00
parent e3e699190f
commit a73740b304

View File

@ -192,7 +192,6 @@ int zmq::tcp_write (fd_t s_, const void *data_, size_t size_)
&& errno != EBADF && errno != EBADF
&& errno != EDESTADDRREQ && errno != EDESTADDRREQ
&& errno != EFAULT && errno != EFAULT
&& errno != EINVAL
&& errno != EISCONN && errno != EISCONN
&& errno != EMSGSIZE && errno != EMSGSIZE
&& errno != ENOMEM && errno != ENOMEM
@ -241,7 +240,6 @@ int zmq::tcp_read (fd_t s_, void *data_, size_t size_)
if (rc == -1) { if (rc == -1) {
errno_assert (errno != EBADF errno_assert (errno != EBADF
&& errno != EFAULT && errno != EFAULT
&& errno != EINVAL
&& errno != ENOMEM && errno != ENOMEM
&& errno != ENOTSOCK); && errno != ENOTSOCK);
if (errno == EWOULDBLOCK || errno == EINTR) if (errno == EWOULDBLOCK || errno == EINTR)