stop sending data when ssl read returns 0

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1922 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2009-12-20 13:27:12 +00:00
parent d09fdd1e91
commit 1bb1f4575b

View File

@ -1475,7 +1475,7 @@ int pqissl::readdata(void *data, int len)
*/
++n_read_zero;
out << "SSL_ERROR_ZERO_RETURN -- ";
out << "ssl read : SSL_ERROR_ZERO_RETURN -- Blocking the writing process while waiting for more information.";
out << std::endl;
out << " Has socket closed been properly closed? nReadZero: " << n_read_zero;
out << std::endl;
@ -1483,6 +1483,7 @@ int pqissl::readdata(void *data, int len)
if (PQISSL_MAX_READ_ZERO_COUNT < n_read_zero)
{
out << "Count passed Limit, shutting down!";
quietShutdown = true;
reset();
}
@ -1639,6 +1640,11 @@ bool pqissl::moretoread()
bool pqissl::cansend()
{
if (n_read_zero > 0) {
rslog(RSL_DEBUG_ALL, pqisslzone,
"pqissl::cansend() read socket returns 0, so we don't wanna send know.");
return false;
}
rslog(RSL_DEBUG_ALL, pqisslzone,
"pqissl::cansend() polling socket!");