mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
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);
|
||||
if (errno == RTCSERR_TCP_CONN_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
|
||||
|
||||
@@ -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 = TranslateReturnCode(sent, sd);
|
||||
|
||||
if (sent < 0) {
|
||||
err = LastError();
|
||||
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,
|
||||
(const struct sockaddr*)dtlsCtx->peer.sa,
|
||||
dtlsCtx->peer.sz);
|
||||
|
||||
sent = TranslateReturnCode(sent, sd);
|
||||
|
||||
if (sent < 0) {
|
||||
err = LastError();
|
||||
WOLFSSL_MSG("Embed Send To error");
|
||||
|
Reference in New Issue
Block a user