diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-06-26 15:54:54 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-06-26 15:54:54 +0000 |
commit | 7706f0a08b2425622121c23a7d2054794f2d677c (patch) | |
tree | d4b658006d8b0418b2afabe51bfae14c3f59bb97 /src/regex | |
parent | 133a5ecf306d35f9e86fb5a1f8b120783f6afdf9 (diff) | |
download | gnunet-7706f0a08b2425622121c23a7d2054794f2d677c.tar.gz gnunet-7706f0a08b2425622121c23a7d2054794f2d677c.zip |
-removing unnecessary key from regex blocks, compacting some of the other fields
Diffstat (limited to 'src/regex')
-rw-r--r-- | src/regex/plugin_block_regex.c | 20 | ||||
-rw-r--r-- | src/regex/regex_block_lib.c | 86 | ||||
-rw-r--r-- | src/regex/regex_block_lib.h | 35 | ||||
-rw-r--r-- | src/regex/regex_internal_dht.c | 22 |
4 files changed, 105 insertions, 58 deletions
diff --git a/src/regex/plugin_block_regex.c b/src/regex/plugin_block_regex.c index e17b34d33..9eeb13190 100644 --- a/src/regex/plugin_block_regex.c +++ b/src/regex/plugin_block_regex.c | |||
@@ -80,7 +80,7 @@ rdebug (void *cls, | |||
80 | */ | 80 | */ |
81 | static enum GNUNET_BLOCK_EvaluationResult | 81 | static enum GNUNET_BLOCK_EvaluationResult |
82 | evaluate_block_regex (void *cls, enum GNUNET_BLOCK_Type type, | 82 | evaluate_block_regex (void *cls, enum GNUNET_BLOCK_Type type, |
83 | const struct GNUNET_HashCode * query, | 83 | const struct GNUNET_HashCode *query, |
84 | struct GNUNET_CONTAINER_BloomFilter **bf, | 84 | struct GNUNET_CONTAINER_BloomFilter **bf, |
85 | int32_t bf_mutator, const void *xquery, | 85 | int32_t bf_mutator, const void *xquery, |
86 | size_t xquery_size, const void *reply_block, | 86 | size_t xquery_size, const void *reply_block, |
@@ -106,15 +106,16 @@ evaluate_block_regex (void *cls, enum GNUNET_BLOCK_Type type, | |||
106 | 106 | ||
107 | GNUNET_break_op (0); | 107 | GNUNET_break_op (0); |
108 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 108 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
109 | "Block with no xquery, key: %s, %u edges\n", | 109 | "Block with no xquery, query: %s, %u edges\n", |
110 | GNUNET_h2s (&rblock->key), | 110 | GNUNET_h2s (query), |
111 | ntohl (rblock->n_edges)); | 111 | ntohl (rblock->n_edges)); |
112 | REGEX_BLOCK_iterate (rblock, reply_block_size, &rdebug, NULL); | 112 | REGEX_BLOCK_iterate (rblock, reply_block_size, &rdebug, NULL); |
113 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 113 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
114 | } | 114 | } |
115 | switch (REGEX_BLOCK_check (reply_block, | 115 | switch (REGEX_BLOCK_check (reply_block, |
116 | reply_block_size, | 116 | reply_block_size, |
117 | xquery)) | 117 | query, |
118 | xquery)) | ||
118 | { | 119 | { |
119 | case GNUNET_SYSERR: | 120 | case GNUNET_SYSERR: |
120 | GNUNET_break_op(0); | 121 | GNUNET_break_op(0); |
@@ -276,12 +277,15 @@ block_plugin_regex_get_key (void *cls, enum GNUNET_BLOCK_Type type, | |||
276 | const void *block, size_t block_size, | 277 | const void *block, size_t block_size, |
277 | struct GNUNET_HashCode * key) | 278 | struct GNUNET_HashCode * key) |
278 | { | 279 | { |
280 | int ret; | ||
281 | |||
279 | switch (type) | 282 | switch (type) |
280 | { | 283 | { |
281 | case GNUNET_BLOCK_TYPE_REGEX: | 284 | case GNUNET_BLOCK_TYPE_REGEX: |
282 | GNUNET_assert (sizeof (struct RegexBlock) <= block_size); | 285 | ret = REGEX_BLOCK_get_key (block, block_size, |
283 | *key = ((struct RegexBlock *) block)->key; | 286 | key); |
284 | return GNUNET_OK; | 287 | GNUNET_break_op (GNUNET_OK == ret); |
288 | return ret; | ||
285 | case GNUNET_BLOCK_TYPE_REGEX_ACCEPT: | 289 | case GNUNET_BLOCK_TYPE_REGEX_ACCEPT: |
286 | GNUNET_assert (sizeof (struct RegexAccept) <= block_size); | 290 | GNUNET_assert (sizeof (struct RegexAccept) <= block_size); |
287 | *key = ((struct RegexAccept *) block)->key; | 291 | *key = ((struct RegexAccept *) block)->key; |
diff --git a/src/regex/regex_block_lib.c b/src/regex/regex_block_lib.c index bd3ec9679..01c591caa 100644 --- a/src/regex/regex_block_lib.c +++ b/src/regex/regex_block_lib.c | |||
@@ -40,8 +40,8 @@ | |||
40 | */ | 40 | */ |
41 | int | 41 | int |
42 | REGEX_BLOCK_check_proof (const char *proof, | 42 | REGEX_BLOCK_check_proof (const char *proof, |
43 | size_t proof_len, | 43 | size_t proof_len, |
44 | const struct GNUNET_HashCode *key) | 44 | const struct GNUNET_HashCode *key) |
45 | { | 45 | { |
46 | struct GNUNET_HashCode key_check; | 46 | struct GNUNET_HashCode key_check; |
47 | 47 | ||
@@ -50,7 +50,6 @@ REGEX_BLOCK_check_proof (const char *proof, | |||
50 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Proof check failed, was NULL.\n"); | 50 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Proof check failed, was NULL.\n"); |
51 | return GNUNET_NO; | 51 | return GNUNET_NO; |
52 | } | 52 | } |
53 | |||
54 | GNUNET_CRYPTO_hash (proof, proof_len, &key_check); | 53 | GNUNET_CRYPTO_hash (proof, proof_len, &key_check); |
55 | return (0 == | 54 | return (0 == |
56 | GNUNET_CRYPTO_hash_cmp (key, &key_check)) ? GNUNET_OK : GNUNET_NO; | 55 | GNUNET_CRYPTO_hash_cmp (key, &key_check)) ? GNUNET_OK : GNUNET_NO; |
@@ -72,10 +71,6 @@ struct CheckEdgeContext | |||
72 | */ | 71 | */ |
73 | int found; | 72 | int found; |
74 | 73 | ||
75 | /** | ||
76 | * Key of the block we are iterating (for debug purposes). | ||
77 | */ | ||
78 | char *key; | ||
79 | }; | 74 | }; |
80 | 75 | ||
81 | 76 | ||
@@ -99,7 +94,7 @@ check_edge (void *cls, | |||
99 | 94 | ||
100 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 95 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
101 | "edge %.*s [%u]: %s->%s\n", | 96 | "edge %.*s [%u]: %s->%s\n", |
102 | (int) len, token, len, ctx->key, GNUNET_h2s(key)); | 97 | (int) len, token, len, GNUNET_h2s(key)); |
103 | if (NULL == ctx->xquery) | 98 | if (NULL == ctx->xquery) |
104 | return GNUNET_YES; | 99 | return GNUNET_YES; |
105 | if (strlen (ctx->xquery) < len) | 100 | if (strlen (ctx->xquery) < len) |
@@ -115,6 +110,7 @@ check_edge (void *cls, | |||
115 | * | 110 | * |
116 | * @param block The start of the block. | 111 | * @param block The start of the block. |
117 | * @param size The size of the block. | 112 | * @param size The size of the block. |
113 | * @param query the query for the block | ||
118 | * @param xquery String describing the edge we are looking for. | 114 | * @param xquery String describing the edge we are looking for. |
119 | * Can be NULL in case this is a put block. | 115 | * Can be NULL in case this is a put block. |
120 | * | 116 | * |
@@ -125,34 +121,33 @@ check_edge (void *cls, | |||
125 | int | 121 | int |
126 | REGEX_BLOCK_check (const struct RegexBlock *block, | 122 | REGEX_BLOCK_check (const struct RegexBlock *block, |
127 | size_t size, | 123 | size_t size, |
124 | const struct GNUNET_HashCode *query, | ||
128 | const char *xquery) | 125 | const char *xquery) |
129 | { | 126 | { |
130 | struct CheckEdgeContext ctx; | 127 | struct CheckEdgeContext ctx; |
131 | int res; | 128 | int res; |
132 | uint32_t len; | 129 | uint16_t len; |
133 | 130 | ||
134 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 131 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
135 | "Checking block with xquery `%s'\n", | 132 | "Checking block with xquery `%s'\n", |
136 | NULL != xquery ? xquery : "NULL"); | 133 | NULL != xquery ? xquery : "NULL"); |
137 | len = ntohl (block->n_proof); | 134 | len = ntohs (block->proof_len); |
138 | if (size < sizeof (struct RegexBlock) + len) | 135 | if (size < sizeof (struct RegexBlock) + len) |
139 | { | 136 | { |
140 | GNUNET_break_op (0); | 137 | GNUNET_break_op (0); |
141 | return GNUNET_SYSERR; | 138 | return GNUNET_SYSERR; |
142 | } | 139 | } |
143 | if (GNUNET_OK != REGEX_BLOCK_check_proof ((const char *) &block[1], len, &block->key)) | 140 | if (GNUNET_OK != REGEX_BLOCK_check_proof ((const char *) &block[1], len, query)) |
144 | { | 141 | { |
145 | GNUNET_break_op (0); | 142 | GNUNET_break_op (0); |
146 | return GNUNET_SYSERR; | 143 | return GNUNET_SYSERR; |
147 | } | 144 | } |
148 | if ( (GNUNET_YES == ntohl (block->accepting)) && | 145 | if ( (GNUNET_YES == ntohs (block->is_accepting)) && |
149 | ( (NULL == xquery) || ('\0' == xquery[0]) ) ) | 146 | ( (NULL == xquery) || ('\0' == xquery[0]) ) ) |
150 | return GNUNET_OK; | 147 | return GNUNET_OK; |
151 | ctx.xquery = xquery; | 148 | ctx.xquery = xquery; |
152 | ctx.found = GNUNET_NO; | 149 | ctx.found = GNUNET_NO; |
153 | ctx.key = GNUNET_strdup (GNUNET_h2s (&block->key)); | ||
154 | res = REGEX_BLOCK_iterate (block, size, &check_edge, &ctx); | 150 | res = REGEX_BLOCK_iterate (block, size, &check_edge, &ctx); |
155 | GNUNET_free (ctx.key); | ||
156 | if (GNUNET_SYSERR == res) | 151 | if (GNUNET_SYSERR == res) |
157 | return GNUNET_SYSERR; | 152 | return GNUNET_SYSERR; |
158 | if (NULL == xquery) | 153 | if (NULL == xquery) |
@@ -162,6 +157,32 @@ REGEX_BLOCK_check (const struct RegexBlock *block, | |||
162 | 157 | ||
163 | 158 | ||
164 | /** | 159 | /** |
160 | * Obtain the key that a particular block is to be stored under. | ||
161 | * | ||
162 | * @param block block to get the key from | ||
163 | * @param block_len number of bytes in block | ||
164 | * @param query where to store the key | ||
165 | * @return GNUNET_OK on success, GNUNET_SYSERR if the block is malformed | ||
166 | */ | ||
167 | int | ||
168 | REGEX_BLOCK_get_key (const struct RegexBlock *block, | ||
169 | size_t block_len, | ||
170 | struct GNUNET_HashCode *key) | ||
171 | { | ||
172 | uint16_t len; | ||
173 | |||
174 | len = ntohs (block->proof_len); | ||
175 | if (block_len < sizeof (struct RegexBlock) + len) | ||
176 | { | ||
177 | GNUNET_break_op (0); | ||
178 | return GNUNET_SYSERR; | ||
179 | } | ||
180 | GNUNET_CRYPTO_hash (&block[1], len, key); | ||
181 | return GNUNET_OK; | ||
182 | } | ||
183 | |||
184 | |||
185 | /** | ||
165 | * Iterate over all edges of a block of a regex state. | 186 | * Iterate over all edges of a block of a regex state. |
166 | * | 187 | * |
167 | * @param block Block to iterate over. | 188 | * @param block Block to iterate over. |
@@ -179,9 +200,9 @@ REGEX_BLOCK_check (const struct RegexBlock *block, | |||
179 | */ | 200 | */ |
180 | int | 201 | int |
181 | REGEX_BLOCK_iterate (const struct RegexBlock *block, | 202 | REGEX_BLOCK_iterate (const struct RegexBlock *block, |
182 | size_t size, | 203 | size_t size, |
183 | REGEX_INTERNAL_EgdeIterator iterator, | 204 | REGEX_INTERNAL_EgdeIterator iterator, |
184 | void *iter_cls) | 205 | void *iter_cls) |
185 | { | 206 | { |
186 | struct RegexEdge *edge; | 207 | struct RegexEdge *edge; |
187 | unsigned int n; | 208 | unsigned int n; |
@@ -196,7 +217,7 @@ REGEX_BLOCK_iterate (const struct RegexBlock *block, | |||
196 | GNUNET_break_op (0); | 217 | GNUNET_break_op (0); |
197 | return GNUNET_SYSERR; | 218 | return GNUNET_SYSERR; |
198 | } | 219 | } |
199 | n = ntohl (block->n_proof); | 220 | n = ntohs (block->proof_len); |
200 | offset += n; | 221 | offset += n; |
201 | if (offset >= size) /* Is it safe to access the regex proof? */ | 222 | if (offset >= size) /* Is it safe to access the regex proof? */ |
202 | { | 223 | { |
@@ -208,7 +229,7 @@ REGEX_BLOCK_iterate (const struct RegexBlock *block, | |||
208 | n = ntohl (block->n_edges); | 229 | n = ntohl (block->n_edges); |
209 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 230 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
210 | "Start iterating block of size %u, proof %u, off %u edges %u\n", | 231 | "Start iterating block of size %u, proof %u, off %u edges %u\n", |
211 | size, ntohl (block->n_proof), offset, n); | 232 | size, ntohs (block->proof_len), offset, n); |
212 | /* aux always points at the end of the previous block */ | 233 | /* aux always points at the end of the previous block */ |
213 | for (i = 0; i < n; i++) | 234 | for (i = 0; i < n; i++) |
214 | { | 235 | { |
@@ -257,15 +278,16 @@ REGEX_BLOCK_iterate (const struct RegexBlock *block, | |||
257 | * @param proof proof string for the block | 278 | * @param proof proof string for the block |
258 | * @param num_edges number of edges in the block | 279 | * @param num_edges number of edges in the block |
259 | * @param edges the edges of the block | 280 | * @param edges the edges of the block |
260 | * @return the regex block | 281 | * @param accepting is this an accepting state |
282 | * @param rsize set to the size of the returned block (OUT-only) | ||
283 | * @return the regex block, NULL on error | ||
261 | */ | 284 | */ |
262 | struct RegexBlock * | 285 | struct RegexBlock * |
263 | REGEX_BLOCK_create (const struct GNUNET_HashCode *key, | 286 | REGEX_BLOCK_create (const char *proof, |
264 | const char *proof, | 287 | unsigned int num_edges, |
265 | unsigned int num_edges, | 288 | const struct REGEX_BLOCK_Edge *edges, |
266 | const struct REGEX_BLOCK_Edge *edges, | 289 | int accepting, |
267 | int accepting, | 290 | size_t *rsize) |
268 | size_t *rsize) | ||
269 | { | 291 | { |
270 | struct RegexBlock *block; | 292 | struct RegexBlock *block; |
271 | struct RegexEdge *block_edge; | 293 | struct RegexEdge *block_edge; |
@@ -275,13 +297,17 @@ REGEX_BLOCK_create (const struct GNUNET_HashCode *key, | |||
275 | unsigned int offset; | 297 | unsigned int offset; |
276 | char *aux; | 298 | char *aux; |
277 | 299 | ||
278 | len = strlen(proof); | 300 | len = strlen (proof); |
301 | if (len > UINT16_MAX) | ||
302 | { | ||
303 | GNUNET_break (0); | ||
304 | return NULL; | ||
305 | } | ||
279 | size = sizeof (struct RegexBlock) + len; | 306 | size = sizeof (struct RegexBlock) + len; |
280 | block = GNUNET_malloc (size); | 307 | block = GNUNET_malloc (size); |
281 | block->key = *key; | 308 | block->proof_len = htons (len); |
282 | block->n_proof = htonl (len); | ||
283 | block->n_edges = htonl (num_edges); | 309 | block->n_edges = htonl (num_edges); |
284 | block->accepting = htonl (accepting); | 310 | block->is_accepting = htons (accepting); |
285 | 311 | ||
286 | /* Store the proof at the end of the block. */ | 312 | /* Store the proof at the end of the block. */ |
287 | aux = (char *) &block[1]; | 313 | aux = (char *) &block[1]; |
diff --git a/src/regex/regex_block_lib.h b/src/regex/regex_block_lib.h index 985296b4f..dec025205 100644 --- a/src/regex/regex_block_lib.h +++ b/src/regex/regex_block_lib.h | |||
@@ -68,8 +68,8 @@ struct REGEX_BLOCK_Edge | |||
68 | */ | 68 | */ |
69 | int | 69 | int |
70 | REGEX_BLOCK_check_proof (const char *proof, | 70 | REGEX_BLOCK_check_proof (const char *proof, |
71 | size_t proof_len, | 71 | size_t proof_len, |
72 | const struct GNUNET_HashCode *key); | 72 | const struct GNUNET_HashCode *key); |
73 | 73 | ||
74 | 74 | ||
75 | /** | 75 | /** |
@@ -77,6 +77,7 @@ REGEX_BLOCK_check_proof (const char *proof, | |||
77 | * | 77 | * |
78 | * @param block The start of the block. | 78 | * @param block The start of the block. |
79 | * @param size The size of the block. | 79 | * @param size The size of the block. |
80 | * @param query the query for the block | ||
80 | * @param xquery String describing the edge we are looking for. | 81 | * @param xquery String describing the edge we are looking for. |
81 | * Can be NULL in case this is a put block. | 82 | * Can be NULL in case this is a put block. |
82 | * | 83 | * |
@@ -87,6 +88,7 @@ REGEX_BLOCK_check_proof (const char *proof, | |||
87 | int | 88 | int |
88 | REGEX_BLOCK_check (const struct RegexBlock *block, | 89 | REGEX_BLOCK_check (const struct RegexBlock *block, |
89 | size_t size, | 90 | size_t size, |
91 | const struct GNUNET_HashCode *query, | ||
90 | const char *xquery); | 92 | const char *xquery); |
91 | 93 | ||
92 | 94 | ||
@@ -130,6 +132,20 @@ REGEX_BLOCK_iterate (const struct RegexBlock *block, | |||
130 | REGEX_INTERNAL_EgdeIterator iterator, | 132 | REGEX_INTERNAL_EgdeIterator iterator, |
131 | void *iter_cls); | 133 | void *iter_cls); |
132 | 134 | ||
135 | /** | ||
136 | * Obtain the key that a particular block is to be stored under. | ||
137 | * | ||
138 | * @param block block to get the key from | ||
139 | * @param block_len number of bytes in block | ||
140 | * @param query where to store the key | ||
141 | * @return GNUNET_OK on success, GNUNET_SYSERR if the block is malformed | ||
142 | */ | ||
143 | int | ||
144 | REGEX_BLOCK_get_key (const struct RegexBlock *block, | ||
145 | size_t block_len, | ||
146 | struct GNUNET_HashCode *key); | ||
147 | |||
148 | |||
133 | 149 | ||
134 | /** | 150 | /** |
135 | * Construct a regex block to be stored in the DHT. | 151 | * Construct a regex block to be stored in the DHT. |
@@ -137,15 +153,16 @@ REGEX_BLOCK_iterate (const struct RegexBlock *block, | |||
137 | * @param proof proof string for the block | 153 | * @param proof proof string for the block |
138 | * @param num_edges number of edges in the block | 154 | * @param num_edges number of edges in the block |
139 | * @param edges the edges of the block | 155 | * @param edges the edges of the block |
140 | * @return the regex block | 156 | * @param accepting is this an accepting state |
157 | * @param rsize set to the size of the returned block (OUT-only) | ||
158 | * @return the regex block, NULL on error | ||
141 | */ | 159 | */ |
142 | struct RegexBlock * | 160 | struct RegexBlock * |
143 | REGEX_BLOCK_create (const struct GNUNET_HashCode *key, | 161 | REGEX_BLOCK_create (const char *proof, |
144 | const char *proof, | 162 | unsigned int num_edges, |
145 | unsigned int num_edges, | 163 | const struct REGEX_BLOCK_Edge *edges, |
146 | const struct REGEX_BLOCK_Edge *edges, | 164 | int accepting, |
147 | int accepting, | 165 | size_t *rsize); |
148 | size_t *rsize); | ||
149 | 166 | ||
150 | 167 | ||
151 | #if 0 /* keep Emacsens' auto-indent happy */ | 168 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/regex/regex_internal_dht.c b/src/regex/regex_internal_dht.c index af775ef95..e7259edcc 100644 --- a/src/regex/regex_internal_dht.c +++ b/src/regex/regex_internal_dht.c | |||
@@ -123,10 +123,10 @@ regex_iterator (void *cls, | |||
123 | DHT_TTL, | 123 | DHT_TTL, |
124 | NULL, NULL); | 124 | NULL, NULL); |
125 | } | 125 | } |
126 | block = REGEX_BLOCK_create (key, proof, | 126 | block = REGEX_BLOCK_create (proof, |
127 | num_edges, edges, | 127 | num_edges, edges, |
128 | accepting, | 128 | accepting, |
129 | &size); | 129 | &size); |
130 | (void) | 130 | (void) |
131 | GNUNET_DHT_put (h->dht, key, | 131 | GNUNET_DHT_put (h->dht, key, |
132 | DHT_REPLICATION, | 132 | DHT_REPLICATION, |
@@ -420,20 +420,20 @@ dht_get_string_handler (void *cls, struct GNUNET_TIME_Absolute exp, | |||
420 | GNUNET_break ( | 420 | GNUNET_break ( |
421 | GNUNET_OK == | 421 | GNUNET_OK == |
422 | GNUNET_CONTAINER_multihashmap_put (info->dht_get_results, | 422 | GNUNET_CONTAINER_multihashmap_put (info->dht_get_results, |
423 | &((struct RegexBlock *)copy)->key, copy, | 423 | key, copy, |
424 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE) | 424 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE) |
425 | ); | 425 | ); |
426 | len = strlen (info->description); | 426 | len = strlen (info->description); |
427 | if (len == ctx->position) // String processed | 427 | if (len == ctx->position) // String processed |
428 | { | 428 | { |
429 | if (GNUNET_YES == ntohl (block->accepting)) | 429 | if (GNUNET_YES == ntohs (block->is_accepting)) |
430 | { | 430 | { |
431 | regex_find_path (key, ctx); | 431 | regex_find_path (key, ctx); |
432 | } | 432 | } |
433 | else | 433 | else |
434 | { | 434 | { |
435 | LOG (GNUNET_ERROR_TYPE_INFO, " block not accepting!\n"); | 435 | LOG (GNUNET_ERROR_TYPE_INFO, "block not accepting!\n"); |
436 | // FIXME REGEX this block not successful, wait for more? start timeout? | 436 | /* FIXME REGEX this block not successful, wait for more? start timeout? */ |
437 | } | 437 | } |
438 | return; | 438 | return; |
439 | } | 439 | } |
@@ -457,7 +457,7 @@ regex_result_iterator (void *cls, | |||
457 | struct RegexBlock *block = value; | 457 | struct RegexBlock *block = value; |
458 | struct RegexSearchContext *ctx = cls; | 458 | struct RegexSearchContext *ctx = cls; |
459 | 459 | ||
460 | if (GNUNET_YES == ntohl(block->accepting) && | 460 | if (GNUNET_YES == ntohs (block->is_accepting) && |
461 | ctx->position == strlen (ctx->info->description)) | 461 | ctx->position == strlen (ctx->info->description)) |
462 | { | 462 | { |
463 | LOG (GNUNET_ERROR_TYPE_INFO, " * Found accepting known block\n"); | 463 | LOG (GNUNET_ERROR_TYPE_INFO, " * Found accepting known block\n"); |
@@ -466,7 +466,7 @@ regex_result_iterator (void *cls, | |||
466 | } | 466 | } |
467 | LOG (GNUNET_ERROR_TYPE_DEBUG, "* %u, %u, [%u]\n", | 467 | LOG (GNUNET_ERROR_TYPE_DEBUG, "* %u, %u, [%u]\n", |
468 | ctx->position, strlen(ctx->info->description), | 468 | ctx->position, strlen(ctx->info->description), |
469 | ntohl(block->accepting)); | 469 | ntohs (block->is_accepting)); |
470 | 470 | ||
471 | regex_next_edge (block, SIZE_MAX, ctx); | 471 | regex_next_edge (block, SIZE_MAX, ctx); |
472 | 472 | ||
@@ -646,7 +646,7 @@ REGEX_INTERNAL_search (struct GNUNET_DHT_Handle *dht, | |||
646 | h->callback_cls = callback_cls; | 646 | h->callback_cls = callback_cls; |
647 | h->stats = stats; | 647 | h->stats = stats; |
648 | h->dht_get_handles = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); | 648 | h->dht_get_handles = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); |
649 | h->dht_get_results = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_YES); | 649 | h->dht_get_results = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); |
650 | 650 | ||
651 | /* Initialize context */ | 651 | /* Initialize context */ |
652 | len = strlen (string); | 652 | len = strlen (string); |