get the new acs url from provisioning.iup.urlcwmp when dhcp_discovery is enabled and the session is retried

This commit is contained in:
Anis Ellouze 2016-03-07 12:12:54 +01:00
parent bbbf0b2f76
commit 07aa2cba24
2 changed files with 12 additions and 1 deletions

12
http.c
View file

@ -50,10 +50,20 @@ static CURL *curl;
int
http_client_init(struct cwmp *cwmp)
{
char *dhcp_dis;
char *acs_var_stat;
uci_get_value(UCI_DHCP_DISCOVERY_PATH, &dhcp_dis);
#ifdef HTTP_CURL
if (asprintf(&http_c.url, "%s",
if (dhcp_dis && cwmp->retry_count_session > 0 && strcmp(dhcp_dis, "enable") == 0) {
uci_get_value(UCI_DHCP_ACS_URL, &acs_var_stat);
if (asprintf(&http_c.url, "%s",
acs_var_stat) == -1)
return -1;
} else {
if (asprintf(&http_c.url, "%s",
cwmp->conf.acsurl) == -1)
return -1;
}
#endif
#ifdef HTTP_ZSTREAM

View file

@ -68,6 +68,7 @@
#define LW_NOTIFICATION_ENABLE "cwmp.lwn.enable"
#define LW_NOTIFICATION_HOSTNAME "cwmp.lwn.hostname"
#define LW_NOTIFICATION_PORT "cwmp.lwn.port"
#define UCI_DHCP_ACS_URL "provisioning.iup.urlcwmp"
enum end_session {