Commit 18b47de4 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'fix_static_addr_allocation' into 'develop'

Fix static addr allocation

See merge request oai/cn5g/oai-cn5g-udm!15
parents ba705f9d 18d5f230
...@@ -77,6 +77,8 @@ void SMFSelectionSubscriptionDataRetrievalApiImpl::get_smf_sel_data( ...@@ -77,6 +77,8 @@ void SMFSelectionSubscriptionDataRetrievalApiImpl::get_smf_sel_data(
m_udm_app->handle_smf_selection_subscription_data_retrieval( m_udm_app->handle_smf_selection_subscription_data_retrieval(
supi, response_data, http_code, supported_features_str, plmn_id); supi, response_data, http_code, supported_features_str, plmn_id);
Logger::udm_server().debug("HTTP response code %d", http_code);
code = static_cast<Pistache::Http::Code>(http_code); code = static_cast<Pistache::Http::Code>(http_code);
// Set content type // Set content type
if ((code == Pistache::Http::Code::Created) or if ((code == Pistache::Http::Code::Created) or
...@@ -85,9 +87,11 @@ void SMFSelectionSubscriptionDataRetrievalApiImpl::get_smf_sel_data( ...@@ -85,9 +87,11 @@ void SMFSelectionSubscriptionDataRetrievalApiImpl::get_smf_sel_data(
(code == Pistache::Http::Code::No_Content)) { (code == Pistache::Http::Code::No_Content)) {
response.headers().add<Pistache::Http::Header::ContentType>( response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType("application/json")); Pistache::Http::Mime::MediaType("application/json"));
} else { } else {
response.headers().add<Pistache::Http::Header::ContentType>( response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType("application/problem+json")); Pistache::Http::Mime::MediaType("application/problem+json"));
code = Pistache::Http::Code::Bad_Request;
} }
response.send(code, response_data.dump().c_str()); response.send(code, response_data.dump().c_str());
......
...@@ -698,10 +698,9 @@ void udm_app::handle_session_management_subscription_data_retrieval( ...@@ -698,10 +698,9 @@ void udm_app::handle_session_management_subscription_data_retrieval(
Logger::udm_sdm().debug("Request URI: " + remote_uri); Logger::udm_sdm().debug("Request URI: " + remote_uri);
// Send curl to UDM // Send curl to UDM
long http_code = code = udm_client::curl_http_client(remote_uri, "GET", response_str);
udm_client::curl_http_client(remote_uri, "GET", response_str);
Logger::udm_sdm().debug("HTTP response code %d", http_code); Logger::udm_sdm().debug("HTTP response code %ld", code);
// Process response // Process response
try { try {
...@@ -717,7 +716,7 @@ void udm_app::handle_session_management_subscription_data_retrieval( ...@@ -717,7 +716,7 @@ void udm_app::handle_session_management_subscription_data_retrieval(
to_json(json_problem_details, problem_details); to_json(json_problem_details, problem_details);
Logger::udm_sdm().error("User " + supi + " not found"); Logger::udm_sdm().error("User " + supi + " not found");
response_data = json_problem_details; response_data = json_problem_details;
// code = Pistache::Http::Code::Not_Found; code = 404;
return; return;
} }
return; return;
...@@ -792,8 +791,7 @@ void udm_app::handle_smf_selection_subscription_data_retrieval( ...@@ -792,8 +791,7 @@ void udm_app::handle_smf_selection_subscription_data_retrieval(
std::string response_get; std::string response_get;
Logger::udm_sdm().debug("UDR: GET Request: " + remote_uri); Logger::udm_sdm().debug("UDR: GET Request: " + remote_uri);
// 2. invoke curl to get response from udr // 2. invoke curl to get response from udr
long http_code = code = udm_client::curl_http_client(remote_uri, "GET", response_get, body);
udm_client::curl_http_client(remote_uri, "GET", response_get, body);
// 3. process response // 3. process response
try { try {
Logger::udm_sdm().debug("subscription-data: GET Response: " + response_get); Logger::udm_sdm().debug("subscription-data: GET Response: " + response_get);
...@@ -809,9 +807,11 @@ void udm_app::handle_smf_selection_subscription_data_retrieval( ...@@ -809,9 +807,11 @@ void udm_app::handle_smf_selection_subscription_data_retrieval(
Logger::udm_sdm().error("User " + supi + " not found"); Logger::udm_sdm().error("User " + supi + " not found");
Logger::udm_sdm().info("Send 404 Not_Found response to client"); Logger::udm_sdm().info("Send 404 Not_Found response to client");
response_data = json_problem_details; response_data = json_problem_details;
code = 404;
return; return;
} }
Logger::udm_sdm().debug("HTTP response code %d", http_code); Logger::udm_sdm().debug("HTTP response code %d", code);
return;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment