summaryrefslogtreecommitdiff
path: root/socket/socks5.c
diff options
context:
space:
mode:
Diffstat (limited to 'socket/socks5.c')
-rw-r--r--socket/socks5.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/socket/socks5.c b/socket/socks5.c
index 46d17fb..0603cad 100644
--- a/socket/socks5.c
+++ b/socket/socks5.c
@@ -81,6 +81,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 *
@@ -108,6 +109,7 @@ nice_socks5_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 SOCKS5 handshake */
@@ -488,3 +490,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)
+{
+ Socks5Priv *priv = other->priv;
+
+ return (sock == other) || nice_socket_is_base_of (sock, priv->base_socket);
+}