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,9 +263,9 @@ void nrf_http2_server::register_nf_instance_handler(
}
header_map h;
h.emplace(
"location", header_value{
m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/" + nfInstanceID});
"location",
header_value{m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/" + nfInstanceID});
h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h);
response.end(json_data.dump().c_str());
......@@ -295,9 +295,9 @@ void nrf_http2_server::get_nf_instance_handler(
header_map h;
h.emplace(
"location", header_value{
m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/" + nfInstanceID});
"location",
header_value{m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/" + nfInstanceID});
h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h);
response.end(json_data.dump().c_str());
......@@ -342,9 +342,8 @@ void nrf_http2_server::get_nf_instances_handler(
header_map h;
h.emplace(
"location", header_value{
m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/"});
"location", header_value{m_address + NNRF_NFM_BASE +
nrf_cfg.sbi_api_version + "/nf-instances/"});
h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h);
response.end();
......@@ -382,9 +381,9 @@ void nrf_http2_server::update_instance_handler(
Logger::nrf_sbi().debug("Json data: %s", json_data.dump().c_str());
header_map h;
h.emplace(
"location", header_value{
m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/" + nfInstanceID});
"location",
header_value{m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/" + nfInstanceID});
h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h);
response.end(json_data.dump().c_str());
......@@ -406,9 +405,9 @@ void nrf_http2_server::deregister_nf_instance_handler(
header_map h;
h.emplace(
"location", header_value{
m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/" + nfInstanceID});
"location",
header_value{m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
"/nf-instances/" + nfInstanceID});
h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h);
response.end();
......@@ -438,9 +437,9 @@ void nrf_http2_server::create_subscription_handler(
header_map h;
h.emplace(
"location", header_value{
m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
NNRF_NFM_STATUS_SUBSCRIBE_URL});
"location",
header_value{m_address + NNRF_NFM_BASE + nrf_cfg.sbi_api_version +
NNRF_NFM_STATUS_SUBSCRIBE_URL});
h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h);
response.end(json_data.dump().c_str());
......
......@@ -471,7 +471,8 @@ void nrf_app::handle_create_subscription(
for (auto p : profiles) {
// send notifications
nrf_client_inst->notify_subscribed_event(
p, NOTIFICATION_TYPE_NF_REGISTERED, notification_uris, http_version);
p, NOTIFICATION_TYPE_NF_REGISTERED, notification_uris,
http_version);
}
}
......@@ -1025,13 +1026,15 @@ void nrf_app::handle_nf_status_registered(const std::string& profile_id) {
find_nf_profile(profile_id, profile);
if (profile.get() != nullptr) {
std::vector<std::string> notification_uris = {};
uint8_t httpVersion = 1;
uint8_t httpVersion = 1;
get_subscription_list(
profile_id, NOTIFICATION_TYPE_NF_REGISTERED, notification_uris, httpVersion);
profile_id, NOTIFICATION_TYPE_NF_REGISTERED, notification_uris,
httpVersion);
// send notifications
if (notification_uris.size() > 0)
nrf_client_inst->notify_subscribed_event(
profile, NOTIFICATION_TYPE_NF_REGISTERED, notification_uris, httpVersion);
profile, NOTIFICATION_TYPE_NF_REGISTERED, notification_uris,
httpVersion);
else
Logger::nrf_app().debug("\tNo subscription found");
......@@ -1057,7 +1060,7 @@ void nrf_app::handle_nf_status_deregistered(
p.get()->get_nf_instance_id().c_str());
std::vector<std::string> notification_uris = {};
uint8_t http_version = 1;
uint8_t http_version = 1;
get_subscription_list(
p.get()->get_nf_instance_id(), NOTIFICATION_TYPE_NF_DEREGISTERED,
notification_uris, http_version);
......@@ -1087,15 +1090,17 @@ void nrf_app::handle_nf_status_profile_changed(const std::string& profile_id) {
find_nf_profile(profile_id, profile);
if (profile.get() != nullptr) {
std::vector<std::string> notification_uris = {};
uint8_t http_version = 1;
uint8_t http_version = 1;
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
// profile_changes)
// send notifications
if (notification_uris.size() > 0)
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
Logger::nrf_app().debug("\tNo subscription found");
} else {
......
......@@ -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;
}
......
......@@ -200,7 +200,7 @@ class nrf_subscription {
nrf_event& m_event_sub;
bs2::connection ev_connection;
boost::posix_time::ptime validity_time;
uint8_t http_version =1;
uint8_t http_version = 1;
};
} // namespace app
} // namespace nrf
......
......@@ -40,7 +40,7 @@ using namespace std;
nrf_app* nrf_app_inst = nullptr;
nrf_config nrf_cfg;
NRFApiServer* api_server = nullptr;
NRFApiServer* api_server = nullptr;
nrf_http2_server* nrf_api_server_2 = nullptr;
//------------------------------------------------------------------------------
......@@ -124,7 +124,6 @@ int main(int argc, char** argv) {
nrf_manager.join();
nrf_http2_manager.join();
FILE* fp = NULL;
std::string filename = fmt::format("/tmp/nrf_{}.status", getpid());
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