diff options
Diffstat (limited to 'src/components/policy/policy_external/src/sql_pt_representation.cc')
-rw-r--r-- | src/components/policy/policy_external/src/sql_pt_representation.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index f9cc5e5ed5..4315d99b3a 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -559,10 +559,10 @@ void SQLPTRepresentation::GatherModuleConfig( LOG4CXX_WARN(logger_, "Incorrect select statement for endpoints"); } else { while (endpoints.Next()) { - std::stringstream stream; - stream << "0x0" << endpoints.GetInteger(1); - config->endpoints[stream.str()][endpoints.GetString(2)].push_back( - endpoints.GetString(0)); + const std::string& url = endpoints.GetString(0); + const std::string& service = endpoints.GetString(1); + const std::string& app_id = endpoints.GetString(2); + config->endpoints[service][app_id].push_back(url); } } @@ -1262,11 +1262,7 @@ bool SQLPTRepresentation::SaveServiceEndpoints( const policy_table::URL& urls = app_it->second; policy_table::URL::const_iterator url_it; for (url_it = urls.begin(); url_it != urls.end(); ++url_it) { - std::stringstream temp_stream(it->first); - int service; - temp_stream.seekg(3); - temp_stream >> service; - query.Bind(0, service); + query.Bind(0, it->first); query.Bind(1, *url_it); query.Bind(2, app_it->first); if (!query.Exec() || !query.Reset()) { |