API Test Fix

The echoserver will check the return on the shutdown function for
success and socket error. Socket error is for the peer already having
shut down their socket. This is mapped back to success so it shuts down
cleanly. Add this behavior to the API test client in the test for SFTP
recv read command test.
pull/467/head
John Safranek 2022-10-10 10:50:50 -07:00
parent e983ae0ad9
commit 7e99fb3aae
No known key found for this signature in database
GPG Key ID: 8CE817DE0D3CCB4A
1 changed files with 7 additions and 1 deletions

View File

@ -938,7 +938,13 @@ static void test_wolfSSH_SFTP_SendReadPacket(void)
}
}
AssertIntEQ(wolfSSH_shutdown(ssh), WS_SUCCESS);
argsCount = wolfSSH_shutdown(ssh);
if (argsCount == WS_SOCKET_ERROR_E) {
/* If the socket is closed on shutdown, peer is gone, this is OK. */
argsCount = WS_SUCCESS;
}
AssertIntEQ(argsCount, WS_SUCCESS);
wolfSSH_free(ssh);
wolfSSH_CTX_free(ctx);
ThreadJoin(serThread);