forked from wolfSSL/wolfssl
Freescale/RTCS fixes for io.c
This commit is contained in:
9
src/io.c
9
src/io.c
@@ -210,6 +210,10 @@ static INLINE int TranslateReturnCode(int old, int sd)
|
|||||||
errno = RTCS_geterror(sd);
|
errno = RTCS_geterror(sd);
|
||||||
if (errno == RTCSERR_TCP_CONN_CLOSING)
|
if (errno == RTCSERR_TCP_CONN_CLOSING)
|
||||||
return 0; /* convert to BSD style closing */
|
return 0; /* convert to BSD style closing */
|
||||||
|
if (errno == RTCSERR_TCP_CONN_RLSD)
|
||||||
|
errno = SOCKET_ECONNRESET;
|
||||||
|
if (errno == RTCSERR_TCP_TIMED_OUT)
|
||||||
|
errno = SOCKET_EAGAIN;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -316,6 +320,8 @@ int EmbedSend(WOLFSSL* ssl, char *buf, int sz, void *ctx)
|
|||||||
|
|
||||||
sent = (int)SEND_FUNCTION(sd, &buf[sz - len], len, ssl->wflags);
|
sent = (int)SEND_FUNCTION(sd, &buf[sz - len], len, ssl->wflags);
|
||||||
|
|
||||||
|
sent = TranslateReturnCode(sent, sd);
|
||||||
|
|
||||||
if (sent < 0) {
|
if (sent < 0) {
|
||||||
err = LastError();
|
err = LastError();
|
||||||
WOLFSSL_MSG("Embed Send error");
|
WOLFSSL_MSG("Embed Send error");
|
||||||
@@ -454,6 +460,9 @@ int EmbedSendTo(WOLFSSL* ssl, char *buf, int sz, void *ctx)
|
|||||||
sent = (int)SENDTO_FUNCTION(sd, &buf[sz - len], len, ssl->wflags,
|
sent = (int)SENDTO_FUNCTION(sd, &buf[sz - len], len, ssl->wflags,
|
||||||
(const struct sockaddr*)dtlsCtx->peer.sa,
|
(const struct sockaddr*)dtlsCtx->peer.sa,
|
||||||
dtlsCtx->peer.sz);
|
dtlsCtx->peer.sz);
|
||||||
|
|
||||||
|
sent = TranslateReturnCode(sent, sd);
|
||||||
|
|
||||||
if (sent < 0) {
|
if (sent < 0) {
|
||||||
err = LastError();
|
err = LastError();
|
||||||
WOLFSSL_MSG("Embed Send To error");
|
WOLFSSL_MSG("Embed Send To error");
|
||||||
|
Reference in New Issue
Block a user