From c26d6e51732c445dedeb71175bfef18e30ef93f7 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 23 Nov 2016 13:55:39 +0100 Subject: [PATCH] Ticket refs #10656 : icwmp not starting --- config.c | 9 +++++++++ http.c | 6 ++++++ inc/cwmp.h | 2 ++ init/icwmpd.init | 8 ++++++-- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index 6cc9e5a..e7159bf 100644 --- a/config.c +++ b/config.c @@ -609,6 +609,15 @@ int get_global_config(struct config *conf) { FREE(conf->https_ssl_capath); } + if((error = uci_get_value(HTTP_DISABLE_100CONTINUE,&value)) == CWMP_OK) + { + if(value != NULL) + { + if ((strcasecmp(value,"true")==0) || (strcmp(value,"1")==0)) + conf->http_disable_100continue = true; + value = NULL; + } + } if((error = uci_get_value(UCI_ACS_INSECURE_ENABLE,&value)) == CWMP_OK) { if(value != NULL) diff --git a/http.c b/http.c index 207f330..ccf8e10 100644 --- a/http.c +++ b/http.c @@ -186,6 +186,12 @@ http_send_message(struct cwmp *cwmp, char *msg_out, int msg_out_len,char **msg_i http_c.header_list = curl_slist_append(http_c.header_list, expect_header); if (!http_c.header_list) return -1; # endif /* ACS_FUSION */ + if (cwmp->conf.http_disable_100continue) + { + char *expect_header = "Expect:"; + http_c.header_list = curl_slist_append(http_c.header_list, expect_header); + if (!http_c.header_list) return -1; + } curl_easy_setopt(curl, CURLOPT_URL, http_c.url); curl_easy_setopt(curl, CURLOPT_USERNAME, cwmp->conf.acs_userid); curl_easy_setopt(curl, CURLOPT_PASSWORD, cwmp->conf.acs_passwd); diff --git a/inc/cwmp.h b/inc/cwmp.h index 500f5d0..57c6481 100644 --- a/inc/cwmp.h +++ b/inc/cwmp.h @@ -57,6 +57,7 @@ #define UCI_ACS_SSL_VERSION "cwmp.acs.ssl_version" #define UCI_ACS_COMPRESSION "cwmp.acs.compression" #define UCI_ACS_RETRY_MIN_WAIT_INTERVAL "cwmp.acs.retry_min_wait_interval" +#define HTTP_DISABLE_100CONTINUE "cwmp.acs.http_disable_100continue" #define UCI_ACS_RETRY_INTERVAL_MULTIPLIER "cwmp.acs.retry_interval_multiplier" #define UCI_LOG_SEVERITY_PATH "cwmp.cpe.log_severity" #define UCI_CPE_USERID_PATH "cwmp.cpe.userid" @@ -205,6 +206,7 @@ typedef struct config { bool xmpp_enable; int xmpp_connection_id; char *xmpp_allowed_jid; + bool http_disable_100continue; } config; typedef struct env { diff --git a/init/icwmpd.init b/init/icwmpd.init index 19ee575..c611a9a 100644 --- a/init/icwmpd.init +++ b/init/icwmpd.init @@ -36,14 +36,18 @@ check_acs_url() { if [ \( "_$acs_dhcp_discovery" = "_enable" \) -o \( "_$url" = "_" \) ];then url=`uci -P /var/state -q get $dhcp_url_path` echo "ACS URL from dhcp: $url" - uci -P /var/state -q set cwmp.acs.url=$url + if [ "_$url" != "_" ];then + uci -P /var/state -q set cwmp.acs.url=$url + fi elif [ "_$url" != "_" ];then url=`uci -q get cwmp.acs.url` echo "ACS URL from configuration: $url" else url=$default_acs echo "Using default ACS URL: $url" - uci -P /var/state -q set cwmp.acs.url=$url + if [ "_$url" != "_" ];then + uci -P /var/state -q set cwmp.acs.url=$url + fi fi check_url_format $url