diff --git a/src/cwmp_http.c b/src/cwmp_http.c index 1609725..4b41400 100644 --- a/src/cwmp_http.c +++ b/src/cwmp_http.c @@ -75,6 +75,7 @@ int icwmp_check_http_connection(void) curl_easy_setopt(c, CURLOPT_URL, cwmp_main->conf.acs_url); curl_easy_setopt(c, CURLOPT_CONNECT_ONLY, 1L); curl_easy_setopt(c, CURLOPT_IPRESOLVE, resolve); + curl_easy_setopt(c, CURLOPT_TIMEOUT, 2); if (CWMP_STRLEN(cwmp_main->net.interface)) curl_easy_setopt(c, CURLOPT_INTERFACE, cwmp_main->net.interface); diff --git a/src/session.c b/src/session.c index 5014ac3..87eb348 100644 --- a/src/session.c +++ b/src/session.c @@ -320,7 +320,6 @@ static void schedule_session_retry(void) cwmp_main->retry_count_session++; int t = cwmp_get_retry_interval(); CWMP_LOG(INFO, "Retry session, retry count = %d, retry in %ds", cwmp_main->retry_count_session, t); - cwmp_config_load(); trigger_periodic_notify_check(); if (!cwmp_main->session->session_status.is_heartbeat) { @@ -402,23 +401,11 @@ void start_cwmp_session(void) run_session_end_func(); cwmp_session_exit(); - return; } if (cwmp_main->session->error == CWMP_RETRY_SESSION && (!list_empty(&(cwmp_main->session->events)) || (list_empty(&(cwmp_main->session->events)) && cwmp_main->cwmp_cr_event == 0))) { //CWMP Retry session - cwmp_config_load(); - cwmp_main->retry_count_session++; - int t = cwmp_get_retry_interval(); - CWMP_LOG(INFO, "Retry session, retry count = %d, retry in %ds", cwmp_main->retry_count_session, t); - if (!cwmp_main->session->session_status.is_heartbeat) { - set_cwmp_session_status(SESSION_FAILURE, t); - uloop_timeout_set(&retry_session_timer, 1000 * t); - } else { - uloop_timeout_cancel(&heartbeat_session_timer); - uloop_timeout_set(&heartbeat_session_timer, 1000 * t); - } - + schedule_session_retry(); cwmp_set_end_session(END_SESSION_RELOAD); } else { save_acs_bkp_config();