Exit out of TLSManager::waitFor() loop if shutdown requested
This commit is contained in:
@@ -10,6 +10,8 @@
|
|||||||
#include "tlsmanager.h"
|
#include "tlsmanager.h"
|
||||||
#include "utiltls.h"
|
#include "utiltls.h"
|
||||||
|
|
||||||
|
extern bool ShutdownRequested();
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
// store our preferred cipherlist so we can use it for debug/etc later on
|
// store our preferred cipherlist so we can use it for debug/etc later on
|
||||||
std::string TLS_CIPHERLIST;
|
std::string TLS_CIPHERLIST;
|
||||||
@@ -85,6 +87,10 @@ int TLSManager::waitFor(SSLConnectionRoutine eRoutine, SOCKET hSocket, WOLFSSL*
|
|||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
if(ShutdownRequested()) {
|
||||||
|
LogPrintf("%s: shutdown requested, exiting\n", __func__);
|
||||||
|
return retOp;
|
||||||
|
}
|
||||||
// clear the current thread's error queue
|
// clear the current thread's error queue
|
||||||
wolfSSL_ERR_clear_error();
|
wolfSSL_ERR_clear_error();
|
||||||
|
|
||||||
|
|||||||
@@ -2927,6 +2927,7 @@ void SetNetworkActive(bool active)
|
|||||||
if (!fNetworkActive) {
|
if (!fNetworkActive) {
|
||||||
LOCK(cs_vNodes);
|
LOCK(cs_vNodes);
|
||||||
// Close sockets to all nodes
|
// Close sockets to all nodes
|
||||||
|
LogPrint("net", "%s: closing sockets to all nodes\n", __func__);
|
||||||
for (CNode* pnode : vNodes) {
|
for (CNode* pnode : vNodes) {
|
||||||
pnode->CloseSocketDisconnect();
|
pnode->CloseSocketDisconnect();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user