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:
@ -300,6 +300,7 @@ int main(int argc, char *argv[])
|
||||
shutdown:
|
||||
|
||||
if(forwardsock != LIBSSH2_INVALID_SOCKET) {
|
||||
shutdown(forwardsock, 2);
|
||||
#ifdef WIN32
|
||||
closesocket(forwardsock);
|
||||
#else
|
||||
@ -319,6 +320,7 @@ shutdown:
|
||||
}
|
||||
|
||||
if(sock != LIBSSH2_INVALID_SOCKET) {
|
||||
shutdown(sock, 2);
|
||||
#ifdef WIN32
|
||||
closesocket(sock);
|
||||
#else
|
||||
|
Reference in New Issue
Block a user