From e0059ebe9998b08170decd6aee87077fb47aef7b Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Wed, 3 Aug 2011 22:16:28 -0300 Subject: [PATCH] Set the received status as successful when the RST match what was expected. --- src/tcp/tcppinger.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) 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(); } -- 1.7.1