gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r27631 - in gnunet/src: include regex set


From: gnunet
Subject: [GNUnet-SVN] r27631 - in gnunet/src: include regex set
Date: Wed, 26 Jun 2013 17:54:54 +0200

Author: grothoff
Date: 2013-06-26 17:54:54 +0200 (Wed, 26 Jun 2013)
New Revision: 27631

Modified:
   gnunet/src/include/block_regex.h
   gnunet/src/include/gnunet_namestore_service.h
   gnunet/src/regex/plugin_block_regex.c
   gnunet/src/regex/regex_block_lib.c
   gnunet/src/regex/regex_block_lib.h
   gnunet/src/regex/regex_internal_dht.c
   gnunet/src/set/gnunet-service-set.h
Log:
-removing unnecessary key from regex blocks, compacting some of the other fields

Modified: gnunet/src/include/block_regex.h
===================================================================
--- gnunet/src/include/block_regex.h    2013-06-26 15:16:39 UTC (rev 27630)
+++ gnunet/src/include/block_regex.h    2013-06-26 15:54:54 UTC (rev 27631)
@@ -39,77 +39,75 @@
 #include <stdint.h>
 
 
+GNUNET_NETWORK_STRUCT_BEGIN
+
+
 /**
  * @brief A RegexBlock contains one or more of this struct in the payload.
  */
 struct RegexEdge
 {
-      /**
-       * Destination of this edge.
-       */
-    struct GNUNET_HashCode key;
+  /**
+   * Destination of this edge.
+   */
+  struct GNUNET_HashCode key;
+  
+  /**
+   * Length of the token towards the new state.
+   */
+  uint32_t n_token GNUNET_PACKED;
 
-      /**
-       * Length of the token towards the new state.
-       */
-    unsigned int n_token;
-
-    /* char token[n_token] */
+  /* char token[n_token] */
 };
 
+
 /**
  * @brief Block to announce a regex state.
  */
 struct RegexBlock
 {
-      /**
-       * The key of the state.
-       */
-    struct GNUNET_HashCode key;
 
-      /**
-       * Length of the proof regex string.
-       */
-    unsigned int n_proof;
+  /**
+   * Length of the proof regex string.
+   */
+  uint16_t proof_len GNUNET_PACKED;
 
-      /**
-       * Numer of edges parting from this state.
-       */
-    unsigned int n_edges;
+  /**
+   * Is this state an accepting state?
+   */
+  int16_t is_accepting GNUNET_PACKED;
 
-      /**
-       * Is this state an accepting state?
-       */
-    int accepting;
+  /**
+   * Numer of edges parting from this state.
+   */
+  uint32_t n_edges GNUNET_PACKED;
 
-    /* char proof[n_proof] */
-    /* struct RegexEdge edges[n_edges] */
+  /* char proof[n_proof] */
+  /* struct RegexEdge edges[n_edges] */
 };
 
+
 /**
  * @brief Block to announce a peer accepting a state.
  */
 struct RegexAccept
 {
-      /**
-       * The key of the state.
-       */
-    struct GNUNET_HashCode key;
+  /**
+   * The key of the state.
+   */
+  struct GNUNET_HashCode key;
+  
+  /**
+   * The identity of the peer accepting the state
+   */
+  struct GNUNET_PeerIdentity id;
 
-      /**
-       * Length of the proof regex string.
-       * FIXME necessary???
-       * already present in the leading MeshRegexBlock
-       */
-    // unsigned int n_proof;
+};
 
-      /**
-       * The identity of the peer accepting the state
-       */
-    struct GNUNET_PeerIdentity id;
 
-};
+GNUNET_NETWORK_STRUCT_END
 
+
 #if 0                           /* keep Emacsens' auto-indent happy */
 {
 #endif
@@ -117,4 +115,4 @@
 }
 #endif
 
-#endif
\ No newline at end of file
+#endif

