mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
additional check for pqissl::sockfd before using it (patch from Jenster)
This commit is contained in:
parent
6eccd57353
commit
2e08dde32b
1 changed files with 12 additions and 0 deletions
|
@ -1827,6 +1827,12 @@ bool pqissl::moretoread(uint32_t usec)
|
|||
}
|
||||
#endif
|
||||
|
||||
if(sockfd == -1)
|
||||
{
|
||||
std::cerr << "pqissl::moretoread(): socket is invalid or closed." << std::endl;
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
fd_set ReadFDs, WriteFDs, ExceptFDs;
|
||||
FD_ZERO(&ReadFDs);
|
||||
FD_ZERO(&WriteFDs);
|
||||
|
@ -1889,6 +1895,12 @@ bool pqissl::cansend(uint32_t usec)
|
|||
"pqissl::cansend() polling socket!");
|
||||
#endif
|
||||
|
||||
if(sockfd == -1)
|
||||
{
|
||||
std::cerr << "pqissl::moretoread(): socket is invalid or closed." << std::endl;
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
// Interestingly - This code might be portable....
|
||||
|
||||
fd_set ReadFDs, WriteFDs, ExceptFDs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue