Set the received status as successful when the RST match what was expected.
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Thu, 4 Aug 2011 01:16:28 +0000 (22:16 -0300)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Thu, 4 Aug 2011 01:16:28 +0000 (22:16 -0300)
src/tcp/tcppinger.cpp

index 41cd54c..494a87a 100644 (file)
@@ -259,7 +259,7 @@ void TcpPinger::handle_ping_done()
 
     // Call ping-done handler
     bool ping_success = (PingerStatus == PingStatus_SuccessReply);
-    PingDoneCallback(ping_success);
+    PingDoneCallback( ping_success );
 }
 
 void TcpPinger::start_receive()
@@ -301,9 +301,13 @@ void TcpPinger::handle_receive_tcp_segment( const size_t &bytes_transferred )
 
         print_rst_reply( ipv4_header, tcp_header );
 
+        set_ping_status( PingStatus_SuccessReply );
+
         TcpSegmentReceiveTimer.cancel();
     }
 
+    // TODO need to be in the catch or else?
+    // TODO why does the ping fail? Does the callback receive false?
     start_receive();
 }