mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-25 17:21:27 -05:00
additional check for pqissl::sockfd before using it (patch from Jenster)
This commit is contained in:
parent
6eccd57353
commit
2e08dde32b
@ -1827,6 +1827,12 @@ bool pqissl::moretoread(uint32_t usec)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if(sockfd == -1)
|
||||||
|
{
|
||||||
|
std::cerr << "pqissl::moretoread(): socket is invalid or closed." << std::endl;
|
||||||
|
return 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
fd_set ReadFDs, WriteFDs, ExceptFDs;
|
fd_set ReadFDs, WriteFDs, ExceptFDs;
|
||||||
FD_ZERO(&ReadFDs);
|
FD_ZERO(&ReadFDs);
|
||||||
FD_ZERO(&WriteFDs);
|
FD_ZERO(&WriteFDs);
|
||||||
@ -1889,6 +1895,12 @@ bool pqissl::cansend(uint32_t usec)
|
|||||||
"pqissl::cansend() polling socket!");
|
"pqissl::cansend() polling socket!");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if(sockfd == -1)
|
||||||
|
{
|
||||||
|
std::cerr << "pqissl::moretoread(): socket is invalid or closed." << std::endl;
|
||||||
|
return 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
// Interestingly - This code might be portable....
|
// Interestingly - This code might be portable....
|
||||||
|
|
||||||
fd_set ReadFDs, WriteFDs, ExceptFDs;
|
fd_set ReadFDs, WriteFDs, ExceptFDs;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user