mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
clear error queue before calling SSL_read()/SSL_write(), to avoid remaining errors to corrupt the next connection attempts and cause disconnections
This commit is contained in:
parent
31089d7a91
commit
ff8667834b
@ -1548,6 +1548,7 @@ int pqissl::senddata(void *data, int len)
|
||||
#ifdef PQISSL_DEBUG
|
||||
std::cout << "Sending data thread=" << pthread_self() << ", ssl=" << (void*)this << ", size=" << len << std::endl ;
|
||||
#endif
|
||||
ERR_clear_error();
|
||||
tmppktlen = SSL_write(ssl_connection, data, len) ;
|
||||
|
||||
if (len != tmppktlen)
|
||||
@ -1638,6 +1639,8 @@ int pqissl::readdata(void *data, int len)
|
||||
#ifdef PQISSL_DEBUG
|
||||
std::cerr << "calling SSL_read. len=" << len << ", total_len=" << total_len << std::endl ;
|
||||
#endif
|
||||
ERR_clear_error() ;
|
||||
|
||||
tmppktlen = SSL_read(ssl_connection, (void*)( &(((uint8_t*)data)[total_len])), len-total_len) ;
|
||||
#ifdef PQISSL_DEBUG
|
||||
std::cerr << "have read " << tmppktlen << " bytes" << std::endl ;
|
||||
|
Loading…
Reference in New Issue
Block a user