Commit ffad9fe1 authored by Simon Morlat's avatar Simon Morlat

Close the channel when an "unexpected event" error occurs. Indeed, we take the...

Close the channel when an "unexpected event" error occurs. Indeed, we take the risk of leaving the channel out of the main loop in this case because of the "return FALSE", so this channel becomes useless.
parent 4a7fb340
......@@ -238,7 +238,8 @@ static int stream_channel_process_data(belle_sip_stream_channel_t *obj,unsigned
} else if (state == BELLE_SIP_CHANNEL_READY) {
return belle_sip_channel_process_data(base,revents);
} else {
belle_sip_warning("Unexpected event [%i], in state [%s] for channel [%p]",revents,belle_sip_channel_state_to_string(state),obj);
belle_sip_error("Unexpected event [%i], in state [%s] for channel [%p]",revents,belle_sip_channel_state_to_string(state),obj);
channel_set_state(base,BELLE_SIP_CHANNEL_ERROR);
return BELLE_SIP_STOP;
}
return BELLE_SIP_CONTINUE;
......
......@@ -631,7 +631,8 @@ static int tls_process_data(belle_sip_channel_t *obj,unsigned int revents){
} else if ( obj->state == BELLE_SIP_CHANNEL_READY) {
return belle_sip_channel_process_data(obj,revents);
} else {
belle_sip_warning("Unexpected event [%i], for channel [%p]",revents,channel);
belle_sip_error("Unexpected event [%i], for channel [%p]",revents,channel);
channel_set_state(obj,BELLE_SIP_CHANNEL_ERROR);
return BELLE_SIP_STOP;
}
return BELLE_SIP_CONTINUE;
......
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