mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2025-12-10 07:44:41 +01:00
Draft test log for debugging
This commit is contained in:
parent
05bab1b23d
commit
19e78a4260
14 changed files with 174 additions and 66 deletions
3
config.c
3
config.c
|
|
@ -153,8 +153,9 @@ int get_preinit_config(struct config *conf)
|
|||
struct uci_element *e;
|
||||
|
||||
ctx = uci_alloc_context();
|
||||
if (!ctx)
|
||||
if (!ctx) {
|
||||
return CWMP_GEN_ERR;
|
||||
}
|
||||
|
||||
if (uci_load(ctx, "cwmp", &pkg)) {
|
||||
uci_free_context(ctx);
|
||||
|
|
|
|||
60
cwmp.c
60
cwmp.c
|
|
@ -135,18 +135,21 @@ void set_interface_reset_request(char *param_name, char *value)
|
|||
return;
|
||||
}
|
||||
|
||||
if (interface_reset_req(param_name, value) == false)
|
||||
if (interface_reset_req(param_name, value) == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Store the interface path to handle after session end
|
||||
int len = 0;
|
||||
char *pos = strrchr(param_name, '.');
|
||||
if (pos == NULL)
|
||||
if (pos == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
len = pos - param_name + 2;
|
||||
if (len <= 0)
|
||||
if (len <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
intf_reset_node *node = (intf_reset_node *)malloc(sizeof(intf_reset_node));
|
||||
if (node == NULL) {
|
||||
|
|
@ -189,23 +192,32 @@ int cwmp_get_retry_interval(struct cwmp *cwmp, bool heart_beat)
|
|||
|
||||
static int cwmp_rpc_cpe_handle_message(struct session *session, struct rpc *rpc_cpe)
|
||||
{
|
||||
if (xml_prepare_msg_out(session))
|
||||
CWMP_LOG(DEBUG, "entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
if (xml_prepare_msg_out(session)) {
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d error", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (rpc_cpe_methods[rpc_cpe->type].handler(session, rpc_cpe))
|
||||
if (rpc_cpe_methods[rpc_cpe->type].handler(session, rpc_cpe)) {
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d error", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (xml_set_cwmp_id_rpc_cpe(session))
|
||||
if (xml_set_cwmp_id_rpc_cpe(session)) {
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d error", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void cwmp_prepare_value_change(struct cwmp *cwmp)
|
||||
{
|
||||
struct event_container *event_container;
|
||||
if (list_value_change.next == &(list_value_change))
|
||||
if (list_value_change.next == &(list_value_change)) {
|
||||
return;
|
||||
}
|
||||
pthread_mutex_lock(&(cwmp->mutex_session_queue));
|
||||
event_container = cwmp_add_event_container(cwmp, EVENT_IDX_4VALUE_CHANGE, "");
|
||||
if (!event_container)
|
||||
|
|
@ -257,6 +269,7 @@ void check_firewall_restart_state()
|
|||
|
||||
int cwmp_schedule_rpc(struct cwmp *cwmp, struct session *session)
|
||||
{
|
||||
CWMP_LOG(DEBUG, "entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
struct list_head *ilist;
|
||||
struct rpc *rpc_acs, *rpc_cpe;
|
||||
|
||||
|
|
@ -328,6 +341,7 @@ int cwmp_schedule_rpc(struct cwmp *cwmp, struct session *session)
|
|||
CWMP_LOG(INFO, "Send the %s%s message to the ACS", rpc_cpe_methods[rpc_cpe->type].name, (rpc_cpe->type != RPC_CPE_FAULT) ? "Response" : "");
|
||||
if (xml_send_message(cwmp, session, rpc_cpe) || thread_end)
|
||||
goto retry;
|
||||
CWMP_LOG(INFO, "Send done");
|
||||
MXML_DELETE(session->tree_out);
|
||||
|
||||
cwmp_session_rpc_destructor(rpc_cpe);
|
||||
|
|
@ -359,6 +373,7 @@ end:
|
|||
MXML_DELETE(session->tree_out);
|
||||
http_client_exit();
|
||||
xml_exit();
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
return session->error;
|
||||
}
|
||||
|
||||
|
|
@ -460,6 +475,7 @@ int run_session_end_func(void)
|
|||
|
||||
static void cwmp_schedule_session(struct cwmp *cwmp)
|
||||
{
|
||||
CWMP_LOG(DEBUG, "entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
int t;
|
||||
struct timespec time_to_wait = { 0, 0 };
|
||||
bool retry = false;
|
||||
|
|
@ -480,6 +496,7 @@ static void cwmp_schedule_session(struct cwmp *cwmp)
|
|||
CWMP_LOG(INFO, "Waiting the next session");
|
||||
|
||||
if (thread_end) {
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
pthread_mutex_unlock(&(cwmp->mutex_session_send));
|
||||
return;
|
||||
}
|
||||
|
|
@ -487,6 +504,7 @@ static void cwmp_schedule_session(struct cwmp *cwmp)
|
|||
pthread_cond_timedwait(&(cwmp->threshold_session_send), &(cwmp->mutex_session_send), &time_to_wait);
|
||||
|
||||
if (thread_end) {
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
pthread_mutex_unlock(&(cwmp->mutex_session_send));
|
||||
return;
|
||||
}
|
||||
|
|
@ -498,6 +516,7 @@ static void cwmp_schedule_session(struct cwmp *cwmp)
|
|||
if (cwmp->session_status.last_status == SESSION_FAILURE) {
|
||||
cwmp_config_load(cwmp);
|
||||
if (thread_end) {
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
pthread_mutex_unlock(&mutex_heartbeat_session);
|
||||
pthread_mutex_unlock(&(cwmp->mutex_session_send));
|
||||
return;
|
||||
|
|
@ -516,6 +535,7 @@ static void cwmp_schedule_session(struct cwmp *cwmp)
|
|||
cwmp_prepare_value_change(cwmp);
|
||||
clean_list_value_change();
|
||||
if ((error = cwmp_move_session_to_session_send(cwmp, session))) {
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
CWMP_LOG(EMERG, "FATAL error in the mutex process in the session scheduler!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
@ -540,6 +560,7 @@ static void cwmp_schedule_session(struct cwmp *cwmp)
|
|||
CWMP_LOG(INFO, "End session");
|
||||
|
||||
if (thread_end) {
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
event_remove_all_event_container(session, RPC_SEND);
|
||||
run_session_end_func();
|
||||
cwmp_session_destructor(session);
|
||||
|
|
@ -551,6 +572,7 @@ static void cwmp_schedule_session(struct cwmp *cwmp)
|
|||
if (session->error == CWMP_RETRY_SESSION && (!list_empty(&(session->head_event_container)) || (list_empty(&(session->head_event_container)) && cwmp->cwmp_cr_event == 0))) {
|
||||
cwmp_config_load(cwmp);
|
||||
if (thread_end) {
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
event_remove_all_event_container(session, RPC_SEND);
|
||||
run_session_end_func();
|
||||
cwmp_session_destructor(session);
|
||||
|
|
@ -586,6 +608,7 @@ static void cwmp_schedule_session(struct cwmp *cwmp)
|
|||
pthread_mutex_unlock(&mutex_heartbeat_session);
|
||||
pthread_mutex_unlock(&(cwmp->mutex_session_send));
|
||||
}
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
static void check_exit_timer_expiry(struct uloop_timeout *timeout)
|
||||
|
|
@ -624,8 +647,9 @@ static void *thread_uloop_run(void *v __attribute__((unused)))
|
|||
|
||||
ubus_add_uloop(ctx);
|
||||
|
||||
if (icwmp_register_object(ctx))
|
||||
if (icwmp_register_object(ctx)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct uloop_timeout tm;
|
||||
memset(&tm, 0, sizeof(tm));
|
||||
|
|
@ -640,7 +664,9 @@ static void *thread_uloop_run(void *v __attribute__((unused)))
|
|||
|
||||
static void *thread_http_cr_server_listen(void *v __attribute__((unused)))
|
||||
{
|
||||
CWMP_LOG(DEBUG, "entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
http_server_listen();
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -911,14 +937,16 @@ static int cwmp_init(struct cwmp *cwmp)
|
|||
pthread_mutex_init(&mutex_heartbeat, NULL);
|
||||
INIT_LIST_HEAD(&(cwmp->head_session_queue));
|
||||
|
||||
if ((error = create_cwmp_var_state_files()))
|
||||
if ((error = create_cwmp_var_state_files())) {
|
||||
return error;
|
||||
}
|
||||
|
||||
CWMP_LOG(DEBUG, "Loading icwmpd configuration");
|
||||
cwmp_config_load(cwmp);
|
||||
|
||||
if (thread_end == true)
|
||||
if (thread_end == true) {
|
||||
return CWMP_GEN_ERR;
|
||||
}
|
||||
|
||||
CWMP_LOG(DEBUG, "Successfully load icwmpd configuration");
|
||||
cwmp_get_deviceid(cwmp);
|
||||
|
|
@ -1028,12 +1056,14 @@ int main(int argc, char **argv)
|
|||
cwmp_main.init_complete = false;
|
||||
|
||||
error = wait_for_usp_raw_object();
|
||||
if (error)
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
|
||||
memset(&env, 0, sizeof(struct env));
|
||||
if ((error = global_env_init(argc, argv, &env)))
|
||||
if ((error = global_env_init(argc, argv, &env))) {
|
||||
return error;
|
||||
}
|
||||
|
||||
memcpy(&(cwmp_main.env), &env, sizeof(struct env));
|
||||
|
||||
|
|
@ -1057,11 +1087,13 @@ int main(int argc, char **argv)
|
|||
CWMP_LOG(INFO, "STARTING ICWMP with PID :%d", getpid());
|
||||
cwmp_main.start_time = time(NULL);
|
||||
|
||||
if ((error = cwmp_init_backup_session(&cwmp_main, NULL, ALL)))
|
||||
if ((error = cwmp_init_backup_session(&cwmp_main, NULL, ALL))) {
|
||||
return error;
|
||||
}
|
||||
|
||||
if ((error = cwmp_root_cause_events(&cwmp_main)))
|
||||
if ((error = cwmp_root_cause_events(&cwmp_main))) {
|
||||
return error;
|
||||
}
|
||||
|
||||
configure_var_state(&cwmp_main);
|
||||
http_server_init();
|
||||
|
|
|
|||
|
|
@ -338,8 +338,9 @@ void *thread_cwmp_rpc_cpe_change_du_state(void *v)
|
|||
|
||||
for (;;) {
|
||||
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
break;
|
||||
}
|
||||
if (list_change_du_state.next != &(list_change_du_state)) {
|
||||
struct change_du_state *pchange_du_state = list_entry(list_change_du_state.next, struct change_du_state, list);
|
||||
time_t current_time = time(NULL);
|
||||
|
|
|
|||
|
|
@ -125,11 +125,13 @@ int get_single_fault_from_blob_attr(struct blob_attr *msg)
|
|||
{
|
||||
int fault_code = FAULT_CPE_NO_FAULT;
|
||||
fault_code = get_fault(msg);
|
||||
if (fault_code != FAULT_CPE_NO_FAULT)
|
||||
if (fault_code != FAULT_CPE_NO_FAULT) {
|
||||
return fault_code;
|
||||
}
|
||||
struct blob_attr *faults_array = get_parameters_array(msg);
|
||||
if (faults_array == NULL)
|
||||
if (faults_array == NULL) {
|
||||
return FAULT_CPE_NO_FAULT;
|
||||
}
|
||||
struct blob_attr *cur;
|
||||
int rem;
|
||||
blobmsg_for_each_attr(cur, faults_array, rem)
|
||||
|
|
@ -163,8 +165,9 @@ void ubus_transaction_commit_callback(struct ubus_request *req __attribute__((un
|
|||
return;
|
||||
}
|
||||
*status = blobmsg_get_u8(tb[0]);
|
||||
if (*status == false)
|
||||
if (*status == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
blobmsg_for_each_attr(cur, msg, rem)
|
||||
{
|
||||
|
|
@ -387,24 +390,24 @@ int cwmp_get_leaf_value(char *leaf, char **value)
|
|||
size_t llen;
|
||||
|
||||
if (leaf == NULL || value == NULL) {
|
||||
CWMP_LOG(INFO, "Empty parameter/value in arguments")
|
||||
CWMP_LOG(INFO, "Empty parameter/value in arguments");
|
||||
return FAULT_CPE_INVALID_ARGUMENTS;
|
||||
}
|
||||
|
||||
llen = strlen(leaf);
|
||||
if (llen == 0) {
|
||||
CWMP_LOG(INFO, "Empty parameter in arguments")
|
||||
CWMP_LOG(INFO, "Empty parameter in arguments");
|
||||
return FAULT_CPE_INVALID_ARGUMENTS;
|
||||
}
|
||||
|
||||
if (leaf[llen - 1] == '.') {
|
||||
CWMP_LOG(INFO, "Non-leaf parameter parameter")
|
||||
CWMP_LOG(INFO, "Non-leaf parameter parameter");
|
||||
return FAULT_CPE_INVALID_ARGUMENTS;
|
||||
}
|
||||
|
||||
cwmp_get_single_parameter_value(leaf, &dm_param);
|
||||
if (dm_param.name == NULL) {
|
||||
CWMP_LOG(INFO, "Fault in getting the parameter %s", leaf)
|
||||
CWMP_LOG(INFO, "Fault in getting the parameter %s", leaf);
|
||||
return FAULT_CPE_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -667,8 +670,9 @@ void ubus_objects_callback(struct ubus_request *req, int type __attribute__((unu
|
|||
|
||||
static void prepare_add_delete_blobmsg(struct blob_buf *b, char *object_name, char *key)
|
||||
{
|
||||
if (b == NULL)
|
||||
if (b == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
char *object = CWMP_STRLEN(object_name) ? object_name : DM_ROOT_OBJ;
|
||||
bb_add_string(b, "path", object);
|
||||
|
|
|
|||
17
download.c
17
download.c
|
|
@ -261,6 +261,7 @@ int cwmp_launch_download(struct download *pdownload, char *download_file_name, e
|
|||
if (cwmp_check_image() == 0) {
|
||||
long int file_size = get_file_size(FIRMWARE_UPGRADE_IMAGE);
|
||||
if (file_size > flashsize) {
|
||||
CWMP_LOG(ERROR, "download %s failed: file size %ld > flash size %ld", __FUNCTION__, file_size, flashsize);
|
||||
error = FAULT_CPE_DOWNLOAD_FAIL_FILE_CORRUPTED;
|
||||
remove(FIRMWARE_UPGRADE_IMAGE);
|
||||
goto end_download;
|
||||
|
|
@ -269,6 +270,7 @@ int cwmp_launch_download(struct download *pdownload, char *download_file_name, e
|
|||
goto end_download;
|
||||
}
|
||||
} else {
|
||||
CWMP_LOG(ERROR, "download %s, failed in cwmp_check_image", __FUNCTION__);
|
||||
error = FAULT_CPE_DOWNLOAD_FAIL_FILE_CORRUPTED;
|
||||
remove(FIRMWARE_UPGRADE_IMAGE);
|
||||
}
|
||||
|
|
@ -447,8 +449,9 @@ void *thread_cwmp_rpc_cpe_download(void *v)
|
|||
sleep(3);
|
||||
for (;;) {
|
||||
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (list_download.next != &(list_download)) {
|
||||
pdownload = list_entry(list_download.next, struct download, list);
|
||||
|
|
@ -561,8 +564,9 @@ void *thread_cwmp_rpc_cpe_schedule_download(void *v)
|
|||
for (;;) {
|
||||
time_t current_time;
|
||||
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
break;
|
||||
}
|
||||
|
||||
current_time = time(NULL);
|
||||
if (list_schedule_download.next != &(list_schedule_download)) {
|
||||
|
|
@ -637,8 +641,9 @@ void *thread_cwmp_rpc_cpe_schedule_download(void *v)
|
|||
pthread_mutex_lock(&mutex_apply_schedule_download);
|
||||
pthread_mutex_lock(&mutex_schedule_download);
|
||||
error = apply_downloaded_file(cwmp, current_download, download_file_name, ptransfer_complete);
|
||||
if (error == FAULT_CPE_NO_FAULT)
|
||||
if (error == FAULT_CPE_NO_FAULT) {
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&mutex_schedule_download);
|
||||
pthread_mutex_unlock(&mutex_apply_schedule_download);
|
||||
|
|
@ -669,8 +674,9 @@ void *thread_cwmp_rpc_cpe_schedule_download(void *v)
|
|||
bkp_session_delete_transfer_complete(ptransfer_complete);
|
||||
} else {
|
||||
error = apply_downloaded_file(cwmp, current_download, download_file_name, ptransfer_complete);
|
||||
if (error == FAULT_CPE_NO_FAULT)
|
||||
if (error == FAULT_CPE_NO_FAULT) {
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&(cwmp->mutex_session_send));
|
||||
pthread_cond_signal(&(cwmp->threshold_session_send));
|
||||
|
|
@ -712,8 +718,9 @@ void *thread_cwmp_rpc_cpe_apply_schedule_download(void *v)
|
|||
for (;;) {
|
||||
time_t current_time;
|
||||
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
break;
|
||||
}
|
||||
|
||||
current_time = time(NULL);
|
||||
if (list_apply_schedule_download.next != &(list_apply_schedule_download)) {
|
||||
|
|
|
|||
3
event.c
3
event.c
|
|
@ -386,8 +386,9 @@ void *thread_event_periodic(void *v)
|
|||
}
|
||||
pthread_mutex_unlock(&(cwmp->mutex_periodic));
|
||||
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (periodic_interval != global_int_param_read(&cwmp->conf.period) || periodic_enable != global_bool_param_read(&cwmp->conf.periodic_enable) || periodic_time != global_time_param_read(&cwmp->conf.time)) {
|
||||
periodic_enable = global_bool_param_read(&cwmp->conf.periodic_enable);
|
||||
|
|
|
|||
|
|
@ -53,16 +53,18 @@ void *thread_heartbeat_session(void *v __attribute__((unused)))
|
|||
|
||||
sleep(2);
|
||||
for (;;) {
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
break;
|
||||
}
|
||||
|
||||
bool enable = global_bool_param_read(&cwmp_main.conf.heart_beat_enable);
|
||||
if (enable) {
|
||||
heartbeat_interval.tv_sec = time(NULL) + global_int_param_read(&cwmp_main.conf.heartbeat_interval);
|
||||
pthread_mutex_lock(&mutex_heartbeat);
|
||||
pthread_cond_timedwait(&threshold_heartbeat_session, &mutex_heartbeat, &heartbeat_interval);
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (cwmp_main.session_status.last_status == SESSION_FAILURE) {
|
||||
CWMP_LOG(WARNING, "Not able to start HEARTBEAT Session for this period: CWMP Session is retrying");
|
||||
|
|
@ -70,8 +72,9 @@ void *thread_heartbeat_session(void *v __attribute__((unused)))
|
|||
//continue;
|
||||
}
|
||||
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
break;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&mutex_heartbeat_session);
|
||||
struct session *heartbeat_session = NULL;
|
||||
|
|
|
|||
102
http.c
102
http.c
|
|
@ -35,12 +35,15 @@ char *fc_cookies = "/tmp/icwmp_cookies";
|
|||
|
||||
void http_set_timeout(void)
|
||||
{
|
||||
CWMP_LOG(DEBUG, "#### entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
if (curl)
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 1);
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
int http_client_init(struct cwmp *cwmp)
|
||||
{
|
||||
CWMP_LOG(DEBUG, "#### entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
char *dhcp_dis = NULL;
|
||||
char *acs_var_stat = NULL;
|
||||
|
||||
|
|
@ -55,12 +58,14 @@ int http_client_init(struct cwmp *cwmp)
|
|||
free(acs_var_stat);
|
||||
FREE(dhcp_dis);
|
||||
FREE(url);
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d error", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (CWMP_STRLEN(url) == 0 || icwmp_asprintf(&http_c.url, "%s", url) == -1) {
|
||||
FREE(dhcp_dis);
|
||||
FREE(url);
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d error", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -68,6 +73,7 @@ int http_client_init(struct cwmp *cwmp)
|
|||
if (url == NULL || icwmp_asprintf(&http_c.url, "%s", url) == -1) {
|
||||
FREE(dhcp_dis);
|
||||
FREE(url);
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d error", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -76,14 +82,16 @@ int http_client_init(struct cwmp *cwmp)
|
|||
if (dhcp_dis)
|
||||
free(dhcp_dis);
|
||||
|
||||
CWMP_LOG(INFO, "ACS url: %s", http_c.url);
|
||||
CWMP_LOG(INFO, "#### ACS url: %s", http_c.url);
|
||||
|
||||
/* TODO debug ssl config from freecwmp*/
|
||||
|
||||
curl_global_init(CURL_GLOBAL_SSL);
|
||||
curl = curl_easy_init();
|
||||
if (!curl)
|
||||
if (!curl) {
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d error", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool v6_enable = global_bool_param_read(&cwmp->conf.ipv6_enable);
|
||||
if (v6_enable) {
|
||||
|
|
@ -99,11 +107,13 @@ int http_client_init(struct cwmp *cwmp)
|
|||
|
||||
cwmp_uci_set_value("cwmp", "acs", "ip_version", (tmp == 1) ? "4" : "6");
|
||||
}
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void http_client_exit(void)
|
||||
{
|
||||
CWMP_LOG(DEBUG, "#### entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
icwmp_free(http_c.url);
|
||||
|
||||
if (http_c.header_list) {
|
||||
|
|
@ -117,37 +127,45 @@ void http_client_exit(void)
|
|||
curl = NULL;
|
||||
}
|
||||
curl_global_cleanup();
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
static size_t http_get_response(void *buffer, size_t size, size_t rxed, char **msg_in)
|
||||
{
|
||||
CWMP_LOG(DEBUG, "#### entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
char *c = NULL;
|
||||
|
||||
CWMP_LOG(INFO, "HTTP CURL handler function");
|
||||
CWMP_LOG(INFO, "#### HTTP CURL handler function");
|
||||
|
||||
if (msg_in == NULL) {
|
||||
CWMP_LOG(ERROR, "msg_in is null");
|
||||
CWMP_LOG(ERROR, "#### msg_in is null");
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (buffer == NULL) {
|
||||
CWMP_LOG(ERROR, "Buffer is null");
|
||||
CWMP_LOG(ERROR, "#### Buffer is null");
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (cwmp_asprintf(&c, "%s%.*s", *msg_in, (int)(size * rxed), (char *)buffer) == -1) {
|
||||
FREE(*msg_in);
|
||||
CWMP_LOG(ERROR, "#### asprintf failed");
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d error", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
FREE(*msg_in);
|
||||
*msg_in = c;
|
||||
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
return size * rxed;
|
||||
}
|
||||
|
||||
int http_send_message(struct cwmp *cwmp, char *msg_out, int msg_out_len, char **msg_in)
|
||||
{
|
||||
CWMP_LOG(DEBUG, "#### entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
unsigned char buf[sizeof(struct in6_addr)];
|
||||
int tmp = 0;
|
||||
CURLcode res;
|
||||
|
|
@ -158,16 +176,22 @@ int http_send_message(struct cwmp *cwmp, char *msg_out, int msg_out_len, char **
|
|||
|
||||
http_c.header_list = NULL;
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "User-Agent: iopsys-cwmp");
|
||||
if (!http_c.header_list)
|
||||
if (!http_c.header_list) {
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d error", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "Content-Type: text/xml");
|
||||
if (!http_c.header_list)
|
||||
if (!http_c.header_list) {
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d error", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (global_bool_param_read(&cwmp->conf.http_disable_100continue)) {
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "Expect:");
|
||||
if (!http_c.header_list)
|
||||
if (!http_c.header_list) {
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d error", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
curl_easy_setopt(curl, CURLOPT_URL, http_c.url);
|
||||
global_string_param_read(&cwmp->conf.acs_userid, &temp);
|
||||
|
|
@ -222,6 +246,7 @@ int http_send_message(struct cwmp *cwmp, char *msg_out, int msg_out_len, char **
|
|||
FREE(temp);
|
||||
|
||||
global_string_param_read(&cwmp->conf.interface, &temp);
|
||||
CWMP_LOG(DEBUG, "#### func: %s, line: %d interface %s", __FUNCTION__, __LINE__, temp);
|
||||
curl_easy_setopt(curl, CURLOPT_INTERFACE, temp);
|
||||
FREE(temp);
|
||||
*msg_in = (char *)calloc(1, sizeof(char));
|
||||
|
|
@ -233,9 +258,9 @@ int http_send_message(struct cwmp *cwmp, char *msg_out, int msg_out_len, char **
|
|||
if (len) {
|
||||
if (errbuf[len - 1] == '\n')
|
||||
errbuf[len - 1] = '\0';
|
||||
CWMP_LOG(ERROR, "libcurl: (%d) %s", res, errbuf);
|
||||
CWMP_LOG(ERROR, "#### 1-libcurl: (%d) %s", res, errbuf);
|
||||
} else {
|
||||
CWMP_LOG(ERROR, "libcurl: (%d) %s", res, curl_easy_strerror(res));
|
||||
CWMP_LOG(ERROR, "#### 2-libcurl: (%d) %s", res, curl_easy_strerror(res));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -266,7 +291,7 @@ int http_send_message(struct cwmp *cwmp, char *msg_out, int msg_out_len, char **
|
|||
|
||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
|
||||
if (http_code == 204) {
|
||||
CWMP_LOG(INFO, "Receive HTTP 204 No Content");
|
||||
CWMP_LOG(INFO, "#### Receive HTTP 204 No Content");
|
||||
}
|
||||
|
||||
if (http_code == 415) {
|
||||
|
|
@ -286,6 +311,7 @@ int http_send_message(struct cwmp *cwmp, char *msg_out, int msg_out_len, char **
|
|||
if (res)
|
||||
goto error;
|
||||
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d success", __FUNCTION__, __LINE__);
|
||||
return 0;
|
||||
|
||||
error:
|
||||
|
|
@ -294,20 +320,24 @@ error:
|
|||
curl_slist_free_all(http_c.header_list);
|
||||
http_c.header_list = NULL;
|
||||
}
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d error", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void http_success_cr(void)
|
||||
{
|
||||
CWMP_LOG(INFO, "Connection Request thread: add connection request event in the queue");
|
||||
CWMP_LOG(DEBUG, "#### entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
CWMP_LOG(INFO, "#### Connection Request thread: add connection request event in the queue");
|
||||
pthread_mutex_lock(&(cwmp_main.mutex_session_queue));
|
||||
cwmp_add_event_container(&cwmp_main, EVENT_IDX_6CONNECTION_REQUEST, "");
|
||||
pthread_mutex_unlock(&(cwmp_main.mutex_session_queue));
|
||||
pthread_cond_signal(&(cwmp_main.threshold_session_send));
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
static void http_cr_new_client(int client, bool service_available)
|
||||
{
|
||||
CWMP_LOG(DEBUG, "#### entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
FILE *fp = NULL;
|
||||
char buffer[BUFSIZ] = {0};
|
||||
char auth_digest_buffer[BUFSIZ] = {0};
|
||||
|
|
@ -320,10 +350,10 @@ static void http_cr_new_client(int client, bool service_available)
|
|||
char *username = NULL;
|
||||
char *password = NULL;
|
||||
|
||||
CWMP_LOG(INFO, "Received a new CR from ACS, service_available: %d", service_available);
|
||||
CWMP_LOG(INFO, "#### Received a new CR from ACS, service_available: %d", service_available);
|
||||
fp = fdopen(client, "r+");
|
||||
if (fp == NULL) {
|
||||
CWMP_LOG(INFO, "Failed to open client socket");
|
||||
CWMP_LOG(INFO, "#### Failed to open client socket");
|
||||
service_available = false;
|
||||
goto http_end;
|
||||
}
|
||||
|
|
@ -333,7 +363,7 @@ static void http_cr_new_client(int client, bool service_available)
|
|||
memset(auth_digest_buffer, 0, BUFSIZ);
|
||||
if (!username || !password) {
|
||||
// if we dont have username or password configured proceed with connecting to ACS
|
||||
CWMP_LOG(INFO, "Failed to get acs username and password");
|
||||
CWMP_LOG(INFO, "#### Failed to get acs username and password");
|
||||
service_available = false;
|
||||
goto http_end;
|
||||
}
|
||||
|
|
@ -394,14 +424,14 @@ http_end:
|
|||
FREE(username);
|
||||
FREE(password);
|
||||
if (!service_available || !method_is_get) {
|
||||
CWMP_LOG(WARNING, "Receive Connection Request: Return 503 Service Unavailable");
|
||||
CWMP_LOG(WARNING, "#### Receive Connection Request: Return 503 Service Unavailable");
|
||||
if (fp) {
|
||||
fputs("HTTP/1.1 503 Service Unavailable\r\n", fp);
|
||||
fputs("Connection: close\r\n", fp);
|
||||
fputs("Content-Length: 0\r\n", fp);
|
||||
}
|
||||
} else if (auth_status) {
|
||||
CWMP_LOG(INFO, "Receive Connection Request: success authentication");
|
||||
CWMP_LOG(INFO, "#### Receive Connection Request: success authentication");
|
||||
if (fp) {
|
||||
fputs("HTTP/1.1 200 OK\r\n", fp);
|
||||
fputs("Connection: close\r\n", fp);
|
||||
|
|
@ -409,7 +439,7 @@ http_end:
|
|||
}
|
||||
http_success_cr();
|
||||
} else if (internal_error) {
|
||||
CWMP_LOG(WARNING, "Receive Connection Request: Return 500 Internal Error");
|
||||
CWMP_LOG(WARNING, "#### Receive Connection Request: Return 500 Internal Error");
|
||||
if (fp) {
|
||||
fputs("HTTP/1.1 500 Internal Server Error\r\n", fp);
|
||||
fputs("Connection: close\r\n", fp);
|
||||
|
|
@ -417,7 +447,7 @@ http_end:
|
|||
}
|
||||
}
|
||||
else {
|
||||
CWMP_LOG(WARNING, "Receive Connection Request: Return 401 Unauthorized");
|
||||
CWMP_LOG(WARNING, "#### Receive Connection Request: Return 401 Unauthorized");
|
||||
if (fp) {
|
||||
fputs("HTTP/1.1 401 Unauthorized\r\n", fp);
|
||||
fputs("Connection: close\r\n", fp);
|
||||
|
|
@ -429,10 +459,12 @@ http_end:
|
|||
fputs("\r\n", fp);
|
||||
fclose(fp);
|
||||
}
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
void http_server_init(void)
|
||||
{
|
||||
CWMP_LOG(DEBUG, "#### entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
struct sockaddr_in6 server = { 0 };
|
||||
unsigned short cr_port;
|
||||
unsigned short prev_cr_port = (unsigned short)global_int_param_read(&cwmp_main.conf.connection_request_port);
|
||||
|
|
@ -441,21 +473,24 @@ void http_server_init(void)
|
|||
cr_port = (unsigned short)global_int_param_read(&cwmp_main.conf.connection_request_port);
|
||||
unsigned short i = (DEFAULT_CONNECTION_REQUEST_PORT == cr_port) ? 1 : 0;
|
||||
//Create socket
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
return;
|
||||
}
|
||||
|
||||
cwmp_main.cr_socket_desc = socket(AF_INET6, SOCK_STREAM, 0);
|
||||
if (cwmp_main.cr_socket_desc == -1) {
|
||||
CWMP_LOG(ERROR, "Could not open server socket for Connection Requests, Error no is : %d, Error description is : %s", errno, strerror(errno));
|
||||
CWMP_LOG(ERROR, "#### Could not open server socket for Connection Requests, Error no is : %d, Error description is : %s", errno, strerror(errno));
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
CWMP_LOG(DEBUG, "#### sock_fd: %d", cwmp_main.cr_socket_desc);
|
||||
|
||||
fcntl(cwmp_main.cr_socket_desc, F_SETFD, fcntl(cwmp_main.cr_socket_desc, F_GETFD) | FD_CLOEXEC);
|
||||
|
||||
int reusaddr = 1;
|
||||
if (setsockopt(cwmp_main.cr_socket_desc, SOL_SOCKET, SO_REUSEADDR, &reusaddr, sizeof(int)) < 0) {
|
||||
CWMP_LOG(WARNING, "setsockopt(SO_REUSEADDR) failed");
|
||||
CWMP_LOG(WARNING, "#### setsockopt(SO_REUSEADDR) failed");
|
||||
}
|
||||
|
||||
//Prepare the sockaddr_in structure
|
||||
|
|
@ -463,16 +498,18 @@ void http_server_init(void)
|
|||
server.sin6_addr = in6addr_any;
|
||||
|
||||
for (;; i++) {
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
CWMP_LOG(DEBUG, "exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
return;
|
||||
}
|
||||
|
||||
server.sin6_port = htons(cr_port);
|
||||
//Bind
|
||||
if (bind(cwmp_main.cr_socket_desc, (struct sockaddr *)&server, sizeof(server)) < 0) {
|
||||
//print the error message
|
||||
CWMP_LOG(ERROR, "Could not bind server socket on the port %d, Error no is : %d, Error description is : %s", cr_port, errno, strerror(errno));
|
||||
CWMP_LOG(ERROR, "#### Could not bind server socket on the port %d, Error no is : %d, Error description is : %s", cr_port, errno, strerror(errno));
|
||||
cr_port = DEFAULT_CONNECTION_REQUEST_PORT + i;
|
||||
CWMP_LOG(INFO, "Trying to use another connection request port: %d", cr_port);
|
||||
CWMP_LOG(INFO, "#### Trying to use another connection request port: %d", cr_port);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
|
@ -487,11 +524,13 @@ void http_server_init(void)
|
|||
connection_request_port_value_change(&cwmp_main, cr_port);
|
||||
}
|
||||
|
||||
CWMP_LOG(INFO, "Connection Request server initiated with the port: %d", cr_port);
|
||||
CWMP_LOG(INFO, "#### Connection Request server initiated with the port: %d", cr_port);
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
void http_server_listen(void)
|
||||
{
|
||||
CWMP_LOG(DEBUG, "#### entry func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
int c;
|
||||
int cr_request = 0;
|
||||
time_t restrict_start_time = 0;
|
||||
|
|
@ -503,12 +542,14 @@ void http_server_listen(void)
|
|||
//Accept and incoming connection
|
||||
c = sizeof(struct sockaddr_in);
|
||||
do {
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
return;
|
||||
}
|
||||
|
||||
int client_sock = accept(cwmp_main.cr_socket_desc, (struct sockaddr *)&client, (socklen_t *)&c);
|
||||
if (client_sock < 0) {
|
||||
CWMP_LOG(ERROR, "Could not accept connections for Connection Requests!");
|
||||
CWMP_LOG(ERROR, "#### Could not accept connections for Connection Requests! Error: %d", errno);
|
||||
shutdown(cwmp_main.cr_socket_desc, SHUT_RDWR);
|
||||
http_server_init();
|
||||
listen(cwmp_main.cr_socket_desc, 3);
|
||||
|
|
@ -517,6 +558,7 @@ void http_server_listen(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
CWMP_LOG(DEBUG, "#### accepted socket %d", client_sock);
|
||||
bool service_available;
|
||||
time_t current_time;
|
||||
|
||||
|
|
@ -530,10 +572,12 @@ void http_server_listen(void)
|
|||
if (cr_request > CONNECTION_REQUEST_RESTRICT_REQUEST) {
|
||||
restrict_start_time = current_time;
|
||||
service_available = false;
|
||||
CWMP_LOG(WARNING, "CR count %d exceeded max %d, SKIPPED", cr_request, CONNECTION_REQUEST_RESTRICT_REQUEST);
|
||||
CWMP_LOG(WARNING, "#### CR count %d exceeded max %d, SKIPPED", cr_request, CONNECTION_REQUEST_RESTRICT_REQUEST);
|
||||
}
|
||||
}
|
||||
http_cr_new_client(client_sock, service_available);
|
||||
close(client_sock);
|
||||
CWMP_LOG(DEBUG, "#### Client socket %d closed", client_sock);
|
||||
} while (1);
|
||||
CWMP_LOG(DEBUG, "#### exit func: %s, line: %d", __FUNCTION__, __LINE__);
|
||||
}
|
||||
|
|
|
|||
2
log.c
2
log.c
|
|
@ -154,6 +154,8 @@ end:
|
|||
|
||||
void puts_log_xmlmsg(int severity, char *msg, int msgtype)
|
||||
{
|
||||
if (msg == NULL)
|
||||
CWMP_LOG(ERROR, "######### input msg is null ###############");
|
||||
struct tm *Tm;
|
||||
struct timeval tv;
|
||||
FILE *pLog = NULL;
|
||||
|
|
|
|||
|
|
@ -692,13 +692,15 @@ void *thread_periodic_check_notify(void *v)
|
|||
current_time = time(NULL);
|
||||
periodic_timeout.tv_sec = current_time + periodic_interval;
|
||||
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
break;
|
||||
}
|
||||
|
||||
pthread_cond_timedwait(&(cwmp->threshold_notify_periodic), &(cwmp->mutex_notify_periodic), &periodic_timeout);
|
||||
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
break;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&(cwmp->mutex_session_send));
|
||||
is_notify = check_value_change();
|
||||
|
|
|
|||
|
|
@ -30,8 +30,9 @@ void *thread_cwmp_rpc_cpe_scheduleInform(void *v)
|
|||
|
||||
for (;;) {
|
||||
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (list_schedule_inform.next != &(list_schedule_inform)) {
|
||||
schedule_inform = list_entry(list_schedule_inform.next, struct schedule_inform, list);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include "sched_inform.h"
|
||||
#include "event.h"
|
||||
#include "cwmp_uci.h"
|
||||
#include "libubox/blobmsg_json.h"
|
||||
|
||||
typedef int (*callback)(struct blob_buf *b);
|
||||
|
||||
|
|
|
|||
3
upload.c
3
upload.c
|
|
@ -204,8 +204,9 @@ void *thread_cwmp_rpc_cpe_upload(void *v)
|
|||
|
||||
for (;;) {
|
||||
|
||||
if (thread_end)
|
||||
if (thread_end) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (list_upload.next != &(list_upload)) {
|
||||
pupload = list_entry(list_upload.next, struct upload, list);
|
||||
|
|
|
|||
8
xml.c
8
xml.c
|
|
@ -134,6 +134,7 @@ void xml_exit(void)
|
|||
|
||||
int xml_send_message(struct cwmp *cwmp, struct session *session, struct rpc *rpc)
|
||||
{
|
||||
CWMP_LOG(INFO, "#### %s start ####", __FUNCTION__);
|
||||
char *s, *msg_out = NULL, *msg_in = NULL;
|
||||
char c[512];
|
||||
int msg_out_len = 0, f, r = 0;
|
||||
|
|
@ -146,6 +147,7 @@ int xml_send_message(struct cwmp *cwmp, struct session *session, struct rpc *rpc
|
|||
}
|
||||
|
||||
if (session->tree_out) {
|
||||
CWMP_LOG(INFO, "#### %s line: %d ####", __FUNCTION__, __LINE__);
|
||||
unsigned char *zmsg_out;
|
||||
msg_out = mxmlSaveAllocString(session->tree_out, whitespace_cb);
|
||||
if (msg_out == NULL) {
|
||||
|
|
@ -153,9 +155,12 @@ int xml_send_message(struct cwmp *cwmp, struct session *session, struct rpc *rpc
|
|||
return -1;
|
||||
}
|
||||
|
||||
CWMP_LOG(INFO, "#### %s line: %d ####", __FUNCTION__, __LINE__);
|
||||
CWMP_LOG_XML_MSG(DEBUG, msg_out, XML_MSG_OUT);
|
||||
if (compression != COMP_NONE) {
|
||||
CWMP_LOG(INFO, "#### %s line: %d ####", __FUNCTION__, __LINE__);
|
||||
if (zlib_compress(msg_out, &zmsg_out, &msg_out_len, compression)) {
|
||||
CWMP_LOG(INFO, "#### %s line: %d ####", __FUNCTION__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
FREE(msg_out);
|
||||
|
|
@ -163,6 +168,7 @@ int xml_send_message(struct cwmp *cwmp, struct session *session, struct rpc *rpc
|
|||
} else {
|
||||
msg_out_len = msg_out ? strlen(msg_out) : 0;
|
||||
}
|
||||
CWMP_LOG(INFO, "#### %s line: %d ####", __FUNCTION__, __LINE__);
|
||||
}
|
||||
while (1) {
|
||||
f = 0;
|
||||
|
|
@ -223,11 +229,13 @@ int xml_send_message(struct cwmp *cwmp, struct session *session, struct rpc *rpc
|
|||
end:
|
||||
FREE(msg_out);
|
||||
FREE(msg_in);
|
||||
CWMP_LOG(INFO, "#### %s return ####", __FUNCTION__);
|
||||
return 0;
|
||||
|
||||
error:
|
||||
FREE(msg_out);
|
||||
FREE(msg_in);
|
||||
CWMP_LOG(INFO, "#### %s return ####", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue