Skip to content

Commit

Permalink
checksum is transmitted to the client.
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM committed Feb 17, 2012
1 parent e034733 commit 1744e69
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Descriptors/JSONDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ class JSONDescriptor : public BaseDescriptor<SearchEngineT>{
reply.content += "],";
//list all viapoints so that the client may display it
reply.content += "\"via_points\":[";
std::string tmp;
if(true == config.geometry) {
std::string tmp;
for(unsigned segmentIdx = 1; segmentIdx < rawRoute.segmentEndCoordinates.size(); ++segmentIdx) {
if(segmentIdx > 1)
reply.content += ",";
Expand All @@ -166,8 +166,13 @@ class JSONDescriptor : public BaseDescriptor<SearchEngineT>{
reply.content += "]";
}
}
reply.content += "],"
"\"transactionId\": \"OSRM Routing Engine JSON Descriptor (v0.3)\"";
reply.content += "],";
reply.content += "\"route_data\": {";
reply.content += "\"checksum\":";
intToString(rawRoute.checkSum, tmp);
reply.content += tmp;
reply.content += "},";
reply.content += "\"transactionId\": \"OSRM Routing Engine JSON Descriptor (v0.3)\"";
reply.content += "}";
}

Expand Down
1 change: 1 addition & 0 deletions Plugins/RawRouteData.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct RawRouteData {
std::vector< _PathData > computedRouted;
std::vector< PhantomNodes > segmentEndCoordinates;
std::vector< _Coordinate > rawViaNodeCoordinates;
unsigned checkSum;
};

#endif /* RAWROUTEDATA_H_ */
4 changes: 2 additions & 2 deletions Plugins/ViaRoutePlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class ViaRoutePlugin : public BasePlugin {
_Coordinate startCoord(lat1, lon1);
_Coordinate targetCoord(lat2, lon2);
RawRouteData rawRoute;

rawRoute.checkSum = nodeHelpDesk->GetCheckSum();
if(false == checkCoord(startCoord) || false == checkCoord(targetCoord)) {
reply = http::Reply::stockReply(http::Reply::badRequest);
return;
Expand Down Expand Up @@ -152,7 +152,7 @@ class ViaRoutePlugin : public BasePlugin {
std::string JSONParameter = routeParameters.options.Find("jsonp");
if("" != JSONParameter) {
reply.content += JSONParameter;
reply.content += "(\n";
reply.content += "(";
}

_DescriptorConfig descriptorConfig;
Expand Down

0 comments on commit 1744e69

Please sign in to comment.