Commit 8747aca9 authored by Simon Morlat's avatar Simon Morlat

fix crash in belle-sip while setting dscp to a non-sip channel

parent 8acd3337
......@@ -118,6 +118,7 @@ int stream_channel_connect(belle_sip_stream_channel_t *obj, const struct addrinf
belle_sip_socket_t sock;
tmp=1;
obj->base.ai_family=ai->ai_family;
sock=socket(ai->ai_family, SOCK_STREAM, IPPROTO_TCP);
if (sock==(belle_sip_socket_t)-1){
......@@ -192,8 +193,10 @@ int finalize_stream_connection(belle_sip_stream_channel_t *obj, unsigned int rev
#if TARGET_OS_IPHONE
stream_channel_enable_ios_background_mode(obj);
#endif
if (obj->base.stack->dscp)
belle_sip_socket_set_dscp(sock,obj->base.lp->ai_family,obj->base.stack->dscp);
if (obj->base.stack->dscp && obj->base.lp){
/*apply dscp only to channel belonging to a SIP listening point*/
belle_sip_socket_set_dscp(sock,obj->base.ai_family,obj->base.stack->dscp);
}
set_tcp_nodelay(sock);
return 0;
}else{
......
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