diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-01-22 14:26:36 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-01-22 14:26:36 +0000 |
commit | 3ad6fdfaa9241a9620d73668c273a0f05f7174b3 (patch) | |
tree | a6638e02676491e748fd5ab1716a76e96dff1173 /src/util/server_nc.c | |
parent | c63469ee499f04fe1ca503f71815dd4a3737a03d (diff) |
count
Diffstat (limited to 'src/util/server_nc.c')
-rw-r--r-- | src/util/server_nc.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/util/server_nc.c b/src/util/server_nc.c index e7d4dadd13..e2c74a7e92 100644 --- a/src/util/server_nc.c +++ b/src/util/server_nc.c @@ -79,12 +79,24 @@ struct ClientList */ struct GNUNET_SERVER_Client *client; + /** + * Handle for pending transmission request to the client (or NULL). + */ struct GNUNET_CONNECTION_TransmitHandle *th; + /** + * Head of linked list of requests queued for transmission. + */ struct PendingMessageList *pending_head; + /** + * Tail of linked list of requests queued for transmission. + */ struct PendingMessageList *pending_tail; + /** + * Number of messages currently in the list. + */ unsigned int num_pending; }; @@ -101,10 +113,19 @@ struct ClientList struct GNUNET_SERVER_NotificationContext { + /** + * Server we do notifications for. + */ struct GNUNET_SERVER_Handle *server; + /** + * List of clients receiving notifications. + */ struct ClientList *clients; + /** + * Maximum number of optional messages to queue per client. + */ unsigned int queue_length; }; @@ -261,6 +282,7 @@ transmit_message (void *cls, ret += msize; size -= msize; GNUNET_free (pml); + cl->num_pending--; } if (cl->pending_head != NULL) cl->th = GNUNET_SERVER_notify_transmit_ready (cl->client, @@ -297,6 +319,7 @@ do_unicast (struct GNUNET_SERVER_NotificationContext *nc, /* FIXME: consider checking for other messages in the queue that are 'droppable' */ } + client->num_pending++; size = ntohs (msg->size); pml = GNUNET_malloc (sizeof (struct PendingMessageList) + size); pml->msg = (const struct GNUNET_MessageHeader*) &pml[1]; |