1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-29 13:01:14 +03:00

example, test_ssh2: shutdown socket before close

Syncing them with `tests/session_fixture.c`.

Cherry-picked from #1017
This commit is contained in:
Viktor Szakats
2023-05-02 11:25:49 +00:00
parent e99c84f682
commit d70919fb00
25 changed files with 36 additions and 1 deletions

View File

@ -305,6 +305,7 @@ int main(int argc, char *argv[])
shutdown:
if(forwardsock != LIBSSH2_INVALID_SOCKET) {
shutdown(forwardsock, 2);
#ifdef WIN32
closesocket(forwardsock);
#else
@ -313,6 +314,7 @@ shutdown:
}
if(listensock != LIBSSH2_INVALID_SOCKET) {
shutdown(listensock, 2);
#ifdef WIN32
closesocket(listensock);
#else
@ -329,6 +331,7 @@ shutdown:
}
if(sock != LIBSSH2_INVALID_SOCKET) {
shutdown(sock, 2);
#ifdef WIN32
closesocket(sock);
#else