Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Olivier Crête
libnice
Commits
c8a2a789
Commit
c8a2a789
authored
Sep 05, 2017
by
Olivier Crête
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into eliminate-reliable-3-remerged
parents
17d8474e
ce33747e
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
704 additions
and
465 deletions
+704
-465
agent/agent-priv.h
agent/agent-priv.h
+3
-1
agent/agent.c
agent/agent.c
+136
-4
agent/agent.h
agent/agent.h
+40
-2
agent/component.c
agent/component.c
+1
-2
agent/conncheck.c
agent/conncheck.c
+496
-426
agent/conncheck.h
agent/conncheck.h
+1
-2
agent/discovery.c
agent/discovery.c
+4
-4
agent/interfaces.c
agent/interfaces.c
+2
-1
agent/pseudotcp.c
agent/pseudotcp.c
+1
-0
configure.ac
configure.ac
+0
-1
docs/reference/libnice/libnice-sections.txt
docs/reference/libnice/libnice-sections.txt
+1
-1
stun/stunmessage.c
stun/stunmessage.c
+1
-0
stun/usages/timer.h
stun/usages/timer.h
+4
-6
tests/test-nomination.c
tests/test-nomination.c
+14
-15
No files found.
agent/agent-priv.h
View file @
c8a2a789
...
@@ -106,7 +106,6 @@ nice_input_message_iter_compare (const NiceInputMessageIter *a,
...
@@ -106,7 +106,6 @@ nice_input_message_iter_compare (const NiceInputMessageIter *a,
#define NICE_AGENT_TIMER_TA_DEFAULT 20
/* timer Ta, msecs (impl. defined) */
#define NICE_AGENT_TIMER_TA_DEFAULT 20
/* timer Ta, msecs (impl. defined) */
#define NICE_AGENT_TIMER_TR_DEFAULT 25000
/* timer Tr, msecs (impl. defined) */
#define NICE_AGENT_TIMER_TR_DEFAULT 25000
/* timer Tr, msecs (impl. defined) */
#define NICE_AGENT_TIMER_TR_MIN 15000
/* timer Tr, msecs (ICE ID-19) */
#define NICE_AGENT_MAX_CONNECTIVITY_CHECKS_DEFAULT 100
/* see spec 5.7.3 (ID-19) */
#define NICE_AGENT_MAX_CONNECTIVITY_CHECKS_DEFAULT 100
/* see spec 5.7.3 (ID-19) */
#define NICE_AGENT_KEEPALIVE_DEFAULT_TIMEOUT 200
/* Start at 200ms, then doube 6 times for a total of 25.4s */
#define NICE_AGENT_KEEPALIVE_DEFAULT_TIMEOUT 200
/* Start at 200ms, then doube 6 times for a total of 25.4s */
...
@@ -154,6 +153,9 @@ struct _NiceAgent
...
@@ -154,6 +153,9 @@ struct _NiceAgent
guint
max_conn_checks
;
/* property: max connectivity checks */
guint
max_conn_checks
;
/* property: max connectivity checks */
gboolean
force_relay
;
/* property: force relay */
gboolean
force_relay
;
/* property: force relay */
gboolean
turn_short_term
;
/* property: turn short term credentials */
gboolean
turn_short_term
;
/* property: turn short term credentials */
guint
stun_max_retransmissions
;
/* property: stun max retransmissions, Rc */
guint
stun_initial_timeout
;
/* property: stun initial timeout, RTO */
guint
stun_reliable_timeout
;
/* property: stun reliable timeout */
NiceNominationMode
nomination_mode
;
/* property: Nomination mode */
NiceNominationMode
nomination_mode
;
/* property: Nomination mode */
GSList
*
local_addresses
;
/* list of NiceAddresses for local
GSList
*
local_addresses
;
/* list of NiceAddresses for local
...
...
agent/agent.c
View file @
c8a2a789
...
@@ -112,7 +112,10 @@ enum
...
@@ -112,7 +112,10 @@ enum
PROP_KEEPALIVE_CONNCHECK
,
PROP_KEEPALIVE_CONNCHECK
,
PROP_FORCE_RELAY
,
PROP_FORCE_RELAY
,
PROP_TURN_SHORT_TERM
,
PROP_TURN_SHORT_TERM
,
PROP_NOMINATION_MODE
PROP_STUN_MAX_RETRANSMISSIONS
,
PROP_STUN_INITIAL_TIMEOUT
,
PROP_STUN_RELIABLE_TIMEOUT
,
PROP_NOMINATION_MODE
,
};
};
...
@@ -436,7 +439,7 @@ nice_agent_class_init (NiceAgentClass *klass)
...
@@ -436,7 +439,7 @@ nice_agent_class_init (NiceAgentClass *klass)
* the selection of valid pairs to be used upstream.
* the selection of valid pairs to be used upstream.
* <para> See also: #NiceNominationMode </para>
* <para> See also: #NiceNominationMode </para>
*
*
* Since:
UNRELEASED
* Since:
0.1.15
*/
*/
g_object_class_install_property
(
gobject_class
,
PROP_NOMINATION_MODE
,
g_object_class_install_property
(
gobject_class
,
PROP_NOMINATION_MODE
,
g_param_spec_enum
(
g_param_spec_enum
(
...
@@ -721,6 +724,76 @@ nice_agent_class_init (NiceAgentClass *klass)
...
@@ -721,6 +724,76 @@ nice_agent_class_init (NiceAgentClass *klass)
FALSE
,
FALSE
,
G_PARAM_READWRITE
));
G_PARAM_READWRITE
));
/**
* NiceAgent:stun-max-retransmissions
*
* The maximum number of retransmissions of the STUN binding requests
* used in the gathering stage, to find our local candidates, and used
* in the connection check stage, to test the validity of each
* constructed pair. This property is described as 'Rc' in the RFC
* 5389, with a default value of 7. The timeout of each STUN request
* is doubled for each retransmission, so the choice of this value has
* a direct impact on the time needed to move from the CONNECTED state
* to the READY state, and on the time needed to complete the GATHERING
* state.
*
* Since: 0.1.15
*/
g_object_class_install_property
(
gobject_class
,
PROP_STUN_MAX_RETRANSMISSIONS
,
g_param_spec_uint
(
"stun-max-retransmissions"
,
"STUN Max Retransmissions"
,
"Maximum number of STUN binding requests retransmissions "
"described as 'Rc' in the STUN specification."
,
1
,
99
,
STUN_TIMER_DEFAULT_MAX_RETRANSMISSIONS
,
G_PARAM_READWRITE
|
G_PARAM_CONSTRUCT
));
/**
* NiceAgent:stun-initial-timeout
*
* The initial timeout (msecs) of the STUN binding requests
* used in the gathering stage, to find our local candidates.
* This property is described as 'RTO' in the RFC 5389 and RFC 5245.
* This timeout is doubled for each retransmission, until
* #NiceAgent:stun-max-retransmissions have been done,
* with an exception for the last restransmission, where the timeout is
* divided by two instead (RFC 5389 indicates that a customisable
* multiplier 'Rm' to 'RTO' should be used).
*
* Since: 0.1.15
*/
g_object_class_install_property
(
gobject_class
,
PROP_STUN_INITIAL_TIMEOUT
,
g_param_spec_uint
(
"stun-initial-timeout"
,
"STUN Initial Timeout"
,
"STUN timeout in msecs of the initial binding requests used in the "
"gathering state, described as 'RTO' in the ICE specification."
,
20
,
9999
,
STUN_TIMER_DEFAULT_TIMEOUT
,
G_PARAM_READWRITE
|
G_PARAM_CONSTRUCT
));
/**
* NiceAgent:stun-reliable-timeout
*
* The initial timeout of the STUN binding requests used
* for a reliable timer.
*
* Since: 0.1.15
*/
g_object_class_install_property
(
gobject_class
,
PROP_STUN_RELIABLE_TIMEOUT
,
g_param_spec_uint
(
"stun-reliable-timeout"
,
"STUN Reliable Timeout"
,
"STUN timeout in msecs of the initial binding requests used for "
"a reliable timer."
,
20
,
99999
,
STUN_TIMER_DEFAULT_RELIABLE_TIMEOUT
,
G_PARAM_READWRITE
|
G_PARAM_CONSTRUCT
));
/* install signals */
/* install signals */
/**
/**
...
@@ -1056,6 +1129,24 @@ nice_agent_new_regular_nomination (GMainContext *ctx, NiceCompatibility compat)
...
@@ -1056,6 +1129,24 @@ nice_agent_new_regular_nomination (GMainContext *ctx, NiceCompatibility compat)
}
}
NICEAPI_EXPORT
NiceAgent
*
nice_agent_new_full
(
GMainContext
*
ctx
,
NiceCompatibility
compat
,
NiceAgentOption
flags
)
{
NiceAgent
*
agent
=
g_object_new
(
NICE_TYPE_AGENT
,
"compatibility"
,
compat
,
"main-context"
,
ctx
,
"reliable"
,
(
flags
&
NICE_AGENT_OPTION_RELIABLE
)
?
TRUE
:
FALSE
,
"nomination-mode"
,
(
flags
&
NICE_AGENT_OPTION_REGULAR_NOMINATION
)
?
NICE_NOMINATION_MODE_REGULAR
:
NICE_NOMINATION_MODE_AGGRESSIVE
,
"full-mode"
,
(
flags
&
NICE_AGENT_OPTION_LITE_MODE
)
?
FALSE
:
TRUE
,
NULL
);
return
agent
;
}
static
void
static
void
nice_agent_get_property
(
nice_agent_get_property
(
GObject
*
object
,
GObject
*
object
,
...
@@ -1169,6 +1260,18 @@ nice_agent_get_property (
...
@@ -1169,6 +1260,18 @@ nice_agent_get_property (
g_value_set_boolean
(
value
,
agent
->
turn_short_term
);
g_value_set_boolean
(
value
,
agent
->
turn_short_term
);
break
;
break
;
case
PROP_STUN_MAX_RETRANSMISSIONS
:
g_value_set_uint
(
value
,
agent
->
stun_max_retransmissions
);
break
;
case
PROP_STUN_INITIAL_TIMEOUT
:
g_value_set_uint
(
value
,
agent
->
stun_initial_timeout
);
break
;
case
PROP_STUN_RELIABLE_TIMEOUT
:
g_value_set_uint
(
value
,
agent
->
stun_reliable_timeout
);
break
;
default:
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID
(
object
,
property_id
,
pspec
);
G_OBJECT_WARN_INVALID_PROPERTY_ID
(
object
,
property_id
,
pspec
);
}
}
...
@@ -1360,6 +1463,18 @@ nice_agent_set_property (
...
@@ -1360,6 +1463,18 @@ nice_agent_set_property (
agent
->
turn_short_term
=
g_value_get_boolean
(
value
);
agent
->
turn_short_term
=
g_value_get_boolean
(
value
);
break
;
break
;
case
PROP_STUN_MAX_RETRANSMISSIONS
:
agent
->
stun_max_retransmissions
=
g_value_get_uint
(
value
);
break
;
case
PROP_STUN_INITIAL_TIMEOUT
:
agent
->
stun_initial_timeout
=
g_value_get_uint
(
value
);
break
;
case
PROP_STUN_RELIABLE_TIMEOUT
:
agent
->
stun_reliable_timeout
=
g_value_get_uint
(
value
);
break
;
default:
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID
(
object
,
property_id
,
pspec
);
G_OBJECT_WARN_INVALID_PROPERTY_ID
(
object
,
property_id
,
pspec
);
}
}
...
@@ -3177,6 +3292,23 @@ agent_recv_message_unlocked (
...
@@ -3177,6 +3292,23 @@ agent_recv_message_unlocked (
g_free
(
big_buf
);
g_free
(
big_buf
);
}
}
if
(
!
nice_component_verify_remote_candidate
(
component
,
message
->
from
,
nicesock
))
{
if
(
nice_debug_is_verbose
())
{
gchar
str
[
INET6_ADDRSTRLEN
];
nice_address_to_string
(
message
->
from
,
str
);
nice_debug_verbose
(
"Agent %p : %d:%d DROPPING packet from unknown source"
" %s:%d sock-type: %d"
,
agent
,
stream
->
id
,
component
->
id
,
str
,
nice_address_get_port
(
message
->
from
),
nicesock
->
type
);
}
retval
=
RECV_OOB
;
goto
done
;
}
agent
->
media_after_tick
=
TRUE
;
done:
done:
/* Clear local modifications. */
/* Clear local modifications. */
if
(
message
->
from
==
&
from
)
{
if
(
message
->
from
==
&
from
)
{
...
@@ -3495,7 +3627,7 @@ nice_agent_recv_cancelled_cb (GCancellable *cancellable, gpointer user_data)
...
@@ -3495,7 +3627,7 @@ nice_agent_recv_cancelled_cb (GCancellable *cancellable, gpointer user_data)
{
{
GError
**
error
=
user_data
;
GError
**
error
=
user_data
;
if
(
error
&&
*
error
)
if
(
error
&&
!
*
error
)
g_cancellable_set_error_if_cancelled
(
cancellable
,
error
);
g_cancellable_set_error_if_cancelled
(
cancellable
,
error
);
return
G_SOURCE_REMOVE
;
return
G_SOURCE_REMOVE
;
}
}
...
@@ -4970,7 +5102,7 @@ _generate_candidate_sdp (NiceAgent *agent,
...
@@ -4970,7 +5102,7 @@ _generate_candidate_sdp (NiceAgent *agent,
g_string_append_printf
(
sdp
,
" typ %s"
,
_cand_type_to_sdp
(
candidate
->
type
));
g_string_append_printf
(
sdp
,
" typ %s"
,
_cand_type_to_sdp
(
candidate
->
type
));
if
(
nice_address_is_valid
(
&
candidate
->
base_addr
)
&&
if
(
nice_address_is_valid
(
&
candidate
->
base_addr
)
&&
!
nice_address_equal
(
&
candidate
->
addr
,
&
candidate
->
base_addr
))
{
!
nice_address_equal
(
&
candidate
->
addr
,
&
candidate
->
base_addr
))
{
port
=
nice_address_get_port
(
&
candidate
->
addr
);
port
=
nice_address_get_port
(
&
candidate
->
base_
addr
);
nice_address_to_string
(
&
candidate
->
base_addr
,
ip4
);
nice_address_to_string
(
&
candidate
->
base_addr
,
ip4
);
g_string_append_printf
(
sdp
,
" raddr %s rport %d"
,
ip4
,
g_string_append_printf
(
sdp
,
" raddr %s rport %d"
,
ip4
,
port
==
0
?
9
:
port
);
port
==
0
?
9
:
port
);
...
...
agent/agent.h
View file @
c8a2a789
...
@@ -385,7 +385,7 @@ typedef enum
...
@@ -385,7 +385,7 @@ typedef enum
* faster, than the regular mode, potentially causing the nominated
* faster, than the regular mode, potentially causing the nominated
* pair to change until the connection check completes.
* pair to change until the connection check completes.
*
*
* Since:
UNRELEASED
* Since:
0.1.15
*/
*/
typedef
enum
typedef
enum
{
{
...
@@ -393,6 +393,25 @@ typedef enum
...
@@ -393,6 +393,25 @@ typedef enum
NICE_NOMINATION_MODE_AGGRESSIVE
,
NICE_NOMINATION_MODE_AGGRESSIVE
,
}
NiceNominationMode
;
}
NiceNominationMode
;
/**
* NiceAgentOption:
* @NICE_AGENT_OPTION_REGULAR_NOMINATION: Enables regular nomination, default
* is aggrssive mode (see #NiceNominationMode).
* @NICE_AGENT_OPTION_RELIABLE: Enables reliable mode, possibly using PseudoTCP, * see nice_agent_new_reliable().
* @NICE_AGENT_OPTION_LITE_MODE: Enable lite mode
*
* These are options that can be passed to nice_agent_new_full(). They set
* various properties on the agent. Not including them sets the property to
* the other value.
*
* Since: 0.1.15
*/
typedef
enum
{
NICE_AGENT_OPTION_REGULAR_NOMINATION
=
1
<<
0
,
NICE_AGENT_OPTION_RELIABLE
=
1
<<
1
,
NICE_AGENT_OPTION_LITE_MODE
=
1
<<
2
,
}
NiceAgentOption
;
/**
/**
* NiceAgentRecvFunc:
* NiceAgentRecvFunc:
* @agent: The #NiceAgent Object
* @agent: The #NiceAgent Object
...
@@ -444,6 +463,26 @@ nice_agent_new (GMainContext *ctx, NiceCompatibility compat);
...
@@ -444,6 +463,26 @@ nice_agent_new (GMainContext *ctx, NiceCompatibility compat);
NiceAgent
*
NiceAgent
*
nice_agent_new_regular_nomination
(
GMainContext
*
ctx
,
NiceCompatibility
compat
);
nice_agent_new_regular_nomination
(
GMainContext
*
ctx
,
NiceCompatibility
compat
);
/**
* nice_agent_new_full:
* @ctx: The Glib Mainloop Context to use for timers
* @compat: The compatibility mode of the agent
* @flags: Flags to set the properties
*
* Create a new #NiceAgent with parameters that must be be defined at
* construction time.
* The returned object must be freed with g_object_unref()
* <para> See also: #NiceNominationMode and #NiceAgentOption</para>
*
* Since: 0.1.15
*
* Returns: The new agent GObject
*/
NiceAgent
*
nice_agent_new_full
(
GMainContext
*
ctx
,
NiceCompatibility
compat
,
NiceAgentOption
flags
);
/**
/**
* nice_agent_add_local_address:
* nice_agent_add_local_address:
* @agent: The #NiceAgent Object
* @agent: The #NiceAgent Object
...
@@ -463,7 +502,6 @@ nice_agent_new_regular_nomination (GMainContext *ctx, NiceCompatibility compat);
...
@@ -463,7 +502,6 @@ nice_agent_new_regular_nomination (GMainContext *ctx, NiceCompatibility compat);
gboolean
gboolean
nice_agent_add_local_address
(
NiceAgent
*
agent
,
NiceAddress
*
addr
);
nice_agent_add_local_address
(
NiceAgent
*
agent
,
NiceAddress
*
addr
);
/**
/**
* nice_agent_add_stream:
* nice_agent_add_stream:
* @agent: The #NiceAgent Object
* @agent: The #NiceAgent Object
...
...
agent/component.c
View file @
c8a2a789
...
@@ -1081,7 +1081,6 @@ nice_component_class_init (NiceComponentClass *klass)
...
@@ -1081,7 +1081,6 @@ nice_component_class_init (NiceComponentClass *klass)
G_PARAM_READWRITE
|
G_PARAM_CONSTRUCT_ONLY
));
G_PARAM_READWRITE
|
G_PARAM_CONSTRUCT_ONLY
));
}
}
static
gboolean
static
gboolean
dummy_callback
(
gpointer
data
)
dummy_callback
(
gpointer
data
)
{
{
...
@@ -1670,7 +1669,7 @@ nice_component_add_valid_candidate (NiceComponent *component,
...
@@ -1670,7 +1669,7 @@ nice_component_add_valid_candidate (NiceComponent *component,
char
str
[
INET6_ADDRSTRLEN
];
char
str
[
INET6_ADDRSTRLEN
];
nice_address_to_string
(
&
candidate
->
addr
,
str
);
nice_address_to_string
(
&
candidate
->
addr
,
str
);
nice_debug
(
"Agent %p : %d:%d Adding valid source"
nice_debug
(
"Agent %p : %d:%d Adding valid source"
" candidate: %s:%d trans: %d
\n
"
,
component
->
agent
,
" candidate: %s:%d trans: %d"
,
component
->
agent
,
candidate
->
stream_id
,
candidate
->
component_id
,
str
,
candidate
->
stream_id
,
candidate
->
component_id
,
str
,
nice_address_get_port
(
&
candidate
->
addr
),
candidate
->
transport
);
nice_address_get_port
(
&
candidate
->
addr
),
candidate
->
transport
);
}
}
...
...
agent/conncheck.c
View file @
c8a2a789
This diff is collapsed.
Click to expand it.
agent/conncheck.h
View file @
c8a2a789
...
@@ -87,8 +87,7 @@ struct _CandidateCheckPair
...
@@ -87,8 +87,7 @@ struct _CandidateCheckPair
gboolean
use_candidate_on_next_check
;
gboolean
use_candidate_on_next_check
;
gboolean
mark_nominated_on_response_arrival
;
gboolean
mark_nominated_on_response_arrival
;
gboolean
recheck_on_timeout
;
gboolean
recheck_on_timeout
;
guint
recheck_on_timeout_count
;
gboolean
retransmit_on_timeout
;
gboolean
stop_retransmit_on_timeout
;
struct
_CandidateCheckPair
*
discovered_pair
;
struct
_CandidateCheckPair
*
discovered_pair
;
struct
_CandidateCheckPair
*
succeeded_pair
;
struct
_CandidateCheckPair
*
succeeded_pair
;
guint64
priority
;
guint64
priority
;
...
...
agent/discovery.c
View file @
c8a2a789
...
@@ -1072,11 +1072,11 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
...
@@ -1072,11 +1072,11 @@ static gboolean priv_discovery_tick_unlocked (gpointer pointer)
if
(
buffer_len
>
0
)
{
if
(
buffer_len
>
0
)
{
if
(
nice_socket_is_reliable
(
cand
->
nicesock
))
{
if
(
nice_socket_is_reliable
(
cand
->
nicesock
))
{
stun_timer_start_reliable
(
&
cand
->
timer
,
stun_timer_start_reliable
(
&
cand
->
timer
,
agent
->
stun_reliable_timeout
);
STUN_TIMER_DEFAULT_RELIABLE_TIMEOUT
);
}
else
{
}
else
{
stun_timer_start
(
&
cand
->
timer
,
100
,
stun_timer_start
(
&
cand
->
timer
,
STUN_TIMER_DEFAULT_MAX_RETRANSMISSIONS
);
agent
->
stun_initial_timeout
,
agent
->
stun_max_retransmissions
);
}
}
/* send the conncheck */
/* send the conncheck */
...
...
agent/interfaces.c
View file @
c8a2a789
...
@@ -278,7 +278,8 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
...
@@ -278,7 +278,8 @@ nice_interfaces_get_local_ips (gboolean include_loopback)
}
}
#ifdef IGNORED_IFACE_PREFIX
#ifdef IGNORED_IFACE_PREFIX
}
else
if
(
g_str_has_prefix
(
ifa
->
ifa_name
,
IGNORED_IFACE_PREFIX
))
{
}
else
if
(
g_str_has_prefix
(
ifa
->
ifa_name
,
IGNORED_IFACE_PREFIX
))
{
nice_debug
(
"Ignoring %s interface"
,
ifa
->
ifa_name
);
nice_debug
(
"Ignoring interface %s as it matches prefix %s"
,
ifa
->
ifa_name
,
IGNORED_IFACE_PREFIX
);
g_free
(
addr_string
);
g_free
(
addr_string
);
#endif
#endif
}
else
{
}
else
{
...
...
agent/pseudotcp.c
View file @
c8a2a789
...
@@ -933,6 +933,7 @@ pseudo_tcp_socket_set_property (GObject *object,
...
@@ -933,6 +933,7 @@ pseudo_tcp_socket_set_property (GObject *object,
PseudoTcpCallbacks
*
c
=
g_value_get_pointer
(
value
);
PseudoTcpCallbacks
*
c
=
g_value_get_pointer
(
value
);
self
->
priv
->
callbacks
=
*
c
;
self
->
priv
->
callbacks
=
*
c
;
}
}
break
;
case
PROP_BASE_SOCKET
:
case
PROP_BASE_SOCKET
:
g_assert
(
self
->
priv
->
base_socket
==
NULL
);
g_assert
(
self
->
priv
->
base_socket
==
NULL
);
self
->
priv
->
base_socket
=
g_value_dup_object
(
value
);
self
->
priv
->
base_socket
=
g_value_dup_object
(
value
);
...
...
configure.ac
View file @
c8a2a789
...
@@ -154,7 +154,6 @@ AS_IF([test "$enable_compile_warnings" = "yes" -o \
...
@@ -154,7 +154,6 @@ AS_IF([test "$enable_compile_warnings" = "yes" -o \
])
])
AS_IF([test "$enable_compile_warnings" = "maximum" -o \
AS_IF([test "$enable_compile_warnings" = "maximum" -o \
"$enable_compile_warnings" = "error"],[
"$enable_compile_warnings" = "error"],[
NICE_ADD_FLAG([-Wswitch-enum])
NICE_ADD_FLAG([-Wswitch-default])
NICE_ADD_FLAG([-Wswitch-default])
NICE_ADD_FLAG([-Waggregate-return])
NICE_ADD_FLAG([-Waggregate-return])
])
])
...
...
docs/reference/libnice/libnice-sections.txt
View file @
c8a2a789
...
@@ -13,7 +13,7 @@ NiceOutputMessage
...
@@ -13,7 +13,7 @@ NiceOutputMessage
NICE_AGENT_MAX_REMOTE_CANDIDATES
NICE_AGENT_MAX_REMOTE_CANDIDATES
nice_agent_new
nice_agent_new
nice_agent_new_reliable
nice_agent_new_reliable
nice_agent_new_
regular_nomination
nice_agent_new_
full
nice_agent_add_local_address
nice_agent_add_local_address
nice_agent_set_port_range
nice_agent_set_port_range
nice_agent_add_stream
nice_agent_add_stream
...
...
stun/stunmessage.c
View file @
c8a2a789
...
@@ -120,6 +120,7 @@ stun_message_find (const StunMessage *msg, StunAttribute type,
...
@@ -120,6 +120,7 @@ stun_message_find (const StunMessage *msg, StunAttribute type,
/* Only fingerprint may come after M-I */
/* Only fingerprint may come after M-I */
if
(
type
==
STUN_ATTRIBUTE_FINGERPRINT
)
if
(
type
==
STUN_ATTRIBUTE_FINGERPRINT
)
break
;
break
;
return
NULL
;
case
STUN_ATTRIBUTE_FINGERPRINT
:
case
STUN_ATTRIBUTE_FINGERPRINT
:
/* Nothing may come after FPR */
/* Nothing may come after FPR */
...
...
stun/usages/timer.h
View file @
c8a2a789
...
@@ -133,12 +133,10 @@ struct stun_timer_s {
...
@@ -133,12 +133,10 @@ struct stun_timer_s {
* RFC recommendds 500, but it's ridiculous, 50ms is known to work in most
* RFC recommendds 500, but it's ridiculous, 50ms is known to work in most
* cases as it is also what is used by SIP style VoIP when sending A-Law and
* cases as it is also what is used by SIP style VoIP when sending A-Law and
* mu-Law audio, so 200ms should be hyper safe. With an initial timeout
* mu-Law audio, so 200ms should be hyper safe. With an initial timeout
* of 200ms, a default of 5 transmissions, the last timeout will be
* of 200ms, a default of 7 transmissions, the last timeout will be
* 4 * 200ms, and we expect to receive a response from the stun server
* 16 * 200ms, and we expect to receive a response from the stun server
* before (1 + 2 + 4 + 8 + 4) * 200ms = 3800 ms after the initial
* before (1 + 2 + 4 + 8 + 16 + 32 + 16) * 200ms = 15200 ms after the initial
* stun request t1 has been sent:
* stun request has been sent.
*
* t1 ..200ms.. t2 ..400ms.. t3 ..800ms.. t4 ..1600ms.. t5 ..800ms.. X
*/
*/
#define STUN_TIMER_DEFAULT_TIMEOUT 200
#define STUN_TIMER_DEFAULT_TIMEOUT 200
...
...
tests/test-nomination.c
View file @
c8a2a789
...
@@ -121,7 +121,8 @@ static void set_credentials (NiceAgent *lagent, guint lstream,
...
@@ -121,7 +121,8 @@ static void set_credentials (NiceAgent *lagent, guint lstream,
}
}
static
void
static
void
run_test
(
gboolean
l_regular_nomination
,
gboolean
r_regular_nomination
)
run_test
(
NiceNominationMode
l_nomination_mode
,
NiceNominationMode
r_nomination_mode
)
{
{
NiceAgent
*
lagent
,
*
ragent
;
/* agent's L and R */
NiceAgent
*
lagent
,
*
ragent
;
/* agent's L and R */
const
gchar
*
localhost
;
const
gchar
*
localhost
;
...
@@ -137,17 +138,15 @@ run_test(gboolean l_regular_nomination, gboolean r_regular_nomination)
...
@@ -137,17 +138,15 @@ run_test(gboolean l_regular_nomination, gboolean r_regular_nomination)
global_ragent_gathering_done
=
FALSE
;
global_ragent_gathering_done
=
FALSE
;
global_lagent_cands
=
global_ragent_cands
=
0
;
global_lagent_cands
=
global_ragent_cands
=
0
;
if
(
l_regular_nomination
)
lagent
=
nice_agent_new_full
(
NULL
,
lagent
=
nice_agent_new_regular_nomination
(
NULL
,
NICE_COMPATIBILITY_RFC5245
,
NICE_COMPATIBILITY_RFC5245
);
l_nomination_mode
==
NICE_NOMINATION_MODE_REGULAR
?
else
NICE_AGENT_OPTION_REGULAR_NOMINATION
:
0
);
lagent
=
nice_agent_new
(
NULL
,
NICE_COMPATIBILITY_RFC5245
);
if
(
r_regular_nomination
)
ragent
=
nice_agent_new_full
(
NULL
,
ragent
=
nice_agent_new_regular_nomination
(
NULL
,
NICE_COMPATIBILITY_RFC5245
,
NICE_COMPATIBILITY_RFC5245
);
r_nomination_mode
==
NICE_NOMINATION_MODE_REGULAR
?
else
NICE_AGENT_OPTION_REGULAR_NOMINATION
:
0
);
ragent
=
nice_agent_new
(
NULL
,
NICE_COMPATIBILITY_RFC5245
);
g_object_set
(
G_OBJECT
(
lagent
),
"ice-tcp"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
lagent
),
"ice-tcp"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
ragent
),
"ice-tcp"
,
FALSE
,
NULL
);
g_object_set
(
G_OBJECT
(
ragent
),
"ice-tcp"
,
FALSE
,
NULL
);
...
@@ -225,25 +224,25 @@ run_test(gboolean l_regular_nomination, gboolean r_regular_nomination)
...
@@ -225,25 +224,25 @@ run_test(gboolean l_regular_nomination, gboolean r_regular_nomination)
static
void
static
void
regular
(
void
)
regular
(
void
)
{
{
run_test
(
TRUE
/* l_regular_nomination */
,
TRUE
/* r_regular_nomination */
);
run_test
(
NICE_NOMINATION_MODE_REGULAR
,
NICE_NOMINATION_MODE_REGULAR
);
}
}
static
void
static
void
aggressive
(
void
)
aggressive
(
void
)
{
{
run_test
(
FALSE
/* l_regular_nomination */
,
FALSE
/* r_regular_nomination */
);
run_test
(
NICE_NOMINATION_MODE_AGGRESSIVE
,
NICE_NOMINATION_MODE_AGGRESSIVE
);
}
}
static
void
static
void
mixed_ra
(
void
)
mixed_ra
(
void
)
{
{
run_test
(
TRUE
/* l_regular_nomination */
,
FALSE
/* r_regular_nomination */
);
run_test
(
NICE_NOMINATION_MODE_REGULAR
,
NICE_NOMINATION_MODE_AGGRESSIVE
);
}
}
static
void
static
void
mixed_ar
(
void
)
mixed_ar
(
void
)
{
{
run_test
(
FALSE
/* l_regular_nomination */
,
TRUE
/* r_regular_nomination */
);
run_test
(
NICE_NOMINATION_MODE_AGGRESSIVE
,
NICE_NOMINATION_MODE_REGULAR
);
}
}
int
int
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment