Commit 94a8a8ee authored by Fang-WANG's avatar Fang-WANG

store all notifications but need del duplicated ones and send then web init...

store all notifications but need del duplicated ones and send then web init connect but disable now.
parent 1489e80a
......@@ -61,12 +61,15 @@ __minimal_destroy_message(void *_msg)
static int notifying = 0;
struct lws *wsi_client = NULL;
extern char* nf_status_arr[10000];
extern int nf_status_arr_len;
static int first_conn = 0;
int update_client(int len, const char* payload)
{
char sendArr[1000];
char sendArr[10000];
if (notifying != 0)
return 0;
if (len > 1000)
if (len > 10000)
return 0;
if (wsi_client == NULL)
return 0;
......@@ -114,6 +117,7 @@ callback_minimal(struct lws *wsi, enum lws_callback_reasons reason,
pss->wsi = wsi;
pss->last = vhd->current;
wsi_client = wsi;
first_conn = 1;
break;
case LWS_CALLBACK_CLOSED:
......@@ -127,7 +131,14 @@ callback_minimal(struct lws *wsi, enum lws_callback_reasons reason,
case LWS_CALLBACK_SERVER_WRITEABLE:
lwsl_user("LWS_CALLBACK_SERVER_WRITEABLE len %d %p \n",vhd->amsg.len,vhd->amsg.payload);
if (!vhd->amsg.payload)
{
if (1 == first_conn)
{
// update_client(nf_status_arr_len,nf_status_arr);
first_conn = 0;
}
break;
}
// if (pss->last == vhd->current)
// break;
......
......@@ -1283,6 +1283,10 @@ evsub_id_t smf_app::handle_event_exposure_subscription(
extern "C" {
int update_client(int len, const char* payload);
}
my_json nf_status_json_arr = nlohmann::json::array();
char* nf_status_arr[1000] = {0};
int nf_status_arr_len;
//------------------------------------------------------------------------------
bool smf_app::handle_nf_status_notification(
std::shared_ptr<itti_sbi_notification_data>& msg,
......@@ -1321,6 +1325,9 @@ bool smf_app::handle_nf_status_notification(
my_json json_data_arr = nlohmann::json::array();
json_data_arr.push_back(json_data);
nf_status_json_arr.push_back(json_data);
nf_status_arr_len = nf_status_json_arr.dump().length();
memcpy(nf_status_arr,nf_status_json_arr.dump().c_str(),nf_status_arr_len);
Logger::smf_app().error(
"json_data %s \n",json_data_arr.dump().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