mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2025-12-10 07:44:41 +01:00
Get dhcp url from /etc/config/cwmp
This commit is contained in:
parent
d485fc0eef
commit
5401894b4e
4 changed files with 7 additions and 5 deletions
2
config.c
2
config.c
|
|
@ -104,7 +104,7 @@ int get_global_config(struct config *conf)
|
||||||
|
|
||||||
error = uci_get_value(UCI_DHCP_DISCOVERY_PATH, &value);
|
error = uci_get_value(UCI_DHCP_DISCOVERY_PATH, &value);
|
||||||
error2 = uci_get_value(UCI_ACS_URL_PATH, &value2);
|
error2 = uci_get_value(UCI_ACS_URL_PATH, &value2);
|
||||||
error3 = uci_get_state_value(UCI_DHCP_ACS_URL, &value3);
|
error3 = uci_get_value(UCI_DHCP_ACS_URL, &value3);
|
||||||
|
|
||||||
if ((((error == CWMP_OK) && (value != NULL) && (strcmp(value, "enable") == 0)) || ((error2 == CWMP_OK) && ((value2 == NULL) || (value2[0] == 0)))) && ((error3 == CWMP_OK) && (value3 != NULL) && (value3[0] != 0))) {
|
if ((((error == CWMP_OK) && (value != NULL) && (strcmp(value, "enable") == 0)) || ((error2 == CWMP_OK) && ((value2 == NULL) || (value2[0] == 0)))) && ((error3 == CWMP_OK) && (value3 != NULL) && (value3[0] != 0))) {
|
||||||
FREE(conf->acsurl);
|
FREE(conf->acsurl);
|
||||||
|
|
|
||||||
1
cwmp.c
1
cwmp.c
|
|
@ -665,7 +665,6 @@ static void *thread_cwmp_signal_handler_thread(void *arg)
|
||||||
CWMP_LOG(INFO, "Catch of Signal(%d)", signal_num);
|
CWMP_LOG(INFO, "Catch of Signal(%d)", signal_num);
|
||||||
|
|
||||||
if (signal_num == SIGINT || signal_num == SIGTERM) {
|
if (signal_num == SIGINT || signal_num == SIGTERM) {
|
||||||
//copy_file(CWMP_BKP_FILE, "/etc/icwmpd/.icwmpd_backup_session.xml");
|
|
||||||
signal_exit = true;
|
signal_exit = true;
|
||||||
|
|
||||||
if (!ubus_exit)
|
if (!ubus_exit)
|
||||||
|
|
|
||||||
5
http.c
5
http.c
|
|
@ -119,12 +119,15 @@ static size_t http_get_response(void *buffer, size_t size, size_t rxed, char **m
|
||||||
{
|
{
|
||||||
char *c;
|
char *c;
|
||||||
|
|
||||||
|
if (*msg_in == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (cwmp_asprintf(&c, "%s%.*s", *msg_in, (int)(size * rxed), (char *)buffer) == -1) {
|
if (cwmp_asprintf(&c, "%s%.*s", *msg_in, (int)(size * rxed), (char *)buffer) == -1) {
|
||||||
FREE(*msg_in);
|
FREE(*msg_in);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(*msg_in);
|
FREE(*msg_in);
|
||||||
*msg_in = c;
|
*msg_in = c;
|
||||||
|
|
||||||
return size * rxed;
|
return size * rxed;
|
||||||
|
|
|
||||||
4
ubus.c
4
ubus.c
|
|
@ -111,13 +111,13 @@ static int cwmp_handle_command(struct ubus_context *ctx, struct ubus_object *obj
|
||||||
pthread_cond_signal(&threshold_apply_schedule_download);
|
pthread_cond_signal(&threshold_apply_schedule_download);
|
||||||
pthread_cond_signal(&threshold_upload);
|
pthread_cond_signal(&threshold_upload);
|
||||||
|
|
||||||
|
uloop_end();
|
||||||
|
|
||||||
shutdown(cwmp_main.cr_socket_desc, SHUT_RDWR);
|
shutdown(cwmp_main.cr_socket_desc, SHUT_RDWR);
|
||||||
|
|
||||||
if (!signal_exit)
|
if (!signal_exit)
|
||||||
kill(getpid(), SIGTERM);
|
kill(getpid(), SIGTERM);
|
||||||
|
|
||||||
uloop_end();
|
|
||||||
|
|
||||||
if (snprintf(info, sizeof(info), "icwmpd daemon stopped") == -1)
|
if (snprintf(info, sizeof(info), "icwmpd daemon stopped") == -1)
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue