From 070268d9ff15be3966a6a9a15d2486443ab3db9e Mon Sep 17 00:00:00 2001 From: upstream svn Date: Sun, 22 May 2011 13:20:29 +0000 Subject: [PATCH] amulegui: don't request connection state when it is already included in the stats package --- .svn-revision | 2 +- src/amule-remote-gui.cpp | 13 +++---------- src/amule-remote-gui.h | 9 ++++----- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.svn-revision b/.svn-revision index 9acb986c..6d77dfd8 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -10569 +10570 diff --git a/src/amule-remote-gui.cpp b/src/amule-remote-gui.cpp index 08eb1e20..1a197df4 100644 --- a/src/amule-remote-gui.cpp +++ b/src/amule-remote-gui.cpp @@ -153,7 +153,7 @@ void CamuleRemoteGuiApp::OnPollTimer(wxTimerEvent&) switch (request_step) { case 0: - serverconnect->ReQuery(); + // We used to update the connection state here, but that's done with the stats in the next step now. request_step++; break; case 1: { @@ -736,15 +736,6 @@ void CServerConnectRem::ConnectToServer(CServer *server) } -bool CServerConnectRem::ReQuery() -{ - CECPacket stat_req(EC_OP_GET_CONNSTATE); - m_Conn->SendRequest(this, &stat_req); - - return true; -} - - void CServerConnectRem::HandlePacket(const CECPacket *packet) { CEC_ConnState_Tag *tag = @@ -2079,6 +2070,8 @@ void CStatsUpdaterRem::HandlePacket(const CECPacket *packet) theStats::UpdateStats(packet); theApp->amuledlg->ShowTransferRate(); theApp->ShowUserCount(); // maybe there should be a check if a usercount changed ? + // handle the connstate tag which is included in the stats packet + theApp->serverconnect->HandlePacket(packet); } diff --git a/src/amule-remote-gui.h b/src/amule-remote-gui.h index 6735f3fc..31319b23 100644 --- a/src/amule-remote-gui.h +++ b/src/amule-remote-gui.h @@ -388,17 +388,16 @@ public: } }; -class CServerConnectRem : public CECPacketHandlerBase { +class CServerConnectRem { CRemoteConnect *m_Conn; uint32 m_ID; CServer *m_CurrServer; - - virtual void HandlePacket(const CECPacket *packet); - + public: + void HandlePacket(const CECPacket *packet); + CServerConnectRem(CRemoteConnect *); - bool ReQuery(); bool IsConnected() { return (m_ID != 0) && (m_ID != 0xffffffff); } bool IsConnecting() { return m_ID == 0xffffffff; } -- 2.11.4.GIT