1
0
mirror of https://github.com/coturn/coturn.git synced 2025-10-29 05:51:10 +01:00

kernel channel condition improved

This commit is contained in:
mom040267 2014-05-09 07:51:47 +00:00
parent 3540c85441
commit 25c68ead31

View File

@ -2242,12 +2242,14 @@ static int handle_turn_channel_bind(turn_turnserver *server,
ioa_network_buffer_set_size(nbh,len); ioa_network_buffer_set_size(nbh,len);
*resp_constructed = 1; *resp_constructed = 1;
if(!(ss->is_mobile)) {
if(get_ioa_socket_type(ss->client_session.s) == UDP_SOCKET || if(get_ioa_socket_type(ss->client_session.s) == UDP_SOCKET ||
get_ioa_socket_type(ss->client_session.s) == TCP_SOCKET) { get_ioa_socket_type(ss->client_session.s) == TCP_SOCKET) {
if(get_ioa_socket_type(ss->alloc.relay_session.s) == UDP_SOCKET) {
chn->kernel_channel = CREATE_TURN_CHANNEL_KERNEL(chn->chnum, chn->kernel_channel = CREATE_TURN_CHANNEL_KERNEL(chn->chnum,
get_ioa_socket_address_family(ss->client_session.s), get_ioa_socket_address_family(ss->client_session.s),
get_ioa_socket_address_family(ss->alloc.relay_session.s), get_ioa_socket_address_family(ss->alloc.relay_session.s),
get_ioa_socket_type(ss->client_session.s)==UDP_SOCKET ? IPPROTO_UDP : IPPROTO_TCP, (get_ioa_socket_type(ss->client_session.s)==UDP_SOCKET ? IPPROTO_UDP : IPPROTO_TCP),
&(get_remote_addr_from_ioa_socket(ss->client_session.s)->ss), &(get_remote_addr_from_ioa_socket(ss->client_session.s)->ss),
&(get_local_addr_from_ioa_socket(ss->client_session.s)->ss), &(get_local_addr_from_ioa_socket(ss->client_session.s)->ss),
&(get_local_addr_from_ioa_socket(ss->alloc.relay_session.s)), &(get_local_addr_from_ioa_socket(ss->alloc.relay_session.s)),
@ -2258,6 +2260,8 @@ static int handle_turn_channel_bind(turn_turnserver *server,
} }
} }
} }
}
}
FUNCEND; FUNCEND;
return 0; return 0;