From c63469ee499f04fe1ca503f71815dd4a3737a03d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 22 Jan 2010 14:24:54 +0000 Subject: drop --- src/util/server_nc.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/util/server_nc.c') diff --git a/src/util/server_nc.c b/src/util/server_nc.c index e9c2f5a38..e7d4dadd1 100644 --- a/src/util/server_nc.c +++ b/src/util/server_nc.c @@ -33,25 +33,50 @@ #include "gnunet_time_lib.h" +/** + * Entry in list of messages pending to be transmitted. + */ struct PendingMessageList { + /** + * This is a linked list. + */ struct PendingMessageList *next; + /** + * Message to transmit (allocated at the end of this + * struct, do not free) + */ const struct GNUNET_MessageHeader *msg; + /** + * Can this message be dropped? + */ int can_drop; }; +/** + * Lists of clients we manage for notifications. + */ struct ClientList { + /** + * This is a linked list. + */ struct ClientList *next; + /** + * Overall context this client belongs to. + */ struct GNUNET_SERVER_NotificationContext *nc; + /** + * Handle to the client. + */ struct GNUNET_SERVER_Client *client; struct GNUNET_CONNECTION_TransmitHandle *th; @@ -114,6 +139,7 @@ handle_client_disconnect (void *cls, pos->pending_head = pml->next; GNUNET_free (pml); } + GNUNET_SERVER_client_drop (client); GNUNET_free (pos); } @@ -189,6 +215,7 @@ GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext cl->next = nc->clients; cl->nc = nc; cl->client = client; + GNUNET_SERVER_client_keep (client); nc->clients = cl; } -- cgit v1.2.3