Modified: gnunet/src/include/gnunet_namestore_service.h
===================================================================
--- gnunet/src/include/gnunet_namestore_service.h       2013-06-26 15:16:39 UTC 
(rev 27630)
+++ gnunet/src/include/gnunet_namestore_service.h       2013-06-26 15:54:54 UTC 
(rev 27631)
@@ -1,10 +1,10 @@
 /*
      This file is part of GNUnet
-     (C) 2012 Christian Grothoff (and other contributing authors)
+     (C) 2012, 2013 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -225,9 +225,8 @@
 
 /**
  * Store an item in the namestore.  If the item is already present,
- * the expiration time is updated to the max of the existing time and
- * the new time.  This API is used when we cache signatures from other
- * authorities.
+ * it is replaced with the new record.  Use an empty array to
+ * remove all records under the given name.
  *
  * @param h handle to the namestore
  * @param zone_key public key of the zone
@@ -276,52 +275,29 @@
 
 /**
  * Store an item in the namestore.  If the item is already present,
- * the expiration time is updated to the max of the existing time and
- * the new time.  This API is used by the authority of a zone.
- * FIXME: consider allowing to pass multiple records in one call!
+ * it is replaced with the new record.  Use an empty array to
+ * remove all records under the given name.
  *
  * @param h handle to the namestore
  * @param pkey private key of the zone
  * @param name name that is being mapped (at most 255 characters long)
- * @param rd record data to store
+ * @param rd_count number of records in the 'rd' array
+ * @param rd array of records with data to store
  * @param cont continuation to call when done
- * @param cont_cls closure for cont
+ * @param cont_cls closure for 'cont'
  * @return handle to abort the request
  */
 struct GNUNET_NAMESTORE_QueueEntry *
-GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h,
-                                const struct GNUNET_CRYPTO_EccPrivateKey *pkey,
-                                const char *name,
-                                const struct GNUNET_NAMESTORE_RecordData *rd,
-                                GNUNET_NAMESTORE_ContinuationWithStatus cont,
-                                void *cont_cls);
+GNUNET_NAMESTORE_record_put_by_authority (struct GNUNET_NAMESTORE_Handle *h,
+                                         const struct 
GNUNET_CRYPTO_EccPrivateKey *pkey,
+                                         const char *name,
+                                         unsigned int rd_count,
+                                         const struct 
GNUNET_NAMESTORE_RecordData *rd,
+                                         
GNUNET_NAMESTORE_ContinuationWithStatus cont,
+                                         void *cont_cls);
 
 
 /**
- * Explicitly remove some content from the database.  The
- * "cont"inuation will be called with status "GNUNET_OK" if content
- * was removed, "GNUNET_NO" if no matching entry was found and
- * "GNUNET_SYSERR" on all other types of errors.
- * This API is used by the authority of a zone.
- *
- * @param h handle to the namestore
- * @param pkey private key of the zone
- * @param name name that is being mapped (at most 255 characters long)
- * @param rd record data, remove specific record,  NULL to remove the name and 
all records
- * @param cont continuation to call when done
- * @param cont_cls closure for cont
- * @return handle to abort the request
- */
-struct GNUNET_NAMESTORE_QueueEntry *
-GNUNET_NAMESTORE_record_remove (struct GNUNET_NAMESTORE_Handle *h,
-                               const struct GNUNET_CRYPTO_EccPrivateKey *pkey,
-                               const char *name,
-                               const struct GNUNET_NAMESTORE_RecordData *rd,
-                               GNUNET_NAMESTORE_ContinuationWithStatus cont,
-                               void *cont_cls);
-
-
-/**
  * Process a record that was stored in the namestore.
  *
  * @param cls closure
@@ -341,7 +317,7 @@
                                                  const struct 
GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key,
                                                  struct GNUNET_TIME_Absolute 
freshness,                            
                                                  const char *name,
-                                                 unsigned int rd_len,
+                                                 unsigned int rd_count,
                                                  const struct 
GNUNET_NAMESTORE_RecordData *rd,
                                                  const struct 
GNUNET_CRYPTO_EccSignature *signature);
 
@@ -462,6 +438,64 @@
 
 
 /**
+ * Handle for a monitoring activity.
+ */
+struct GNUNET_NAMESTORE_ZoneMonitor;
+
+
+/**
+ * Function called whenever the records for a given name changed.
+ *
+ * @param cls closure
+ * @param was_removed GNUNET_NO if the record was added, GNUNET_YES if it was 
removed
+ * @param freshness when does the corresponding block in the DHT expire (until
+ *               when should we never do a DHT lookup for the same name 
again)?; 
+ *               GNUNET_TIME_UNIT_ZERO_ABS if there are no records of any type 
in the namestore,
+ *               or the expiration time of the block in the namestore (even if 
there are zero
+ *               records matching the desired record type)
+ * @param name name that is being mapped (at most 255 characters long)
+ * @param rd_count number of entries in 'rd' array
+ * @param rd array of records with data to store
+ * @param signature signature of the record block
+ */
+typedef void (*GNUNET_NAMESTORE_RecordMonitor)(void *cls,
+                                              int was_removed,
+                                              const struct 
GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key,
+                                              struct GNUNET_TIME_Absolute 
freshness,                       
+                                              const char *name,
+                                              unsigned int rd_len,
+                                              const struct 
GNUNET_NAMESTORE_RecordData *rd,
+                                              const struct 
GNUNET_CRYPTO_EccSignature *signature);
+
+
+/**
+ * Begin monitoring a zone for changes.  Will first call the 'monitor' function
+ * on all existing records in the selected zone(s) and then call it whenever
+ * a record changes.
+ *
+ * @param cfg configuration to use to connect to namestore
+ * @param zone zone to monitor, NULL for all zones
+ * @param monitor function to call on zone changes
+ * @param monitor_cls closure for 'monitor'
+ * @return handle to stop monitoring
+ */
+struct GNUNET_NAMESTORE_ZoneMonitor *
+GNUNET_NAMESTORE_zone_monitor_start (const struct GNUNET_CONFIGURATION_Handle 
*cfg,
+                                    const struct GNUNET_CRYPTO_ShortHashCode 
*zone,
+                                    GNUNET_NAMESTORE_RecordMonitor monitor,
+                                    void *monitor_cls);
+
+
+/**
+ * Stop monitoring a zone for changes.
+ *
+ * @param zm handle to the monitor activity to stop
+ */
+void
+GNUNET_NAMESTORE_zone_monitor_stop (struct GNUNET_NAMESTORE_ZoneMonitor *zm);
+
+
+/**
  * Cancel a namestore operation.  The final callback from the
  * operation must not have been done yet.  Must be called on any
  * namestore operation that has not yet completed prior to calling
@@ -473,7 +507,6 @@
 GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe);
 
 
-
 /* convenience APIs for serializing / deserializing GNS records */
 
 /**
@@ -579,6 +612,7 @@
 /**
  * Test if a given record is expired.
  * 
+ * @param rd record to test
  * @return GNUNET_YES if the record is expired,
  *         GNUNET_NO if not
  */

