summaryrefslogtreecommitdiff
path: root/socket/http.c
diff options
context:
space:
mode:
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);
+}