From: Guilherme Maciel Ferreira Date: Thu, 4 Aug 2011 01:16:28 +0000 (-0300) Subject: Set the received status as successful when the RST match what was expected. X-Git-Tag: v1.1^2~30 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=e0059ebe9998b08170decd6aee87077fb47aef7b;p=pingcheck Set the received status as successful when the RST match what was expected. --- diff --git a/src/tcp/tcppinger.cpp b/src/tcp/tcppinger.cpp index 41cd54c..494a87a 100644 --- a/src/tcp/tcppinger.cpp +++ b/src/tcp/tcppinger.cpp @@ -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(); }