Modified: gnunet/src/regex/plugin_block_regex.c
===================================================================
--- gnunet/src/regex/plugin_block_regex.c       2013-06-26 15:16:39 UTC (rev 
27630)
+++ gnunet/src/regex/plugin_block_regex.c       2013-06-26 15:54:54 UTC (rev 
27631)
@@ -80,7 +80,7 @@
  */
 static enum GNUNET_BLOCK_EvaluationResult
 evaluate_block_regex (void *cls, enum GNUNET_BLOCK_Type type,
-                      const struct GNUNET_HashCode * query,
+                      const struct GNUNET_HashCode *query,
                       struct GNUNET_CONTAINER_BloomFilter **bf,
                       int32_t bf_mutator, const void *xquery,
                       size_t xquery_size, const void *reply_block,
@@ -106,15 +106,16 @@
 
     GNUNET_break_op (0);
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
-               "Block with no xquery, key: %s, %u edges\n",
-                GNUNET_h2s (&rblock->key), 
+               "Block with no xquery, query: %s, %u edges\n",
+                GNUNET_h2s (query), 
                ntohl (rblock->n_edges));
     REGEX_BLOCK_iterate (rblock, reply_block_size, &rdebug, NULL);
     return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
   }
   switch (REGEX_BLOCK_check (reply_block,
-                                     reply_block_size,
-                                     xquery))
+                            reply_block_size,
+                            query,
+                            xquery))
   {
     case GNUNET_SYSERR:
       GNUNET_break_op(0);
@@ -276,12 +277,15 @@
                             const void *block, size_t block_size,
                             struct GNUNET_HashCode * key)
 {
+  int ret;
+
   switch (type)
   {
     case GNUNET_BLOCK_TYPE_REGEX:
-      GNUNET_assert (sizeof (struct RegexBlock) <= block_size);
-      *key = ((struct RegexBlock *) block)->key;
-      return GNUNET_OK;
+      ret = REGEX_BLOCK_get_key (block, block_size,
+                                key);
+      GNUNET_break_op (GNUNET_OK == ret);
+      return ret;
     case GNUNET_BLOCK_TYPE_REGEX_ACCEPT:
       GNUNET_assert (sizeof (struct RegexAccept) <= block_size);
       *key = ((struct RegexAccept *) block)->key;

Modified: gnunet/src/regex/regex_block_lib.c
===================================================================
--- gnunet/src/regex/regex_block_lib.c  2013-06-26 15:16:39 UTC (rev 27630)
+++ gnunet/src/regex/regex_block_lib.c  2013-06-26 15:54:54 UTC (rev 27631)
@@ -40,8 +40,8 @@
  */
 int
 REGEX_BLOCK_check_proof (const char *proof,
-                           size_t proof_len,
-                           const struct GNUNET_HashCode *key)
+                        size_t proof_len,
+                        const struct GNUNET_HashCode *key)
 {
   struct GNUNET_HashCode key_check;
 
@@ -50,7 +50,6 @@
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Proof check failed, was NULL.\n");
     return GNUNET_NO;
   }
-
   GNUNET_CRYPTO_hash (proof, proof_len, &key_check);
   return (0 ==
           GNUNET_CRYPTO_hash_cmp (key, &key_check)) ? GNUNET_OK : GNUNET_NO;
@@ -72,10 +71,6 @@
    */
   int found;
 
-  /**
-   * Key of the block we are iterating (for debug purposes).
-   */
-  char *key;
 };
 
 
