MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / onConnectionManagerDisconnected

Method onConnectionManagerDisconnected

src/client/engine/engine/engine.cpp:1550–1610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1548}
1549
1550void Engine::onConnectionManagerDisconnected(DISCONNECT_REASON reason)
1551{
1552 qCDebug(LOG_CONNECTION) << "on disconnected event";
1553
1554#if defined(Q_OS_WIN)
1555 enableDohSettings();
1556#endif
1557
1558 if (connectionManager_->isStaticIpsLocation())
1559 {
1560 qCDebug(LOG_CONNECTION) << "the firewall rules are removed for static IPs location";
1561 firewallController_->deleteWhitelistPorts();
1562 }
1563
1564 // get sender source for additional actions in this handler
1565 QString senderSource;
1566 if (connectionManager_->property("senderSource").isValid())
1567 {
1568 senderSource = connectionManager_->property("senderSource").toString();
1569 connectionManager_->setProperty("senderSource", QVariant());
1570 }
1571
1572 doDisconnectRestoreStuff();
1573 WSNet::instance()->decoyTraffic()->stop();
1574
1575#ifdef Q_OS_WIN
1576 DnsInfo_win::outputDebugDnsInfo();
1577#elif defined(Q_OS_MACOS)
1578 // Stop the proxy when disconnecting
1579 SplitTunnelExtensionManager::instance().stopExtension();
1580#endif
1581
1582 if (senderSource == "logoutImpl")
1583 {
1584 logoutImplAfterDisconnect(false);
1585 }
1586 else if (senderSource == "logoutImplKeepFirewallOn")
1587 {
1588 logoutImplAfterDisconnect(true);
1589 }
1590 else if (senderSource == "reconnect")
1591 {
1592 connectClickImpl(locationId_, connectionSettingsOverride_, pinnedNode_);
1593 return;
1594 }
1595 else
1596 {
1597 myIpManager_->getIP(1);
1598 if (reason == DISCONNECTED_BY_USER && engineSettings_.firewallSettings().mode == FIREWALL_MODE_AUTOMATIC &&
1599 firewallController_->firewallActualState())
1600 {
1601 firewallController_->firewallOff();
1602 emit firewallStateChanged(false);
1603 }
1604 }
1605
1606 // Connection Settings override is one-time only, reset it
1607 connectionSettingsOverride_ = types::ConnectionSettings(types::Protocol(types::Protocol::TYPE::UNINITIALIZED), 0, true);

Callers

nothing calls this directly

Calls 13

enableDohSettingsFunction · 0.85
outputDebugDnsInfoFunction · 0.85
ConnectionSettingsClass · 0.85
ProtocolClass · 0.85
toStringMethod · 0.80
getIPMethod · 0.80
isStaticIpsLocationMethod · 0.45
deleteWhitelistPortsMethod · 0.45
isValidMethod · 0.45
stopMethod · 0.45
firewallActualStateMethod · 0.45
firewallOffMethod · 0.45

Tested by

no test coverage detected