From: Christian Herdtweck Date: Wed, 5 Nov 2014 15:11:14 +0000 (+0100) Subject: fixed bug in ICMP Packet Factory: do not continue with garbage packet if read from... X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=04a2a16313874d14ef7867a8c5cf2b4c27229f61;p=pingcheck fixed bug in ICMP Packet Factory: do not continue with garbage packet if read from istream failed! removed commented lines that do same as shared_ptr.reset which was added in previous commit --- diff --git a/src/icmp/icmppacketfactory.cpp b/src/icmp/icmppacketfactory.cpp index 88c7330..3488f02 100644 --- a/src/icmp/icmppacketfactory.cpp +++ b/src/icmp/icmppacketfactory.cpp @@ -72,11 +72,11 @@ IcmpPacketItem IcmpPacketFactory::create_icmp_packet( if ( !icmp_packet->read( is ) ) { - GlobalLogger.notice() << "Could not read ICMP packet." << endl; + GlobalLogger.warning() << "ICMP packet creation failed" << endl; + icmp_packet.reset(); // --> (!icmp_packet) is true + // --> icmp_pinger will not try to continue working with this packet // TODO why good packets are reports as bad? The read() has problems! - //IcmpPacketItem icmp_packet_empty; - //icmp_packet = icmp_packet_empty; } return icmp_packet;