Commit 1e24c0f0 authored by jehan's avatar jehan

refresher shouldn't report io error if expire =0

parent be60dd5e
......@@ -84,6 +84,11 @@ static void process_io_error(void *user_ctx, const belle_sip_io_error_event_t *e
|| client_transaction !=refresher->transaction )))
return; /*not for me or no longuer involved*/
if (refresher->expires==0
&& belle_sip_transaction_get_state(BELLE_SIP_TRANSACTION(refresher->transaction)) != BELLE_SIP_TRANSACTION_TRYING
&& belle_sip_transaction_get_state(BELLE_SIP_TRANSACTION(refresher->transaction)) != BELLE_SIP_TRANSACTION_INIT ) {
return; /*not for me or no longuer involved because expire=0*/
}
if (refresher->state==started) retry_later(refresher);
if (refresher->listener) refresher->listener(refresher,refresher->user_data,503, "io error");
refresher->on_io_error=1;
......@@ -147,6 +152,9 @@ static void process_response_event(void *user_ctx, const belle_sip_response_even
}
/*update expire if needed*/
set_expires_from_trans(refresher);
if (refresher->expires<=0) {
belle_sip_refresher_stop(refresher); /*doesn not make sens to refresh if expire =0;*/
}
if (refresher->state==started) schedule_timer(refresher); /*re-arm timer*/
else belle_sip_message("Refresher [%p] not scheduling next refresh, because it was stopped");
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment