Merge pull request #212 from ejohnstown/fix-error-code

Fix Error Code
pull/213/head
JacobBarthelmeh 2019-10-25 15:15:24 -06:00 committed by GitHub
commit de794125f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -281,6 +281,9 @@ const char* GetErrorString(int err)
case WS_SSH_CTX_NULL_E:
return "ssh ctx pointer was null";
case WS_CHANNEL_NOT_CONF:
return "channel open not confirmed";
default:
return "Unknown error code";
}

View File

@ -1520,7 +1520,7 @@ int wolfSSH_ChannelSend(WOLFSSH_CHANNEL* channel,
bytesTxd = WS_BAD_ARGUMENT;
else if (!channel->openConfirmed) {
WLOG(WS_LOG_DEBUG, "Channel not confirmed yet.");
return -666;
bytesTxd = WS_CHANNEL_NOT_CONF;
}
else {
WLOG(WS_LOG_DEBUG, "Sending data.");

View File

@ -109,8 +109,9 @@ enum WS_ErrorCodes {
WS_USER_AUTH_E = -1068, /* User authentication error */
WS_SSH_NULL_E = -1069, /* SSH was null */
WS_SSH_CTX_NULL_E = -1070, /* SSH_CTX was null */
WS_CHANNEL_NOT_CONF = -1071, /* Channel open not confirmed. */
WS_LAST_E = -1070 /* Update this to indicate last error */
WS_LAST_E = -1071 /* Update this to indicate last error */
};