Skip to content

Commit

Permalink
Merge pull request #222 from usdot-fhwa-OPS/218-TimPlugin
Browse files Browse the repository at this point in the history
TimPlugin destructing after sending the second XML POST request
  • Loading branch information
SaikrishnaBairamoni authored Jul 19, 2021
2 parents 900d045 + dfebe6a commit 47e9746
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/v2i-hub/TimPlugin/src/TimPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,6 @@ int TimPlugin::Main() {
//mapFileCopy = _mapFile;
_isMapFileNew = false;
}
if (_isTimLoaded)
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_TravelerInformation, &_tim);
_isTimLoaded = LoadTim(&_tim, _mapFile.c_str());
}

Expand All @@ -318,9 +316,10 @@ int TimPlugin::Main() {

lastSendTime = time;
TimMessage timMsg(_tim);

//PLOG(logERROR) <<"timMsg XML to send....."<< timMsg<<std::endl;
TimEncodedMessage timEncMsg;
timEncMsg.initialize(timMsg);
//PLOG(logERROR) <<"encoded timEncMsg..."<< timEncMsg<<std::endl;

timEncMsg.set_flags(IvpMsgFlags_RouteDSRC);
timEncMsg.addDsrcMetadata(172, 0x8003);
Expand Down
5 changes: 4 additions & 1 deletion src/v2i-hub/TimPlugin/src/XmlCurveParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,10 @@ GeographicalPath* XmlCurveParser::ReadRegion(DOMElement* regionElement)
}
else if (MatchTagName(currentElement, "Nodes"))
{
ReadNodes(currentElement, &(geoPath->description->choice.path.offset.choice.xy.choice.nodes));
NodeSetXY_t* nodeset_p = (NodeSetXY_t*) calloc(1, sizeof(NodeSetXY));
ReadNodes(currentElement, nodeset_p);
geoPath->description->choice.path.offset.choice.xy.choice.nodes = *nodeset_p;
free(nodeset_p);
}
}

Expand Down

0 comments on commit 47e9746

Please sign in to comment.