summaryrefslogtreecommitdiff
path: root/socket/tcp-bsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'socket/tcp-bsd.c')
-rw-r--r--socket/tcp-bsd.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/socket/tcp-bsd.c b/socket/tcp-bsd.c
index 8f3ac89..49f5f25 100644
--- a/socket/tcp-bsd.c
+++ b/socket/tcp-bsd.c
@@ -46,6 +46,8 @@
#include "agent-priv.h"
#include "socket-priv.h"
+#include "tcp-passive.h"
+
#include <string.h>
#include <errno.h>
#include <fcntl.h>
@@ -70,6 +72,7 @@ typedef struct {
gboolean reliable;
NiceSocketWritableCb writable_cb;
gpointer writable_data;
+ NiceSocket *passive_parent;
} TcpPriv;
#define MAX_QUEUE_LENGTH 20
@@ -226,6 +229,10 @@ socket_close (NiceSocket *sock)
g_source_unref (priv->io_source);
}
+ if (priv->passive_parent) {
+ nice_tcp_passive_socket_remove_connection (priv->passive_parent, &priv->remote_addr);
+ }
+
nice_socket_free_send_queue (&priv->send_queue);
if (priv->context)
@@ -458,3 +465,13 @@ socket_send_more (
g_mutex_unlock (&mutex);
return TRUE;
}
+
+void
+nice_tcp_bsd_socket_set_passive_parent (NiceSocket *sock, NiceSocket *passive_parent)
+{
+ TcpPriv *priv = sock->priv;
+
+ g_assert (priv->passive_parent == NULL);
+
+ priv->passive_parent = passive_parent;
+}