forked from wolfSSL/wolfssl
fixed a cygwin bug for the build test. recv() was returning an unexpected error code for non-blocking sockets.
This commit is contained in:
8
src/io.c
8
src/io.c
@ -96,6 +96,7 @@
|
|||||||
#define SOCKET_EINTR WSAEINTR
|
#define SOCKET_EINTR WSAEINTR
|
||||||
#define SOCKET_EPIPE WSAEPIPE
|
#define SOCKET_EPIPE WSAEPIPE
|
||||||
#define SOCKET_ECONNREFUSED WSAENOTCONN
|
#define SOCKET_ECONNREFUSED WSAENOTCONN
|
||||||
|
#define SOCKET_ECONNABORTED WSAECONNABORTED
|
||||||
#elif defined(__PPU)
|
#elif defined(__PPU)
|
||||||
#define SOCKET_EWOULDBLOCK SYS_NET_EWOULDBLOCK
|
#define SOCKET_EWOULDBLOCK SYS_NET_EWOULDBLOCK
|
||||||
#define SOCKET_EAGAIN SYS_NET_EAGAIN
|
#define SOCKET_EAGAIN SYS_NET_EAGAIN
|
||||||
@ -103,6 +104,7 @@
|
|||||||
#define SOCKET_EINTR SYS_NET_EINTR
|
#define SOCKET_EINTR SYS_NET_EINTR
|
||||||
#define SOCKET_EPIPE SYS_NET_EPIPE
|
#define SOCKET_EPIPE SYS_NET_EPIPE
|
||||||
#define SOCKET_ECONNREFUSED SYS_NET_ECONNREFUSED
|
#define SOCKET_ECONNREFUSED SYS_NET_ECONNREFUSED
|
||||||
|
#define SOCKET_ECONNABORTED SYS_NET_ECONNABORTED
|
||||||
#elif defined(FREESCALE_MQX)
|
#elif defined(FREESCALE_MQX)
|
||||||
/* RTCS doesn't have an EWOULDBLOCK error */
|
/* RTCS doesn't have an EWOULDBLOCK error */
|
||||||
#define SOCKET_EWOULDBLOCK EAGAIN
|
#define SOCKET_EWOULDBLOCK EAGAIN
|
||||||
@ -111,6 +113,7 @@
|
|||||||
#define SOCKET_EINTR EINTR
|
#define SOCKET_EINTR EINTR
|
||||||
#define SOCKET_EPIPE EPIPE
|
#define SOCKET_EPIPE EPIPE
|
||||||
#define SOCKET_ECONNREFUSED RTCSERR_TCP_CONN_REFUSED
|
#define SOCKET_ECONNREFUSED RTCSERR_TCP_CONN_REFUSED
|
||||||
|
#define SOCKET_ECONNABORTED RTCSERR_TCP_CONN_ABORTED
|
||||||
#else
|
#else
|
||||||
#define SOCKET_EWOULDBLOCK EWOULDBLOCK
|
#define SOCKET_EWOULDBLOCK EWOULDBLOCK
|
||||||
#define SOCKET_EAGAIN EAGAIN
|
#define SOCKET_EAGAIN EAGAIN
|
||||||
@ -118,6 +121,7 @@
|
|||||||
#define SOCKET_EINTR EINTR
|
#define SOCKET_EINTR EINTR
|
||||||
#define SOCKET_EPIPE EPIPE
|
#define SOCKET_EPIPE EPIPE
|
||||||
#define SOCKET_ECONNREFUSED ECONNREFUSED
|
#define SOCKET_ECONNREFUSED ECONNREFUSED
|
||||||
|
#define SOCKET_ECONNABORTED ECONNABORTED
|
||||||
#endif /* USE_WINDOWS_API */
|
#endif /* USE_WINDOWS_API */
|
||||||
|
|
||||||
|
|
||||||
@ -228,6 +232,10 @@ int EmbedReceive(CYASSL *ssl, char *buf, int sz, void *ctx)
|
|||||||
CYASSL_MSG(" Connection refused");
|
CYASSL_MSG(" Connection refused");
|
||||||
return IO_ERR_WANT_READ;
|
return IO_ERR_WANT_READ;
|
||||||
}
|
}
|
||||||
|
else if (err == SOCKET_ECONNABORTED) {
|
||||||
|
CYASSL_MSG(" Connection aborted");
|
||||||
|
return IO_ERR_CONN_CLOSE;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
CYASSL_MSG(" General error");
|
CYASSL_MSG(" General error");
|
||||||
return IO_ERR_GENERAL;
|
return IO_ERR_GENERAL;
|
||||||
|
Reference in New Issue
Block a user