mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 891551 - Part 8: Increase and make backlog value configurable. r=bwc
This commit is contained in:
parent
8b55540723
commit
78f506ded8
@ -431,6 +431,7 @@ RefPtr<NrIceCtx> NrIceCtx::Create(const std::string& name,
|
||||
int32_t stun_client_maximum_transmits = 7;
|
||||
int32_t ice_trickle_grace_period = 5000;
|
||||
int32_t ice_tcp_so_sock_count = 3;
|
||||
int32_t ice_tcp_listen_backlog = 10;
|
||||
#ifndef MOZILLA_XPCOMRT_API
|
||||
nsresult res;
|
||||
nsCOMPtr<nsIPrefService> prefs =
|
||||
@ -448,6 +449,9 @@ RefPtr<NrIceCtx> NrIceCtx::Create(const std::string& name,
|
||||
branch->GetIntPref(
|
||||
"media.peerconnection.ice.tcp_so_sock_count",
|
||||
&ice_tcp_so_sock_count);
|
||||
branch->GetIntPref(
|
||||
"media.peerconnection.ice.tcp_listen_backlog",
|
||||
&ice_tcp_listen_backlog);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -457,6 +461,10 @@ RefPtr<NrIceCtx> NrIceCtx::Create(const std::string& name,
|
||||
ice_trickle_grace_period);
|
||||
NR_reg_set_int4((char *)NR_ICE_REG_ICE_TCP_SO_SOCK_COUNT,
|
||||
ice_tcp_so_sock_count);
|
||||
NR_reg_set_int4((char *)NR_ICE_REG_ICE_TCP_SO_SOCK_COUNT,
|
||||
ice_tcp_so_sock_count);
|
||||
NR_reg_set_int4((char *)NR_ICE_REG_ICE_TCP_LISTEN_BACKLOG,
|
||||
ice_tcp_listen_backlog);
|
||||
|
||||
if (allow_loopback) {
|
||||
NR_reg_set_char((char *)NR_STUN_REG_PREF_ALLOW_LOOPBACK_ADDRS, 1);
|
||||
|
@ -303,7 +303,7 @@ static int nr_ice_component_get_port_from_ephemeral_range(uint16_t *port)
|
||||
void *buf = port;
|
||||
if(r=nr_crypto_random_bytes(buf, 2))
|
||||
ABORT(r);
|
||||
*port|=0x8000; /* make it >= 0x8000 */
|
||||
*port|=49152; /* make it fit into IANA ephemeral port range >= 49152 */
|
||||
_status=0;
|
||||
abort:
|
||||
return(_status);
|
||||
@ -311,7 +311,7 @@ abort:
|
||||
|
||||
static int nr_ice_component_create_tcp_host_candidate(struct nr_ice_ctx_ *ctx,
|
||||
nr_ice_component *component, nr_transport_addr *interface_addr, nr_socket_tcp_type tcp_type,
|
||||
int so_sock_ct, char *lufrag, Data *pwd, nr_ice_socket **isock)
|
||||
int backlog, int so_sock_ct, char *lufrag, Data *pwd, nr_ice_socket **isock)
|
||||
{
|
||||
int r,_status;
|
||||
nr_ice_candidate *cand=0;
|
||||
@ -344,7 +344,7 @@ static int nr_ice_component_create_tcp_host_candidate(struct nr_ice_ctx_ *ctx,
|
||||
|
||||
} while(r);
|
||||
|
||||
if((tcp_type == TCP_TYPE_PASSIVE) && (r=nr_socket_listen(nrsock,1)))
|
||||
if((tcp_type == TCP_TYPE_PASSIVE) && (r=nr_socket_listen(nrsock,backlog)))
|
||||
ABORT(r);
|
||||
|
||||
if((r=nr_ice_socket_create(ctx,component,nrsock,NR_ICE_SOCKET_TYPE_STREAM_TCP,&isock_tmp)))
|
||||
@ -385,6 +385,7 @@ static int nr_ice_component_initialize_tcp(struct nr_ice_ctx_ *ctx,nr_ice_compon
|
||||
int j;
|
||||
int r,_status;
|
||||
int so_sock_ct=0;
|
||||
int backlog=10;
|
||||
|
||||
r_log(LOG_ICE,LOG_DEBUG,"nr_ice_component_initialize_tcp");
|
||||
|
||||
@ -393,6 +394,11 @@ static int nr_ice_component_initialize_tcp(struct nr_ice_ctx_ *ctx,nr_ice_compon
|
||||
ABORT(r);
|
||||
}
|
||||
|
||||
if(r=NR_reg_get_int4(NR_ICE_REG_ICE_TCP_LISTEN_BACKLOG,&backlog)){
|
||||
if(r!=R_NOT_FOUND)
|
||||
ABORT(r);
|
||||
}
|
||||
|
||||
for(i=0;i<addr_ct;i++){
|
||||
char suppress;
|
||||
nr_ice_socket *isock_psv=0;
|
||||
@ -409,18 +415,18 @@ static int nr_ice_component_initialize_tcp(struct nr_ice_ctx_ *ctx,nr_ice_compon
|
||||
|
||||
/* passive host candidate */
|
||||
if ((r=nr_ice_component_create_tcp_host_candidate(ctx, component, &addrs[i].addr,
|
||||
TCP_TYPE_PASSIVE, 0, lufrag, pwd, &isock_psv)))
|
||||
TCP_TYPE_PASSIVE, backlog, 0, lufrag, pwd, &isock_psv)))
|
||||
ABORT(r);
|
||||
|
||||
/* active host candidate */
|
||||
if ((r=nr_ice_component_create_tcp_host_candidate(ctx, component, &addrs[i].addr,
|
||||
TCP_TYPE_ACTIVE, 0, lufrag, pwd, NULL)))
|
||||
TCP_TYPE_ACTIVE, 0, 0, lufrag, pwd, NULL)))
|
||||
ABORT(r);
|
||||
|
||||
/* simultaneous-open host candidate */
|
||||
if (so_sock_ct) {
|
||||
if ((r=nr_ice_component_create_tcp_host_candidate(ctx, component, &addrs[i].addr,
|
||||
TCP_TYPE_SO, so_sock_ct, lufrag, pwd, &isock_so)))
|
||||
TCP_TYPE_SO, 0, so_sock_ct, lufrag, pwd, &isock_so)))
|
||||
ABORT(r);
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,7 @@ extern "C" {
|
||||
#define NR_ICE_REG_TURN_SRV_PASSWORD "password"
|
||||
|
||||
#define NR_ICE_REG_ICE_TCP_SO_SOCK_COUNT "ice.tcp.so_sock_count"
|
||||
#define NR_ICE_REG_ICE_TCP_LISTEN_BACKLOG "ice.tcp.listen_backlog"
|
||||
|
||||
#define NR_ICE_REG_KEEPALIVE_TIMER "ice.keepalive_timer"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user