summaryrefslogtreecommitdiff
path: root/socket/http.c
diff options
context:
space:
mode:
authorJakub Adam <jakub.adam@ktknet.cz>2015-09-11 11:29:39 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2015-09-11 11:30:23 +0100
commit837c8953fe87bdd5d5bccc444e72739100578ef8 (patch)
treed5c4af28aee37f5b08245bda48fc89746b06aa9e /socket/http.c
parentc6bc33c031493e0db11a1f57055a656f6428c60a (diff)
downloadlibnice-837c8953fe87bdd5d5bccc444e72739100578ef8.tar.gz
socket: add nice_socket_is_base_of()
This will be used in the next commit. Maniphest Tasks: T114 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Differential Revision: https://phabricator.freedesktop.org/D240
Diffstat (limited to 'socket/http.c')
-rw-r--r--socket/http.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/socket/http.c b/socket/http.c
index 404d378..3df3be4 100644
--- a/socket/http.c
+++ b/socket/http.c
@@ -95,6 +95,7 @@ static gboolean socket_is_reliable (NiceSocket *sock);
static gboolean socket_can_send (NiceSocket *sock, NiceAddress *addr);
static void socket_set_writable_callback (NiceSocket *sock,
NiceSocketWritableCb callback, gpointer user_data);
+static gboolean socket_is_base_of (NiceSocket *sock, NiceSocket *other);
NiceSocket *
nice_http_socket_new (NiceSocket *base_socket,
@@ -126,6 +127,7 @@ nice_http_socket_new (NiceSocket *base_socket,
sock->is_reliable = socket_is_reliable;
sock->can_send = socket_can_send;
sock->set_writable_callback = socket_set_writable_callback;
+ sock->is_base_of = socket_is_base_of;
sock->close = socket_close;
/* Send HTTP CONNECT */
@@ -642,3 +644,11 @@ socket_set_writable_callback (NiceSocket *sock,
nice_socket_set_writable_callback (priv->base_socket, callback, user_data);
}
+
+static gboolean
+socket_is_base_of (NiceSocket *sock, NiceSocket *other)
+{
+ HttpPriv *priv = other->priv;
+
+ return (sock == other) || nice_socket_is_base_of (sock, priv->base_socket);
+}