Browse Source

Reseting timer variables on SSH client

Mihawk 12 years ago
parent
commit
0fee9884b3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      SshClient.cpp

+ 4 - 0
SshClient.cpp

@@ -96,6 +96,7 @@ void SshClient::ping()
 void SshClient::pong()
 void SshClient::pong()
 {
 {
   killTimer(myPingTimerID);
   killTimer(myPingTimerID);
+  myPingTimerID = -1;
   myPongTimerID = startTimer(30000);
   myPongTimerID = startTimer(30000);
 }
 }
 
 
@@ -136,6 +137,7 @@ void SshClient::parse(const QDateTime &time, const QString &command, const QStri
     ping();
     ping();
     myConnectedFlag = true;
     myConnectedFlag = true;
     killTimer(myConnectionTimerID);
     killTimer(myConnectionTimerID);
+    myConnectionTimerID = -1;
     emit connected();
     emit connected();
     return;
     return;
   }
   }
@@ -292,6 +294,7 @@ void SshClient::disconnectFromHost()
   killTimer(myConnectionTimerID);
   killTimer(myConnectionTimerID);
   killTimer(myPingTimerID);
   killTimer(myPingTimerID);
   killTimer(myPongTimerID);
   killTimer(myPongTimerID);
+  myConnectionTimerID = myPingTimerID = myPongTimerID = -1;
 
 
   myProcess->terminate();
   myProcess->terminate();
   myProcess->waitForFinished();
   myProcess->waitForFinished();
@@ -321,6 +324,7 @@ void SshClient::timerEvent(QTimerEvent *e)
   if(e->timerId() == myPongTimerID)
   if(e->timerId() == myPongTimerID)
   {
   {
     killTimer(myPongTimerID);
     killTimer(myPongTimerID);
+    myPongTimerID = -1;
     ping();
     ping();
     return;
     return;
   }
   }