forked from wolfSSL/wolfssl
add SOCKET_PEER_CLOSED_E vs general SOCKET_E for case where peer closes underlying transport w/o close notify
This commit is contained in:
@ -7589,6 +7589,8 @@ startScr:
|
|||||||
if (ssl->error == SOCKET_ERROR_E) {
|
if (ssl->error == SOCKET_ERROR_E) {
|
||||||
if (ssl->options.connReset || ssl->options.isClosed) {
|
if (ssl->options.connReset || ssl->options.isClosed) {
|
||||||
WOLFSSL_MSG("Peer reset or closed, connection done");
|
WOLFSSL_MSG("Peer reset or closed, connection done");
|
||||||
|
ssl->error = SOCKET_PEER_CLOSED_E;
|
||||||
|
WOLFSSL_ERROR(ssl->error);
|
||||||
return 0; /* peer reset or closed */
|
return 0; /* peer reset or closed */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8002,6 +8004,12 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e)
|
|||||||
case DUPLICATE_MSG_E:
|
case DUPLICATE_MSG_E:
|
||||||
return "Duplicate HandShake message Error";
|
return "Duplicate HandShake message Error";
|
||||||
|
|
||||||
|
case SNI_UNSUPPORTED:
|
||||||
|
return "Protocol version does not support SNI Error";
|
||||||
|
|
||||||
|
case SOCKET_PEER_CLOSED_E:
|
||||||
|
return "Peer closed underlying transport Error";
|
||||||
|
|
||||||
default :
|
default :
|
||||||
return "unknown error number";
|
return "unknown error number";
|
||||||
}
|
}
|
||||||
|
@ -127,6 +127,7 @@ enum wolfSSL_ErrorCodes {
|
|||||||
SANITY_MSG_E = -394, /* Sanity check on msg order error */
|
SANITY_MSG_E = -394, /* Sanity check on msg order error */
|
||||||
DUPLICATE_MSG_E = -395, /* Duplicate message error */
|
DUPLICATE_MSG_E = -395, /* Duplicate message error */
|
||||||
SNI_UNSUPPORTED = -396, /* SSL 3.0 does not support SNI */
|
SNI_UNSUPPORTED = -396, /* SSL 3.0 does not support SNI */
|
||||||
|
SOCKET_PEER_CLOSED_E = -397, /* Underlying transport closed */
|
||||||
|
|
||||||
/* add strings to SetErrorString !!!!! */
|
/* add strings to SetErrorString !!!!! */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user