Commit 43e0839f authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for AMF's HTTP2 port

parent 1bcebfbe
......@@ -74,7 +74,7 @@ void NFStatusNotifyApiImpl::receive_nf_status_notification(
if (m_smf_app->handle_nf_status_notification(
itti_msg, problem_details, http_code)) {
response.send(Pistache::Http::Code(204));
response.send(Pistache::Http::Code(HTTP_STATUS_CODE_204_NO_CONTENT));
} else {
nlohmann::json json_data = {};
to_json(json_data, problem_details);
......
......@@ -1596,15 +1596,21 @@ void smf_context::handle_pdu_session_create_sm_context_request(
boost::split(split_result, amf_status_uri, boost::is_any_of("/"));
if (split_result.size() >= 3) {
std::string addr = split_result[2];
// remove http port from the URI if existed
std::size_t found_port = addr.find(":");
if (found_port != std::string::npos) addr = addr.substr(0, found_port);
std::string full_addr = split_result[2];
// Check if the AMF addr is valid
std::size_t found_port = full_addr.find(":");
std::string addr = {}; // Addr without port
if (found_port != std::string::npos) {
addr = full_addr.substr(0, found_port);
} else {
addr = full_addr;
}
struct in_addr amf_ipv4_addr;
if (inet_aton(util::trim(addr).c_str(), &amf_ipv4_addr) == 0) {
Logger::smf_api_server().warn("Bad IPv4 for AMF");
} else {
amf_addr_str = addr;
amf_addr_str = full_addr;
Logger::smf_api_server().debug("AMF IP Addr %s", amf_addr_str.c_str());
}
}
......
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