aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_pr.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-10-26 00:53:32 +0000
committerChristian Grothoff <christian@grothoff.org>2015-10-26 00:53:32 +0000
commit6342157c3068d482f7f8c02b7229e80eba2c94dc (patch)
tree3c5b9f1af6637e05471ca3cfae2b268e08f00b2b /src/fs/gnunet-service-fs_pr.h
parent0cd7408a37d1daefc6394027247b10d0efaae1a3 (diff)
downloadgnunet-6342157c3068d482f7f8c02b7229e80eba2c94dc.tar.gz
gnunet-6342157c3068d482f7f8c02b7229e80eba2c94dc.zip
potential fix for #4024
Diffstat (limited to 'src/fs/gnunet-service-fs_pr.h')
-rw-r--r--src/fs/gnunet-service-fs_pr.h73
1 files changed, 46 insertions, 27 deletions
diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h
index 547595b67..0be91fec2 100644
--- a/src/fs/gnunet-service-fs_pr.h
+++ b/src/fs/gnunet-service-fs_pr.h
@@ -222,16 +222,20 @@ typedef void
222struct GSF_PendingRequest * 222struct GSF_PendingRequest *
223GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, 223GSF_pending_request_create_ (enum GSF_PendingRequestOptions options,
224 enum GNUNET_BLOCK_Type type, 224 enum GNUNET_BLOCK_Type type,
225 const struct GNUNET_HashCode * query, 225 const struct GNUNET_HashCode *query,
226 const struct GNUNET_PeerIdentity *target, 226 const struct GNUNET_PeerIdentity *target,
227 const char *bf_data, size_t bf_size, 227 const char *bf_data,
228 uint32_t mingle, uint32_t anonymity_level, 228 size_t bf_size,
229 uint32_t priority, int32_t ttl, 229 uint32_t mingle,
230 uint32_t anonymity_level,
231 uint32_t priority,
232 int32_t ttl,
230 GNUNET_PEER_Id sender_pid, 233 GNUNET_PEER_Id sender_pid,
231 GNUNET_PEER_Id origin_pid, 234 GNUNET_PEER_Id origin_pid,
232 const struct GNUNET_HashCode * replies_seen, 235 const struct GNUNET_HashCode *replies_seen,
233 unsigned int replies_seen_count, 236 unsigned int replies_seen_count,
234 GSF_PendingRequestReplyHandler rh, void *rh_cls); 237 GSF_PendingRequestReplyHandler rh,
238 void *rh_cls);
235 239
236 240
237/** 241/**
@@ -240,11 +244,11 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options,
240 * 244 *
241 * @param pr request to update 245 * @param pr request to update
242 * @param replies_seen hash codes of replies that we've seen 246 * @param replies_seen hash codes of replies that we've seen
243 * @param replies_seen_count size of the replies_seen array 247 * @param replies_seen_count size of the @a replies_seen array
244 */ 248 */
245void 249void
246GSF_pending_request_update_ (struct GSF_PendingRequest *pr, 250GSF_pending_request_update_ (struct GSF_PendingRequest *pr,
247 const struct GNUNET_HashCode * replies_seen, 251 const struct GNUNET_HashCode *replies_seen,
248 unsigned int replies_seen_count); 252 unsigned int replies_seen_count);
249 253
250 254
@@ -259,13 +263,23 @@ GSF_pending_request_get_data_ (struct GSF_PendingRequest *pr);
259 263
260 264
261/** 265/**
266 * Check if the given request is still active.
267 *
268 * @param pr pending request
269 * @return #GNUNET_YES if the request is still active
270 */
271int
272GSF_pending_request_test_active_ (struct GSF_PendingRequest *pr);
273
274
275/**
262 * Test if two pending requests are compatible (would generate 276 * Test if two pending requests are compatible (would generate
263 * the same query modulo filters and should thus be processed 277 * the same query modulo filters and should thus be processed
264 * jointly). 278 * jointly).
265 * 279 *
266 * @param pra a pending request 280 * @param pra a pending request
267 * @param prb another pending request 281 * @param prb another pending request
268 * @return GNUNET_OK if the requests are compatible 282 * @return #GNUNET_OK if the requests are compatible
269 */ 283 */
270int 284int
271GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, 285GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra,
@@ -277,13 +291,14 @@ GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra,
277 * transmission to other peers (or at least determine its size). 291 * transmission to other peers (or at least determine its size).
278 * 292 *
279 * @param pr request to generate the message for 293 * @param pr request to generate the message for
280 * @param buf_size number of bytes available in buf 294 * @param buf_size number of bytes available in @a buf
281 * @param buf where to copy the message (can be NULL) 295 * @param buf where to copy the message (can be NULL)
282 * @return number of bytes needed (if buf_size too small) or used 296 * @return number of bytes needed (if @a buf_size too small) or used
283 */ 297 */
284size_t 298size_t
285GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, 299GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr,
286 size_t buf_size, void *buf); 300 size_t buf_size,
301 void *buf);
287 302
288 303
289/** 304/**
@@ -293,7 +308,8 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr,
293 * @param full_cleanup fully purge the request 308 * @param full_cleanup fully purge the request
294 */ 309 */
295void 310void
296GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, int full_cleanup); 311GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr,
312 int full_cleanup);
297 313
298 314
299/** 315/**
@@ -303,11 +319,12 @@ GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, int full_cleanup);
303 * @param cls closure 319 * @param cls closure
304 * @param key query for the request 320 * @param key query for the request
305 * @param pr handle to the pending request 321 * @param pr handle to the pending request
306 * @return GNUNET_YES to continue to iterate 322 * @return #GNUNET_YES to continue to iterate
307 */ 323 */
308typedef int (*GSF_PendingRequestIterator) (void *cls, 324typedef int
309 const struct GNUNET_HashCode * key, 325(*GSF_PendingRequestIterator) (void *cls,
310 struct GSF_PendingRequest * pr); 326 const struct GNUNET_HashCode *key,
327 struct GSF_PendingRequest *pr);
311 328
312 329
313/** 330/**
@@ -317,7 +334,8 @@ typedef int (*GSF_PendingRequestIterator) (void *cls,
317 * @param cls closure for it 334 * @param cls closure for it
318 */ 335 */
319void 336void
320GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls); 337GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it,
338 void *cls);
321 339
322 340
323/** 341/**
@@ -329,8 +347,8 @@ GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls);
329 * @param cp the other peer involved (sender or receiver, NULL 347 * @param cp the other peer involved (sender or receiver, NULL
330 * for loopback messages where we are both sender and receiver) 348 * for loopback messages where we are both sender and receiver)
331 * @param message the actual message 349 * @param message the actual message
332 * @return GNUNET_OK if the message was well-formed, 350 * @return #GNUNET_OK if the message was well-formed,
333 * GNUNET_SYSERR if the message was malformed (close connection, 351 * #GNUNET_SYSERR if the message was malformed (close connection,
334 * do not cache under any circumstances) 352 * do not cache under any circumstances)
335 */ 353 */
336int 354int
@@ -364,10 +382,10 @@ GSF_cadet_lookup_ (struct GSF_PendingRequest *pr);
364 * @param pr the pending request we were processing 382 * @param pr the pending request we were processing
365 * @param result final datastore lookup result 383 * @param result final datastore lookup result
366 */ 384 */
367typedef void (*GSF_LocalLookupContinuation) (void *cls, 385typedef void
368 struct GSF_PendingRequest * pr, 386(*GSF_LocalLookupContinuation) (void *cls,
369 enum GNUNET_BLOCK_EvaluationResult 387 struct GSF_PendingRequest *pr,
370 result); 388 enum GNUNET_BLOCK_EvaluationResult result);
371 389
372 390
373/** 391/**
@@ -375,11 +393,12 @@ typedef void (*GSF_LocalLookupContinuation) (void *cls,
375 * 393 *
376 * @param pr the pending request to process 394 * @param pr the pending request to process
377 * @param cont function to call at the end 395 * @param cont function to call at the end
378 * @param cont_cls closure for cont 396 * @param cont_cls closure for @a cont
379 */ 397 */
380void 398void
381GSF_local_lookup_ (struct GSF_PendingRequest *pr, 399GSF_local_lookup_ (struct GSF_PendingRequest *pr,
382 GSF_LocalLookupContinuation cont, void *cont_cls); 400 GSF_LocalLookupContinuation cont,
401 void *cont_cls);
383 402
384 403
385/** 404/**
@@ -387,7 +406,7 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr,
387 * 406 *
388 * @param pr request 407 * @param pr request
389 * @param target 408 * @param target
390 * @return GNUNET_YES if this request could be forwarded to the given peer 409 * @return #GNUNET_YES if this request could be forwarded to the given peer
391 */ 410 */
392int 411int
393GSF_pending_request_test_target_ (struct GSF_PendingRequest *pr, 412GSF_pending_request_test_target_ (struct GSF_PendingRequest *pr,