[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r11009 - in gnunet: . src/peerinfo
From: |
gnunet |
Subject: |
[GNUnet-SVN] r11009 - in gnunet: . src/peerinfo |
Date: |
Wed, 21 Apr 2010 15:21:39 +0200 |
Author: grothoff
Date: 2010-04-21 15:21:39 +0200 (Wed, 21 Apr 2010)
New Revision: 11009
Modified:
gnunet/TODO
gnunet/src/peerinfo/peerinfo_api.c
Log:
docu
Modified: gnunet/TODO
===================================================================
--- gnunet/TODO 2010-04-21 13:00:22 UTC (rev 11008)
+++ gnunet/TODO 2010-04-21 13:21:39 UTC (rev 11009)
@@ -1,9 +1,9 @@
0.9.0pre1:
* PEERINFO: [CG]
- - trust: need *fast* way to check/update trust in peers
- (async peerinfo would not be right; certainly not with the current
API)
-* TOPOLOGY: [CG]
- - needs more testing (especially F2F topology) & transport blacklisting
+ - finish implementing NEW API (cancel, timeout, submit-during-receive
prevention)
+ - test new API
+ - transition existing code to new API
+ - remove support for old API
* FS: [CG]
- support recursive download even if filename is NULL and we hence
do not generate files on disk (use temp_filename)
@@ -31,7 +31,9 @@
- implement DV library (looks done)
- implement DV transport plugin
- implement testcases
- - implement performance tests
+ - implement performance tests (needs tbench)
+* TOPOLOGY:
+ - needs more testing (especially F2F topology) & transport blacklisting
* UTIL:
- only connect() sockets that are ready (select()) [Nils]
[On W32, we need to select after calling socket before doing connect etc.]
Modified: gnunet/src/peerinfo/peerinfo_api.c
===================================================================
--- gnunet/src/peerinfo/peerinfo_api.c 2010-04-21 13:00:22 UTC (rev 11008)
+++ gnunet/src/peerinfo/peerinfo_api.c 2010-04-21 13:21:39 UTC (rev 11009)
@@ -27,6 +27,7 @@
* - document NEW API implementation
* - add timeout for iteration
* - implement cancellation of iteration
+ * - prevent transmit during receive!
*/
#include "platform.h"
#include "gnunet_client_lib.h"
@@ -37,44 +38,48 @@
#include "peerinfo.h"
/**
- *
+ * Function to call after transmission has succeeded.
+ *
+ * @param cls closure
+ * @param success GNUNET_OK if transmission worked, GNUNET_SYSERR on error
*/
typedef void (*TransmissionContinuation)(void *cls,
int success);
/**
- *
+ * Entry in the transmission queue to PEERINFO service.
*/
struct TransmissionQueueEntry
{
/**
- *
+ * This is a linked list.
*/
struct TransmissionQueueEntry *next;
/**
- *
+ * This is a linked list.
*/
struct TransmissionQueueEntry *prev;
/**
- *
+ * Function to call after request has been transmitted, or NULL (in which
+ * case we must consider sending the next entry immediately).
*/
TransmissionContinuation cont;
/**
- *
+ * Closure for 'cont'.
*/
void *cont_cls;
/**
- *
+ * When this request times out.
*/
struct GNUNET_TIME_Absolute timeout;
/**
- *
+ * Number of bytes of the request message (follows after this struct).
*/
size_t size;
@@ -102,19 +107,20 @@
struct GNUNET_CLIENT_Connection *client;
/**
- *
+ * Head of transmission queue.
*/
struct TransmissionQueueEntry *tq_head;
/**
- *
+ * Tail of transmission queue.
*/
struct TransmissionQueueEntry *tq_tail;
/**
- *
+ * Handle for the current transmission request, or NULL if none is pending.
*/
struct GNUNET_CLIENT_TransmitHandle *th;
+
};
@@ -173,14 +179,19 @@
/**
+ * Check if we have a request pending in the transmission queue and are
+ * able to transmit it right now. If so, schedule transmission.
*
+ * @param h handle to the service
*/
static void
trigger_transmit (struct GNUNET_PEERINFO_Handle *h);
/**
+ * Close the existing connection to PEERINFO and reconnect.
*
+ * @param h handle to the service
*/
static void
reconnect (struct GNUNET_PEERINFO_Handle *h)
@@ -192,7 +203,13 @@
/**
+ * Transmit the request at the head of the transmission queue
+ * and trigger continuation (if any).
*
+ * @param cls the 'struct GNUNET_PEERINFO_Handle' (with the queue)
+ * @param size size of the buffer (0 on error)
+ * @param buf where to copy the message
+ * @return number of bytes copied to buf
*/
static size_t
do_transmit (void *cls, size_t size, void *buf)
@@ -235,11 +252,19 @@
}
+/**
+ * Check if we have a request pending in the transmission queue and are
+ * able to transmit it right now. If so, schedule transmission.
+ *
+ * @param h handle to the service
+ */
static void
trigger_transmit (struct GNUNET_PEERINFO_Handle *h)
{
struct TransmissionQueueEntry *tqe;
+ /* FIXME: need to handle case where we are still *receiving* (and then
+ do nothing here as well!) */
if (NULL == (tqe = h->tq_head))
return;
if (h->th != NULL)
@@ -292,35 +317,33 @@
}
-
/**
- *
+ * Context for an iteration request.
*/
struct GNUNET_PEERINFO_NewIteratorContext
{
/**
- *
+ * Handle to the PEERINFO service.
*/
struct GNUNET_PEERINFO_Handle *h;
/**
- *
+ * Function to call with the results.
*/
GNUNET_PEERINFO_Processor callback;
/**
- *
+ * Closure for 'callback'.
*/
void *callback_cls;
/**
- *
+ * Timeout for the operation.
*/
struct GNUNET_TIME_Absolute timeout;
};
-
/**
* Type of a function to call when we receive a message
* from the service.
@@ -400,7 +423,11 @@
/**
+ * We've transmitted the iteration request. Now get ready to process
+ * the results (or handle transmission error).
*
+ * @param cls the 'struct GNUNET_PEERINFO_NewIteratorContext'
+ * @param transmit_success GNUNET_OK if transmission worked
*/
static void
iterator_start_receive (void *cls,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r11009 - in gnunet: . src/peerinfo,
gnunet <=