From d254c85b423599c77703bc16e84241e6b158699e Mon Sep 17 00:00:00 2001 From: david Date: Wed, 26 Aug 2009 23:49:20 +0000 Subject: [PATCH] Fix XML traceroute output. I accidentally left in one part of the old stateful TraceProbes design, which was otherwise removed in r15197. --- traceroute.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/traceroute.cc b/traceroute.cc index 3fc87883d..d7c4d6b22 100644 --- a/traceroute.cc +++ b/traceroute.cc @@ -1024,7 +1024,8 @@ Traceroute::outputTarget(Target * t) { /* print a trace in xml */ void Traceroute::outputXMLTrace(TraceGroup * tg) { - map < u16, TraceProbe * >::const_iterator it; + map < u8, TraceProbe * >::const_iterator it; + map < u8, TraceProbe * >ttlProbes; TraceProbe *tp = NULL; const char *hostname_tmp = NULL; struct in_addr addr; @@ -1048,8 +1049,10 @@ Traceroute::outputXMLTrace(TraceGroup * tg) { } log_write(LOG_XML, ">\n"); + ttlProbes = tg->consolidateHops(); + /* add missing hosts host from the common path */ - for (ttl_count = 1 ; ttl_count < tg->TraceProbes.begin()->second->ttl; ttl_count++) { + for (ttl_count = 1 ; ttl_count < ttlProbes.begin()->second->ttl; ttl_count++) { addr.s_addr = commonPath[ttl_count]; log_write(LOG_XML, "TraceProbes.begin() ;it != tg->TraceProbes.end(); it++) { + for (it = ttlProbes.begin(); it != ttlProbes.end(); it++) { tp = it->second; if (tp->probeType() == PROBE_TTL)