mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added missing shutdown of non responsive socket that could leak FDs (suggested by GuessWho
This commit is contained in:
parent
39672b2df6
commit
f1f722a767
@ -123,6 +123,10 @@ int pqissllistenbase::setuplisten()
|
||||
err = fcntl(lsock, F_SETFL, O_NONBLOCK);
|
||||
if (err < 0)
|
||||
{
|
||||
shutdown(lsock,SHUT_RDWR) ;
|
||||
close(lsock) ;
|
||||
lsock = -1 ;
|
||||
|
||||
std::string out;
|
||||
rs_sprintf(out, "Error: Cannot make socket NON-Blocking: %d", err);
|
||||
pqioutput(PQL_ERROR, pqissllistenzone, out);
|
||||
@ -145,6 +149,9 @@ int pqissllistenbase::setuplisten()
|
||||
unsigned long int on = 1;
|
||||
if (0 != (err = ioctlsocket(lsock, FIONBIO, &on)))
|
||||
{
|
||||
closesocket(lsock) ;
|
||||
lsock = -1 ;
|
||||
|
||||
std::string out;
|
||||
rs_sprintf(out, "pqissllistenbase::setuplisten() Error: Cannot make socket NON-Blocking: %d\n", err);
|
||||
out += "Socket Error: " + socket_errorType(WSAGetLastError());
|
||||
|
Loading…
Reference in New Issue
Block a user