Skip to content

Commit

Permalink
Merge branch 'master' of github.com:dchapyshev/aspia
Browse files Browse the repository at this point in the history
  • Loading branch information
dchapyshev committed Nov 10, 2024
2 parents 49551df + fa6ef53 commit 8f053a6
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 22 deletions.
10 changes: 7 additions & 3 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,14 @@ endif()
check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT error)

if (IPO_SUPPORTED)
message(STATUS "IPO/LTO supported")
if (LINUX)
message(STATUS "IPO/LTO supported but disabled for Linux")
else()
message(STATUS "IPO/LTO supported")

# Enable link-time code generatation.
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
# Enable link-time code generatation.
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
else()
message(STATUS "IPO/LTO not supported")
endif()
Expand Down
2 changes: 1 addition & 1 deletion source/host/ui/config_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ ConfigDialog::ConfigDialog(QWidget* parent)
setConfigChanged(FROM_HERE, true);
});

ui.tab_bar->setTabVisible(4, QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier));
ui.tab_bar->setTabVisible(4, QApplication::queryKeyboardModifiers().testFlag(Qt::ShiftModifier));

//---------------------------------------------------------------------------------------------
// Other
Expand Down
10 changes: 5 additions & 5 deletions source/host/ui/main_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void MainWindow::onClientListChanged(const UserSessionAgent::ClientList& clients

connect(notifier_, &NotifierWindow::sig_killSession, this, &MainWindow::onKillSession);

connect(notifier_, &NotifierWindow::sig_voiceChat, this, [=](bool enable)
connect(notifier_, &NotifierWindow::sig_voiceChat, this, [this](bool enable)
{
if (agent_proxy_)
agent_proxy_->setVoiceChat(enable);
Expand All @@ -275,7 +275,7 @@ void MainWindow::onClientListChanged(const UserSessionAgent::ClientList& clients
// TODO
});

connect(notifier_, &NotifierWindow::sig_lockMouse, this, [=](bool enable)
connect(notifier_, &NotifierWindow::sig_lockMouse, this, [this](bool enable)
{
if (agent_proxy_)
{
Expand All @@ -287,7 +287,7 @@ void MainWindow::onClientListChanged(const UserSessionAgent::ClientList& clients
}
});

connect(notifier_, &NotifierWindow::sig_lockKeyboard, this, [=](bool enable)
connect(notifier_, &NotifierWindow::sig_lockKeyboard, this, [this](bool enable)
{
if (agent_proxy_)
{
Expand All @@ -299,7 +299,7 @@ void MainWindow::onClientListChanged(const UserSessionAgent::ClientList& clients
}
});

connect(notifier_, &NotifierWindow::sig_pause, this, [=](bool enable)
connect(notifier_, &NotifierWindow::sig_pause, this, [this](bool enable)
{
if (agent_proxy_)
{
Expand Down Expand Up @@ -633,7 +633,7 @@ void MainWindow::onSettings()
{
QWinEventNotifier* process_watcher = new QWinEventNotifier(this);

connect(process_watcher, &QWinEventNotifier::activated, this, [=]
connect(process_watcher, &QWinEventNotifier::activated, this, [this, process_watcher]
{
process_watcher->deleteLater();
ui.action_settings->setEnabled(true);
Expand Down
45 changes: 32 additions & 13 deletions source/router/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,27 +276,46 @@ bool Server::stopSession(Session::SessionId session_id)
//--------------------------------------------------------------------------------------------------
void Server::onHostSessionWithId(SessionHost* session)
{
if (!session)
{
LOG(LS_ERROR) << "Invalid session pointer";
return;
}

for (auto it = sessions_.begin(); it != sessions_.end();)
{
if (it->get()->sessionType() == proto::ROUTER_SESSION_HOST)
Session* other_session_ptr = it->get();

if (!other_session_ptr || other_session_ptr->sessionType() != proto::ROUTER_SESSION_HOST)
{
++it;
continue;
}

SessionHost* other_session = reinterpret_cast<SessionHost*>(other_session_ptr);
if (other_session == session)
{
++it;
continue;
}

bool is_found = false;

for (const auto& host_id : session->hostIdList())
{
SessionHost* other_session = reinterpret_cast<SessionHost*>(it->get());
if (other_session != session)
if (other_session->hasHostId(host_id))
{
for (const auto& host_id : session->hostIdList())
{
if (other_session->hasHostId(host_id))
{
LOG(LS_INFO) << "Detected previous connection with ID " << host_id;
LOG(LS_INFO) << "Detected previous connection with ID " << host_id;

it = sessions_.erase(it);
continue;
}
}
is_found = true;
break;
}
}

++it;
if (is_found)
it = sessions_.erase(it);
else
++it;
}
}

Expand Down

0 comments on commit 8f053a6

Please sign in to comment.