summaryrefslogtreecommitdiff
path: root/socket/tcp-passive.c
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2014-05-17 15:57:15 +0900
committerOlivier CrĂȘte <olivier.crete@collabora.com>2014-05-17 15:57:15 +0900
commit18e5dff4f25b12522e857c13d3ef3bdb40212246 (patch)
treeb7c9680611d54f953545d28c9068e22540fc7689 /socket/tcp-passive.c
parent3507e95c00b5efdc07ca6cb079e79f17270e5dd5 (diff)
downloadlibnice-18e5dff4f25b12522e857c13d3ef3bdb40212246.tar.gz
agent: Separate reliability from ice-tcp vs ice-udp
We want ICE-TCP to not have reliable behavior unless the agent is reliable otherwise it will confuse existing VoIP applications.
Diffstat (limited to 'socket/tcp-passive.c')
-rw-r--r--socket/tcp-passive.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/socket/tcp-passive.c b/socket/tcp-passive.c
index 2eb05dd..eeda236 100644
--- a/socket/tcp-passive.c
+++ b/socket/tcp-passive.c
@@ -51,6 +51,8 @@
#endif
typedef struct {
+ gboolean reliable;
+
GMainContext *context;
GHashTable *connections;
NiceSocketWritableCb writable_cb;
@@ -75,7 +77,8 @@ static void _set_child_callbacks (NiceAddress *addr, NiceSocket *child,
NiceSocket *sock);
NiceSocket *
-nice_tcp_passive_socket_new (GMainContext *ctx, NiceAddress *addr)
+nice_tcp_passive_socket_new (GMainContext *ctx, NiceAddress *addr,
+ gboolean reliable)
{
union {
struct sockaddr_storage storage;
@@ -149,6 +152,7 @@ nice_tcp_passive_socket_new (GMainContext *ctx, NiceAddress *addr)
nice_address_set_from_sockaddr (&sock->addr, &name.addr);
sock->priv = priv = g_slice_new0 (TcpPassivePriv);
+ priv->reliable = reliable;
priv->context = g_main_context_ref (ctx);
priv->connections = g_hash_table_new_full ((GHashFunc) nice_address_hash,
(GEqualFunc) nice_address_equal, (
@@ -217,7 +221,9 @@ static gint socket_send_messages_reliable (NiceSocket *sock,
static gboolean
socket_is_reliable (NiceSocket *sock)
{
- return TRUE;
+ TcpPassivePriv *priv = sock->priv;
+
+ return priv->reliable;
}
static gboolean