@@ -99,7 +94,7 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
              "edge %.*s [%u]: %s->%s\n",
-              (int) len, token, len, ctx->key, GNUNET_h2s(key));
+              (int) len, token, len, GNUNET_h2s(key));
   if (NULL == ctx->xquery)
     return GNUNET_YES;
   if (strlen (ctx->xquery) < len)
@@ -115,6 +110,7 @@
  *
  * @param block The start of the block.
  * @param size The size of the block.
+ * @param query the query for the block
  * @param xquery String describing the edge we are looking for.
  *               Can be NULL in case this is a put block.
  *
@@ -125,34 +121,33 @@
 int
 REGEX_BLOCK_check (const struct RegexBlock *block,
                   size_t size,
+                  const struct GNUNET_HashCode *query,
                   const char *xquery)
 {
   struct CheckEdgeContext ctx;
   int res;
-  uint32_t len;
+  uint16_t len;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Checking block with xquery `%s'\n",
               NULL != xquery ? xquery : "NULL");
-  len = ntohl (block->n_proof);
+  len = ntohs (block->proof_len);
   if (size < sizeof (struct RegexBlock) + len)
   {
     GNUNET_break_op (0);
     return GNUNET_SYSERR;
   }
-  if (GNUNET_OK != REGEX_BLOCK_check_proof ((const char *) &block[1], len, 
&block->key))
+  if (GNUNET_OK != REGEX_BLOCK_check_proof ((const char *) &block[1], len, 
query))
   {
     GNUNET_break_op (0);
     return GNUNET_SYSERR;
   }
-  if ( (GNUNET_YES == ntohl (block->accepting)) &&
+  if ( (GNUNET_YES == ntohs (block->is_accepting)) &&
        ( (NULL == xquery) || ('\0' == xquery[0]) ) )
     return GNUNET_OK;
   ctx.xquery = xquery;
   ctx.found = GNUNET_NO;
-  ctx.key = GNUNET_strdup (GNUNET_h2s (&block->key));
   res = REGEX_BLOCK_iterate (block, size, &check_edge, &ctx);
-  GNUNET_free (ctx.key);
   if (GNUNET_SYSERR == res)
     return GNUNET_SYSERR;
   if (NULL == xquery)
@@ -162,6 +157,32 @@
 
 
 /**
+ * Obtain the key that a particular block is to be stored under.
+ *
+ * @param block block to get the key from
+ * @param block_len number of bytes in block
+ * @param query where to store the key
+ * @return GNUNET_OK on success, GNUNET_SYSERR if the block is malformed
+ */
+int
+REGEX_BLOCK_get_key (const struct RegexBlock *block,
+                    size_t block_len,
+                    struct GNUNET_HashCode *key)
+{
+  uint16_t len;
+
+  len = ntohs (block->proof_len);
+  if (block_len < sizeof (struct RegexBlock) + len)
+  {
+    GNUNET_break_op (0);
+    return GNUNET_SYSERR;
+  }
+  GNUNET_CRYPTO_hash (&block[1], len, key);
+  return GNUNET_OK;
+}
+
+
+/**
  * Iterate over all edges of a block of a regex state.
  *
  * @param block Block to iterate over.
@@ -179,9 +200,9 @@
  */
 int
 REGEX_BLOCK_iterate (const struct RegexBlock *block,
-                            size_t size,
-                            REGEX_INTERNAL_EgdeIterator iterator,
-                            void *iter_cls)
+                    size_t size,
+                    REGEX_INTERNAL_EgdeIterator iterator,
+                    void *iter_cls)
 {
   struct RegexEdge *edge;
   unsigned int n;
@@ -196,7 +217,7 @@
     GNUNET_break_op (0);
     return GNUNET_SYSERR;
   }
-  n = ntohl (block->n_proof);
+  n = ntohs (block->proof_len);
   offset += n;
   if (offset >= size) /* Is it safe to access the regex proof? */
   {
@@ -208,7 +229,7 @@
   n = ntohl (block->n_edges);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Start iterating block of size %u, proof %u, off %u edges %u\n",
-       size, ntohl (block->n_proof), offset, n);
+       size, ntohs (block->proof_len), offset, n);
   /* aux always points at the end of the previous block */
   for (i = 0; i < n; i++)
   {
@@ -257,15 +278,16 @@
  * @param proof proof string for the block
  * @param num_edges number of edges in the block
  * @param edges the edges of the block
- * @return the regex block
+ * @param accepting is this an accepting state
+ * @param rsize set to the size of the returned block (OUT-only)
+ * @return the regex block, NULL on error
  */
 struct RegexBlock *
-REGEX_BLOCK_create (const struct GNUNET_HashCode *key,
-                            const char *proof,
-                            unsigned int num_edges,
-                            const struct REGEX_BLOCK_Edge *edges,
-                            int accepting,
-                            size_t *rsize)
+REGEX_BLOCK_create (const char *proof,
+                   unsigned int num_edges,
+                   const struct REGEX_BLOCK_Edge *edges,
+                   int accepting,
+                   size_t *rsize)
 {
   struct RegexBlock *block;
   struct RegexEdge *block_edge;
@@ -275,13 +297,17 @@
   unsigned int offset;
   char *aux;
 
-  len = strlen(proof);
+  len = strlen (proof);
+  if (len > UINT16_MAX)
+    {
+      GNUNET_break (0);
+      return NULL;
+    }
   size = sizeof (struct RegexBlock) + len;
   block = GNUNET_malloc (size);
-  block->key = *key;
-  block->n_proof = htonl (len);
+  block->proof_len = htons (len);
   block->n_edges = htonl (num_edges);
-  block->accepting = htonl (accepting);
+  block->is_accepting = htons (accepting);
 
   /* Store the proof at the end of the block. */
   aux = (char *) &block[1];

Modified: gnunet/src/regex/regex_block_lib.h
===================================================================
--- gnunet/src/regex/regex_block_lib.h  2013-06-26 15:16:39 UTC (rev 27630)
+++ gnunet/src/regex/regex_block_lib.h  2013-06-26 15:54:54 UTC (rev 27631)
@@ -68,8 +68,8 @@
  */
 int
 REGEX_BLOCK_check_proof (const char *proof,
-                           size_t proof_len,
-                           const struct GNUNET_HashCode *key);
+                        size_t proof_len,
+                        const struct GNUNET_HashCode *key);
 
 
 /**
@@ -77,6 +77,7 @@
  *
  * @param block The start of the block.
  * @param size The size of the block.
+ * @param query the query for the block
  * @param xquery String describing the edge we are looking for.
  *               Can be NULL in case this is a put block.
  *
@@ -87,6 +88,7 @@
 int
 REGEX_BLOCK_check (const struct RegexBlock *block,
                   size_t size,
+                  const struct GNUNET_HashCode *query,
                   const char *xquery);
 
 
@@ -130,22 +132,37 @@
                             REGEX_INTERNAL_EgdeIterator iterator,
                             void *iter_cls);
 
+/**
+ * Obtain the key that a particular block is to be stored under.
+ *
+ * @param block block to get the key from
+ * @param block_len number of bytes in block
+ * @param query where to store the key
+ * @return GNUNET_OK on success, GNUNET_SYSERR if the block is malformed
+ */
+int
+REGEX_BLOCK_get_key (const struct RegexBlock *block,
+                    size_t block_len,
+                    struct GNUNET_HashCode *key);
 
+
+
 /**
  * Construct a regex block to be stored in the DHT.
  *
  * @param proof proof string for the block
  * @param num_edges number of edges in the block
  * @param edges the edges of the block
- * @return the regex block
+ * @param accepting is this an accepting state
+ * @param rsize set to the size of the returned block (OUT-only)
+ * @return the regex block, NULL on error
  */
 struct RegexBlock *
-REGEX_BLOCK_create (const struct GNUNET_HashCode *key,
-                            const char *proof,
-                            unsigned int num_edges,
-                            const struct REGEX_BLOCK_Edge *edges,
-                            int accepting,
-                            size_t *rsize);
+REGEX_BLOCK_create (const char *proof,
+                   unsigned int num_edges,
+                   const struct REGEX_BLOCK_Edge *edges,
+                   int accepting,
+                   size_t *rsize);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */

Modified: gnunet/src/regex/regex_internal_dht.c
===================================================================
--- gnunet/src/regex/regex_internal_dht.c       2013-06-26 15:16:39 UTC (rev 
27630)
+++ gnunet/src/regex/regex_internal_dht.c       2013-06-26 15:54:54 UTC (rev 
27631)
@@ -123,10 +123,10 @@
                     DHT_TTL,
                     NULL, NULL);
   }
-  block = REGEX_BLOCK_create (key, proof,
-                                      num_edges, edges,
-                                      accepting,
-                                      &size);
+  block = REGEX_BLOCK_create (proof,
+                             num_edges, edges,
+                             accepting,
+                             &size);
   (void)
   GNUNET_DHT_put (h->dht, key,
                   DHT_REPLICATION,
@@ -420,20 +420,20 @@
   GNUNET_break (
     GNUNET_OK ==
     GNUNET_CONTAINER_multihashmap_put (info->dht_get_results,
-                                       &((struct RegexBlock *)copy)->key, copy,
+                                       key, copy,
                                        
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE)
                );
   len = strlen (info->description);
   if (len == ctx->position) // String processed
   {
-    if (GNUNET_YES == ntohl (block->accepting))
+    if (GNUNET_YES == ntohs (block->is_accepting))
     {
       regex_find_path (key, ctx);
     }
     else
     {
-      LOG (GNUNET_ERROR_TYPE_INFO, "  block not accepting!\n");
-      // FIXME REGEX this block not successful, wait for more? start timeout?
+      LOG (GNUNET_ERROR_TYPE_INFO, "block not accepting!\n");
+      /* FIXME REGEX this block not successful, wait for more? start timeout? 
*/
     }
     return;
   }
@@ -457,7 +457,7 @@
   struct RegexBlock *block = value;
   struct RegexSearchContext *ctx = cls;
 
-  if (GNUNET_YES == ntohl(block->accepting) &&
+  if (GNUNET_YES == ntohs (block->is_accepting) &&
       ctx->position == strlen (ctx->info->description))
   {
     LOG (GNUNET_ERROR_TYPE_INFO, " * Found accepting known block\n");
@@ -466,7 +466,7 @@
   }
   LOG (GNUNET_ERROR_TYPE_DEBUG, "* %u, %u, [%u]\n",
        ctx->position, strlen(ctx->info->description),
-       ntohl(block->accepting));
+       ntohs (block->is_accepting));
 
   regex_next_edge (block, SIZE_MAX, ctx);
 
@@ -646,7 +646,7 @@
   h->callback_cls = callback_cls;
   h->stats = stats;
   h->dht_get_handles = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO);
-  h->dht_get_results = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_YES);
+  h->dht_get_results = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO);
 
   /* Initialize context */
   len = strlen (string);

Modified: gnunet/src/set/gnunet-service-set.h
===================================================================
--- gnunet/src/set/gnunet-service-set.h 2013-06-26 15:16:39 UTC (rev 27630)
+++ gnunet/src/set/gnunet-service-set.h 2013-06-26 15:54:54 UTC (rev 27631)
@@ -196,7 +196,8 @@
 /**
  * Different types a tunnel can be.
  */
-enum TunnelContextType {
+enum TunnelContextType 
+{
   /**
    * Tunnel is waiting for a set request from the tunnel,
    * or for the ack/nack of the client for a received request.
@@ -237,6 +238,7 @@
   struct IntersectionEvaluateOperation *intersection_op;
 };
 
+
 /**
  * Information about a tunnel we are connected to.
  * Used as tunnel context with mesh.




reply via email to

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