Commit b0f69dc4 authored by Raphael Defosseux's avatar Raphael Defosseux
Browse files

style(http2): formatting leftover files


Signed-off-by: Raphael Defosseux's avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent f9c48674
Pipeline #27105 passed with stage
in 0 seconds
...@@ -263,8 +263,8 @@ void nrf_http2_server::register_nf_instance_handler( ...@@ -263,8 +263,8 @@ void nrf_http2_server::register_nf_instance_handler(
} }
header_map h; header_map h;
h.emplace( h.emplace(
"location", header_value{ "location",
m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version + header_value{m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/" + nfInstanceID}); "/nf-instances/" + nfInstanceID});
h.emplace("content-type", header_value{content_type}); h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h); response.write_head(http_code, h);
...@@ -295,8 +295,8 @@ void nrf_http2_server::get_nf_instance_handler( ...@@ -295,8 +295,8 @@ void nrf_http2_server::get_nf_instance_handler(
header_map h; header_map h;
h.emplace( h.emplace(
"location", header_value{ "location",
m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version + header_value{m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/" + nfInstanceID}); "/nf-instances/" + nfInstanceID});
h.emplace("content-type", header_value{content_type}); h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h); response.write_head(http_code, h);
...@@ -342,9 +342,8 @@ void nrf_http2_server::get_nf_instances_handler( ...@@ -342,9 +342,8 @@ void nrf_http2_server::get_nf_instances_handler(
header_map h; header_map h;
h.emplace( h.emplace(
"location", header_value{ "location", header_value{m_address + NNRF_NFM_BASE +
m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version + nrf_cfg.sbi_api_version + "/nf-instances/"});
"/nf-instances/"});
h.emplace("content-type", header_value{content_type}); h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h); response.write_head(http_code, h);
response.end(); response.end();
...@@ -382,8 +381,8 @@ void nrf_http2_server::update_instance_handler( ...@@ -382,8 +381,8 @@ void nrf_http2_server::update_instance_handler(
Logger::nrf_sbi().debug("Json data: %s", json_data.dump().c_str()); Logger::nrf_sbi().debug("Json data: %s", json_data.dump().c_str());
header_map h; header_map h;
h.emplace( h.emplace(
"location", header_value{ "location",
m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version + header_value{m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/" + nfInstanceID}); "/nf-instances/" + nfInstanceID});
h.emplace("content-type", header_value{content_type}); h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h); response.write_head(http_code, h);
...@@ -406,8 +405,8 @@ void nrf_http2_server::deregister_nf_instance_handler( ...@@ -406,8 +405,8 @@ void nrf_http2_server::deregister_nf_instance_handler(
header_map h; header_map h;
h.emplace( h.emplace(
"location", header_value{ "location",
m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version + header_value{m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/" + nfInstanceID}); "/nf-instances/" + nfInstanceID});
h.emplace("content-type", header_value{content_type}); h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h); response.write_head(http_code, h);
...@@ -438,8 +437,8 @@ void nrf_http2_server::create_subscription_handler( ...@@ -438,8 +437,8 @@ void nrf_http2_server::create_subscription_handler(
header_map h; header_map h;
h.emplace( h.emplace(
"location", header_value{ "location",
m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version + header_value{m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
NNRF_NFM_STATUS_SUBSCRIBE_URL}); NNRF_NFM_STATUS_SUBSCRIBE_URL});
h.emplace("content-type", header_value{content_type}); h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h); response.write_head(http_code, h);
......
...@@ -471,7 +471,8 @@ void nrf_app::handle_create_subscription( ...@@ -471,7 +471,8 @@ void nrf_app::handle_create_subscription(
for (auto p : profiles) { for (auto p : profiles) {
// send notifications // send notifications
nrf_client_inst->notify_subscribed_event( nrf_client_inst->notify_subscribed_event(
p, NOTIFICATION_TYPE_NF_REGISTERED, notification_uris, http_version); p, NOTIFICATION_TYPE_NF_REGISTERED, notification_uris,
http_version);
} }
} }
...@@ -1027,11 +1028,13 @@ void nrf_app::handle_nf_status_registered(const std::string& profile_id) { ...@@ -1027,11 +1028,13 @@ void nrf_app::handle_nf_status_registered(const std::string& profile_id) {
std::vector<std::string> notification_uris = {}; std::vector<std::string> notification_uris = {};
uint8_t httpVersion = 1; uint8_t httpVersion = 1;
get_subscription_list( get_subscription_list(
profile_id, NOTIFICATION_TYPE_NF_REGISTERED, notification_uris, httpVersion); profile_id, NOTIFICATION_TYPE_NF_REGISTERED, notification_uris,
httpVersion);
// send notifications // send notifications
if (notification_uris.size() > 0) if (notification_uris.size() > 0)
nrf_client_inst->notify_subscribed_event( nrf_client_inst->notify_subscribed_event(
profile, NOTIFICATION_TYPE_NF_REGISTERED, notification_uris, httpVersion); profile, NOTIFICATION_TYPE_NF_REGISTERED, notification_uris,
httpVersion);
else else
Logger::nrf_app().debug("\tNo subscription found"); Logger::nrf_app().debug("\tNo subscription found");
...@@ -1089,13 +1092,15 @@ void nrf_app::handle_nf_status_profile_changed(const std::string& profile_id) { ...@@ -1089,13 +1092,15 @@ void nrf_app::handle_nf_status_profile_changed(const std::string& profile_id) {
std::vector<std::string> notification_uris = {}; std::vector<std::string> notification_uris = {};
uint8_t http_version = 1; uint8_t http_version = 1;
get_subscription_list( get_subscription_list(
profile_id, NOTIFICATION_TYPE_NF_PROFILE_CHANGED, notification_uris, http_version); profile_id, NOTIFICATION_TYPE_NF_PROFILE_CHANGED, notification_uris,
http_version);
// Notification data includes NF profile (other alternative, includes // Notification data includes NF profile (other alternative, includes
// profile_changes) // profile_changes)
// send notifications // send notifications
if (notification_uris.size() > 0) if (notification_uris.size() > 0)
nrf_client_inst->notify_subscribed_event( nrf_client_inst->notify_subscribed_event(
profile, NOTIFICATION_TYPE_NF_PROFILE_CHANGED, notification_uris, http_version); profile, NOTIFICATION_TYPE_NF_PROFILE_CHANGED, notification_uris,
http_version);
else else
Logger::nrf_app().debug("\tNo subscription found"); Logger::nrf_app().debug("\tNo subscription found");
} else { } else {
......
...@@ -121,7 +121,7 @@ void nrf_subscription::set_http_version(const uint8_t& httpVersion) { ...@@ -121,7 +121,7 @@ void nrf_subscription::set_http_version(const uint8_t& httpVersion) {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
uint8_t nrf_subscription::get_http_version() const{ uint8_t nrf_subscription::get_http_version() const {
return http_version; return http_version;
} }
......
...@@ -200,7 +200,7 @@ class nrf_subscription { ...@@ -200,7 +200,7 @@ class nrf_subscription {
nrf_event& m_event_sub; nrf_event& m_event_sub;
bs2::connection ev_connection; bs2::connection ev_connection;
boost::posix_time::ptime validity_time; boost::posix_time::ptime validity_time;
uint8_t http_version =1; uint8_t http_version = 1;
}; };
} // namespace app } // namespace app
} // namespace nrf } // namespace nrf
......
...@@ -124,7 +124,6 @@ int main(int argc, char** argv) { ...@@ -124,7 +124,6 @@ int main(int argc, char** argv) {
nrf_manager.join(); nrf_manager.join();
nrf_http2_manager.join(); nrf_http2_manager.join();
FILE* fp = NULL; FILE* fp = NULL;
std::string filename = fmt::format("/tmp/nrf_{}.status", getpid()); std::string filename = fmt::format("/tmp/nrf_{}.status", getpid());
fp = fopen(filename.c_str(), "w+"); fp = fopen(filename.c_str(), "w+");
......
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