gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14378 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r14378 - gnunet/src/fs
Date: Tue, 8 Feb 2011 23:57:06 +0100

Author: grothoff
Date: 2011-02-08 23:57:06 +0100 (Tue, 08 Feb 2011)
New Revision: 14378

Modified:
   gnunet/src/fs/gnunet-service-fs_pr.c
   gnunet/src/fs/gnunet-service-fs_pr.h
Log:
stuff

Modified: gnunet/src/fs/gnunet-service-fs_pr.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.c        2011-02-08 16:27:57 UTC (rev 
14377)
+++ gnunet/src/fs/gnunet-service-fs_pr.c        2011-02-08 22:57:06 UTC (rev 
14378)
@@ -28,6 +28,38 @@
 
 
 /**
+ * An active request.
+ */
+struct GSF_PendingRequest
+{
+  /**
+   * Public data for the request.
+   */ 
+  struct GSF_PendingRequestData public_data;
+
+  GSF_PendingRequestReplyHandler rh;
+
+  void *rh_cls;
+
+  const GNUNET_HashCode *replies_seen;
+
+  struct GNUNET_CONTAINER_BloomFilter *bf;
+
+  unsigned int replies_seen_count;
+
+  int32_t mingle;
+                           
+};
+
+
+/**
+ * All pending requests, ordered by the query.  Entries
+ * are of type 'struct GSF_PendingRequest*'.
+ */
+static struct GNUNET_CONTAINER_MultiHashMap *requests;
+
+
+/**
  * Create a new pending request.  
  *
  * @param options request options
@@ -51,7 +83,7 @@
                             const GNUNET_HashCode *query,
                             const GNUNET_HashCode *namespace,
                             const struct GNUNET_PeerIdentity *target,
-                            struct GNUNET_CONTAINER_BloomFilter *bf,
+                            const struct GNUNET_CONTAINER_BloomFilter *bf,
                             int32_t mingle,
                             uint32_t anonymity_level,
                             uint32_t priority,

Modified: gnunet/src/fs/gnunet-service-fs_pr.h
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.h        2011-02-08 16:27:57 UTC (rev 
14377)
+++ gnunet/src/fs/gnunet-service-fs_pr.h        2011-02-08 22:57:06 UTC (rev 
14378)
@@ -63,10 +63,61 @@
      * Option mask for typical local requests.
      */
     GSF_PRO_LOCAL_REQUEST = (GSF_PRO_BLOOMFILTER_FULL_REFRESH | 
GSF_PRO_PRIORITY_UNLIMITED)
+
   };
 
 
 /**
+ * Public data associated with each pending request.
+ */
+struct GSF_PendingRequestData
+{
+
+  /**
+   * Primary query hash for this request.
+   */
+  GNUNET_HashCode query;
+
+  /**
+   * Namespace to query, only set if the type is SBLOCK.
+   */
+  GNUNET_HashCode namespace;
+                       
+  /**
+   * Identity of a peer hosting the content, only set if
+   * 'has_target' is GNUNET_YES.
+   */
+  struct GNUNET_PeerIdentity target;
+
+  /**
+   * Desired anonymity level.
+   */
+  uint32_t anonymity_level;
+
+  /**
+   * Priority that this request (still) has for us.
+   */
+  uint32_t priority;
+
+  /**
+   * Options for the request.
+   */
+  enum GSF_PendingRequestOptions options;
+  
+  /**
+   * Type of the requested block.
+   */
+  enum GNUNET_BLOCK_Type type;
+
+  /**
+   * Is the 'target' value set to a valid peer identity?
+   */
+  int has_target;
+
+};
+
+
+/**
  * Handle a reply to a pending request.  Also called if a request
  * expires (then with data == NULL).  The handler may be called
  * many times (depending on the request type), but will not be
@@ -109,7 +160,7 @@
                             const GNUNET_HashCode *query,
                             const GNUNET_HashCode *namespace,
                             const struct GNUNET_PeerIdentity *target,
-                            struct GNUNET_CONTAINER_BloomFilter *bf,
+                            const struct GNUNET_CONTAINER_BloomFilter *bf,
                             int32_t mingle,
                             uint32_t anonymity_level,
                             uint32_t priority,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]