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:
toddouska 2015-04-06 11:40:51 -07:00
parent 4e6f619302
commit 0519085c69
2 changed files with 9 additions and 0 deletions

View File

@ -7589,6 +7589,8 @@ startScr:
if (ssl->error == SOCKET_ERROR_E) {
if (ssl->options.connReset || ssl->options.isClosed) {
WOLFSSL_MSG("Peer reset or closed, connection done");
ssl->error = SOCKET_PEER_CLOSED_E;
WOLFSSL_ERROR(ssl->error);
return 0; /* peer reset or closed */
}
}
@ -8002,6 +8004,12 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e)
case DUPLICATE_MSG_E:
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 :
return "unknown error number";
}

View File

@ -127,6 +127,7 @@ enum wolfSSL_ErrorCodes {
SANITY_MSG_E = -394, /* Sanity check on msg order error */
DUPLICATE_MSG_E = -395, /* Duplicate message error */
SNI_UNSUPPORTED = -396, /* SSL 3.0 does not support SNI */
SOCKET_PEER_CLOSED_E = -397, /* Underlying transport closed */
/* add strings to SetErrorString !!!!! */