aboutsummaryrefslogtreecommitdiff
path: root/src/util/server_nc.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-01-22 14:24:54 +0000
committerChristian Grothoff <christian@grothoff.org>2010-01-22 14:24:54 +0000
commitc63469ee499f04fe1ca503f71815dd4a3737a03d (patch)
treee46a912b18cdf534e4976fcfbea26dc17e6fe6f5 /src/util/server_nc.c
parent0bcccf6577555ed605e12a02ee09ffa8595b8a51 (diff)
downloadgnunet-c63469ee499f04fe1ca503f71815dd4a3737a03d.tar.gz
gnunet-c63469ee499f04fe1ca503f71815dd4a3737a03d.zip
drop
Diffstat (limited to 'src/util/server_nc.c')
-rw-r--r--src/util/server_nc.c27
1 files changed, 27 insertions, 0 deletions
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 @@
33#include "gnunet_time_lib.h" 33#include "gnunet_time_lib.h"
34 34
35 35
36/**
37 * Entry in list of messages pending to be transmitted.
38 */
36struct PendingMessageList 39struct PendingMessageList
37{ 40{
38 41
42 /**
43 * This is a linked list.
44 */
39 struct PendingMessageList *next; 45 struct PendingMessageList *next;
40 46
47 /**
48 * Message to transmit (allocated at the end of this
49 * struct, do not free)
50 */
41 const struct GNUNET_MessageHeader *msg; 51 const struct GNUNET_MessageHeader *msg;
42 52
53 /**
54 * Can this message be dropped?
55 */
43 int can_drop; 56 int can_drop;
44 57
45}; 58};
46 59
47 60
61/**
62 * Lists of clients we manage for notifications.
63 */
48struct ClientList 64struct ClientList
49{ 65{
50 66
67 /**
68 * This is a linked list.
69 */
51 struct ClientList *next; 70 struct ClientList *next;
52 71
72 /**
73 * Overall context this client belongs to.
74 */
53 struct GNUNET_SERVER_NotificationContext *nc; 75 struct GNUNET_SERVER_NotificationContext *nc;
54 76
77 /**
78 * Handle to the client.
79 */
55 struct GNUNET_SERVER_Client *client; 80 struct GNUNET_SERVER_Client *client;
56 81
57 struct GNUNET_CONNECTION_TransmitHandle *th; 82 struct GNUNET_CONNECTION_TransmitHandle *th;
@@ -114,6 +139,7 @@ handle_client_disconnect (void *cls,
114 pos->pending_head = pml->next; 139 pos->pending_head = pml->next;
115 GNUNET_free (pml); 140 GNUNET_free (pml);
116 } 141 }
142 GNUNET_SERVER_client_drop (client);
117 GNUNET_free (pos); 143 GNUNET_free (pos);
118} 144}
119 145
@@ -189,6 +215,7 @@ GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext
189 cl->next = nc->clients; 215 cl->next = nc->clients;
190 cl->nc = nc; 216 cl->nc = nc;
191 cl->client = client; 217 cl->client = client;
218 GNUNET_SERVER_client_keep (client);
192 nc->clients = cl; 219 nc->clients = cl;
193} 220}
194 221