2 This file is part of GNUnet.
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 * @author Julius Bünger
25 #include "gnunet_util_lib.h"
27 #include "gnunet_rps_service.h"
28 #include "rps-sampler_client.h"
32 #define LOG(kind,...) GNUNET_log_from (kind, "rps-api",__VA_ARGS__)
35 * Handle for a request to get peers from biased stream of ids
37 struct GNUNET_RPS_StreamRequestHandle
40 * The client issuing the request.
42 struct GNUNET_RPS_Handle *rps_handle;
45 * The number of requested peers.
47 uint32_t num_peers_left;
50 * The callback to be called when we receive an answer.
52 GNUNET_RPS_NotifyReadyCB ready_cb;
55 * The closure for the callback.
60 * @brief Next element of the DLL
62 struct GNUNET_RPS_StreamRequestHandle *next;
65 * @brief Previous element of the DLL
67 struct GNUNET_RPS_StreamRequestHandle *prev;
72 * Handler to handle requests from a client.
74 struct GNUNET_RPS_Handle
77 * The handle to the client configuration.
79 const struct GNUNET_CONFIGURATION_Handle *cfg;
82 * The message queue to the client.
84 struct GNUNET_MQ_Handle *mq;
87 * @brief Callback called on each update of the view
89 GNUNET_RPS_NotifyReadyCB view_update_cb;
92 * @brief Closure to each requested update of the view
94 void *view_update_cls;
97 * @brief Closure to each requested peer from the biased stream
99 void *stream_input_cls;
102 * @brief Head of the DLL of stream requests
104 struct GNUNET_RPS_StreamRequestHandle *stream_requests_head;
107 * @brief Tail of the DLL of stream requests
109 struct GNUNET_RPS_StreamRequestHandle *stream_requests_tail;
114 * Handler for a single request from a client.
116 struct GNUNET_RPS_Request_Handle
119 * The client issuing the request.
121 struct GNUNET_RPS_Handle *rps_handle;
124 * The number of requested peers.
126 uint32_t num_requests;
129 * @brief The Sampler for the client request
131 struct RPS_Sampler *sampler;
134 * @brief Request handle of the request to the sampler - needed to cancel the request
136 struct RPS_SamplerRequestHandle *sampler_rh;
139 * @brief Request handle of the request of the biased stream of peers -
140 * needed to cancel the request
142 struct GNUNET_RPS_StreamRequestHandle *srh;
145 * The callback to be called when we receive an answer.
147 GNUNET_RPS_NotifyReadyCB ready_cb;
150 * The closure for the callback.
157 * Struct used to pack the callback, its closure (provided by the caller)
158 * and the connection handler to the service to pass it to a callback function.
163 * Callback provided by the client
165 GNUNET_RPS_NotifyReadyCB cb;
168 * Closure provided by the client
173 * Handle to the service connection
175 struct GNUNET_CLIENT_Connection *service_conn;
180 * @brief Create a new handle for a stream request
182 * @param rps_handle The rps handle
183 * @param num_peers The number of desired peers
184 * @param ready_cb The callback to be called, once all peers are ready
185 * @param cls The colsure to provide to the callback
187 * @return The handle to the stream request
189 static struct GNUNET_RPS_StreamRequestHandle *
190 new_stream_request (struct GNUNET_RPS_Handle *rps_handle,
192 GNUNET_RPS_NotifyReadyCB ready_cb,
195 struct GNUNET_RPS_StreamRequestHandle *srh;
197 srh = GNUNET_new (struct GNUNET_RPS_StreamRequestHandle);
199 srh->rps_handle = rps_handle;
200 srh->num_peers_left = num_peers;
201 srh->ready_cb = ready_cb;
202 srh->ready_cb_cls = cls;
203 GNUNET_CONTAINER_DLL_insert (rps_handle->stream_requests_head,
204 rps_handle->stream_requests_tail,
212 * @brief Remove the given stream request from the list of requests and memory
214 * @param srh The request to be removed
215 * @param srh_head Head of the DLL to remove request from
216 * @param srh_tail Tail of the DLL to remove request from
219 remove_stream_request (struct GNUNET_RPS_StreamRequestHandle *srh,
220 struct GNUNET_RPS_StreamRequestHandle *srh_head,
221 struct GNUNET_RPS_StreamRequestHandle *srh_tail)
223 GNUNET_CONTAINER_DLL_remove (srh_head,
232 * @brief Called once the sampler has collected all requested peers.
234 * Calls the callback provided by the client with the corresponding cls.
236 * @param peers The array of @a num_peers that has been returned.
237 * @param num_peers The number of peers that have been returned
238 * @param cls The #GNUNET_RPS_Request_Handle
241 peers_ready_cb (const struct GNUNET_PeerIdentity *peers,
245 struct GNUNET_RPS_Request_Handle *rh = cls;
247 rh->ready_cb (rh->ready_cb_cls,
250 // TODO cleanup, sampler, rh, cancel stuff
251 // TODO screw this function. We can give the cb,cls directly to the sampler.
256 * @brief Callback to collect the peers from the biased stream and put those
259 * @param cls The #GNUNET_RPS_Request_Handle
260 * @param num_peers The number of peer that have been returned
261 * @param peers The array of @a num_peers that have been returned
264 collect_peers_cb (void *cls,
266 const struct GNUNET_PeerIdentity *peers)
268 struct GNUNET_RPS_Request_Handle *rh = cls;
270 for (uint64_t i = 0; i < num_peers; i++)
272 RPS_sampler_update (rh->sampler, &peers[i]);
278 * @brief Create new request handle
280 * @param rps_handle Handle to the service
281 * @param num_requests Number of requests
282 * @param ready_cb Callback
285 * @return The newly created request handle
287 static struct GNUNET_RPS_Request_Handle *
288 new_request_handle (struct GNUNET_RPS_Handle *rps_handle,
289 uint64_t num_requests,
290 GNUNET_RPS_NotifyReadyCB ready_cb,
293 struct GNUNET_RPS_Request_Handle *rh;
295 rh = GNUNET_new (struct GNUNET_RPS_Request_Handle);
296 rh->rps_handle = rps_handle;
297 rh->num_requests = num_requests;
298 rh->sampler = RPS_sampler_mod_init (num_requests,
299 GNUNET_TIME_UNIT_SECONDS); // TODO remove this time-stuff
300 rh->sampler_rh = RPS_sampler_get_n_rand_peers (rh->sampler,
304 rh->srh = GNUNET_RPS_stream_request (rps_handle,
305 0, /* infinite updates */
308 rh->ready_cb = ready_cb;
309 rh->ready_cb_cls = cls;
315 /* Get internals for debugging/profiling purposes */
318 * Request updates of view
320 * @param rps_handle handle to the rps service
321 * @param num_req_peers number of peers we want to receive
322 * (0 for infinite updates)
323 * @param cls a closure that will be given to the callback
324 * @param ready_cb the callback called when the peers are available
327 GNUNET_RPS_view_request (struct GNUNET_RPS_Handle *rps_handle,
328 uint32_t num_updates,
329 GNUNET_RPS_NotifyReadyCB view_update_cb,
332 struct GNUNET_MQ_Envelope *ev;
333 struct GNUNET_RPS_CS_DEBUG_ViewRequest *msg;
335 LOG (GNUNET_ERROR_TYPE_DEBUG,
336 "Client requests %" PRIu32 " view updates\n",
338 rps_handle->view_update_cb = view_update_cb;
339 rps_handle->view_update_cls = cls;
341 ev = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_RPS_CS_DEBUG_VIEW_REQUEST);
342 msg->num_updates = htonl (num_updates);
343 GNUNET_MQ_send (rps_handle->mq, ev);
348 GNUNET_RPS_view_request_cancel (struct GNUNET_RPS_Handle *rps_handle)
350 struct GNUNET_MQ_Envelope *ev;
352 GNUNET_assert (NULL != rps_handle->view_update_cb);
354 rps_handle->view_update_cb = NULL;
356 ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_RPS_CS_DEBUG_VIEW_CANCEL);
357 GNUNET_MQ_send (rps_handle->mq, ev);
362 * Request biased stream of peers that are being put into the sampler
364 * @param rps_handle handle to the rps service
365 * @param num_req_peers number of peers we want to receive
366 * (0 for infinite updates)
367 * @param cls a closure that will be given to the callback
368 * @param ready_cb the callback called when the peers are available
370 struct GNUNET_RPS_StreamRequestHandle *
371 GNUNET_RPS_stream_request (struct GNUNET_RPS_Handle *rps_handle,
373 GNUNET_RPS_NotifyReadyCB stream_input_cb,
376 struct GNUNET_RPS_StreamRequestHandle *srh;
377 struct GNUNET_MQ_Envelope *ev;
378 struct GNUNET_RPS_CS_DEBUG_StreamRequest *msg;
380 srh = new_stream_request (rps_handle,
381 num_peers, /* num requests */
384 LOG (GNUNET_ERROR_TYPE_DEBUG,
385 "Client requests %" PRIu32 " biased stream updates\n",
388 ev = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_RPS_CS_DEBUG_STREAM_REQUEST);
389 GNUNET_MQ_send (rps_handle->mq, ev);
395 * This function is called, when the service updates the view.
396 * It verifies that @a msg is well-formed.
398 * @param cls the closure
399 * @param msg the message
400 * @return #GNUNET_OK if @a msg is well-formed
403 check_view_update (void *cls,
404 const struct GNUNET_RPS_CS_DEBUG_ViewReply *msg)
406 uint16_t msize = ntohs (msg->header.size);
407 uint32_t num_peers = ntohl (msg->num_peers);
410 msize -= sizeof (struct GNUNET_RPS_CS_DEBUG_ViewReply);
411 if ( (msize / sizeof (struct GNUNET_PeerIdentity) != num_peers) ||
412 (msize % sizeof (struct GNUNET_PeerIdentity) != 0) )
415 return GNUNET_SYSERR;
422 * This function is called, when the service updated its view.
423 * It calls the callback the caller provided
424 * and disconnects afterwards.
426 * @param msg the message
429 handle_view_update (void *cls,
430 const struct GNUNET_RPS_CS_DEBUG_ViewReply *msg)
432 struct GNUNET_RPS_Handle *h = cls;
433 struct GNUNET_PeerIdentity *peers;
435 /* Give the peers back */
436 LOG (GNUNET_ERROR_TYPE_DEBUG,
437 "New view of %" PRIu32 " peers:\n",
438 ntohl (msg->num_peers));
440 peers = (struct GNUNET_PeerIdentity *) &msg[1];
441 GNUNET_assert (NULL != h);
442 GNUNET_assert (NULL != h->view_update_cb);
443 h->view_update_cb (h->view_update_cls, ntohl (msg->num_peers), peers);
448 * @brief Send message to service that this client does not want to receive
449 * further updates from the biased peer stream
451 * @param rps_handle The handle representing the service to the client
454 cancel_stream (struct GNUNET_RPS_Handle *rps_handle)
456 struct GNUNET_MQ_Envelope *ev;
458 ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_RPS_CS_DEBUG_STREAM_CANCEL);
459 GNUNET_MQ_send (rps_handle->mq, ev);
464 * @brief Cancel a specific request for updates from the biased peer stream
466 * @param srh The request handle to cancel
469 GNUNET_RPS_stream_cancel (struct GNUNET_RPS_StreamRequestHandle *srh)
471 struct GNUNET_RPS_Handle *rps_handle;
473 rps_handle = srh->rps_handle;
474 GNUNET_CONTAINER_DLL_remove (rps_handle->stream_requests_head,
475 rps_handle->stream_requests_tail,
478 if (NULL == rps_handle->stream_requests_head) cancel_stream (rps_handle);
483 * This function is called, when the service sends another peer from the biased
485 * It calls the callback the caller provided
486 * and disconnects afterwards.
488 * TODO merge with check_view_update
490 * @param msg the message
493 check_stream_input (void *cls,
494 const struct GNUNET_RPS_CS_DEBUG_StreamReply *msg)
496 uint16_t msize = ntohs (msg->header.size);
497 uint32_t num_peers = ntohl (msg->num_peers);
500 msize -= sizeof (struct GNUNET_RPS_CS_DEBUG_StreamReply);
501 if ( (msize / sizeof (struct GNUNET_PeerIdentity) != num_peers) ||
502 (msize % sizeof (struct GNUNET_PeerIdentity) != 0) )
505 return GNUNET_SYSERR;
511 * This function is called, when the service sends another peer from the biased
513 * It calls the callback the caller provided
514 * and disconnects afterwards.
516 * @param msg the message
519 handle_stream_input (void *cls,
520 const struct GNUNET_RPS_CS_DEBUG_StreamReply *msg)
522 struct GNUNET_RPS_Handle *h = cls;
523 const struct GNUNET_PeerIdentity *peers;
524 /* The following two pointers are used to prevent that new handles are
525 * inserted into the DLL, that is currently iterated over, from within a call
526 * to that handler_cb, are executed and in turn again add themselves to the
527 * iterated DLL infinitely */
528 struct GNUNET_RPS_StreamRequestHandle *srh_head_tmp;
529 struct GNUNET_RPS_StreamRequestHandle *srh_tail_tmp;
531 uint64_t num_peers_return;
533 peers = (struct GNUNET_PeerIdentity *) &msg[1];
534 num_peers = ntohl (msg->num_peers);
535 LOG (GNUNET_ERROR_TYPE_DEBUG,
536 "Received %" PRIu64 " peer(s) from stream input.\n",
538 srh_head_tmp = h->stream_requests_head;
539 srh_tail_tmp = h->stream_requests_tail;
540 h->stream_requests_head = NULL;
541 h->stream_requests_tail = NULL;
542 for (struct GNUNET_RPS_StreamRequestHandle *srh_iter = srh_head_tmp;
544 srh_iter = srh_iter->next)
546 LOG (GNUNET_ERROR_TYPE_DEBUG,
547 "Calling srh - left: %" PRIu64 "\n",
548 srh_iter->num_peers_left);
549 if (0 == srh_iter->num_peers_left) /* infinite updates */
551 num_peers_return = num_peers;
553 else if (num_peers > srh_iter->num_peers_left)
555 num_peers_return = num_peers - srh_iter->num_peers_left;
557 else /* num_peers <= srh_iter->num_peers_left */
559 num_peers_return = srh_iter->num_peers_left - num_peers;
561 srh_iter->ready_cb (srh_iter->ready_cb_cls,
564 if (0 == srh_iter->num_peers_left) ;
565 else if (num_peers_return >= srh_iter->num_peers_left)
567 remove_stream_request (srh_iter,
573 srh_iter->num_peers_left -= num_peers_return;
576 for (struct GNUNET_RPS_StreamRequestHandle *srh_iter = srh_head_tmp;
578 srh_iter = srh_iter->next)
580 GNUNET_CONTAINER_DLL_insert (h->stream_requests_head,
581 h->stream_requests_tail,
585 if (NULL == h->stream_requests_head)
593 * Reconnect to the service
596 reconnect (struct GNUNET_RPS_Handle *h);
600 * Error handler for mq.
602 * This function is called whan mq encounters an error.
603 * Until now mq doesn't provide useful error messages.
605 * @param cls the closure
606 * @param error error code without specyfied meaning
609 mq_error_handler (void *cls,
610 enum GNUNET_MQ_Error error)
612 struct GNUNET_RPS_Handle *h = cls;
614 LOG (GNUNET_ERROR_TYPE_WARNING, "Problem with message queue. error: %i\n\
620 /* Resend all pending request as the service destroyed its knowledge
626 * Reconnect to the service
629 reconnect (struct GNUNET_RPS_Handle *h)
631 struct GNUNET_MQ_MessageHandler mq_handlers[] = {
632 GNUNET_MQ_hd_var_size (view_update,
633 GNUNET_MESSAGE_TYPE_RPS_CS_DEBUG_VIEW_REPLY,
634 struct GNUNET_RPS_CS_DEBUG_ViewReply,
636 GNUNET_MQ_hd_var_size (stream_input,
637 GNUNET_MESSAGE_TYPE_RPS_CS_DEBUG_STREAM_REPLY,
638 struct GNUNET_RPS_CS_DEBUG_StreamReply,
640 GNUNET_MQ_handler_end ()
644 GNUNET_MQ_destroy (h->mq);
645 h->mq = GNUNET_CLIENT_connect (h->cfg,
654 * Connect to the rps service
656 * @param cfg configuration to use
657 * @return a handle to the service
659 struct GNUNET_RPS_Handle *
660 GNUNET_RPS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
662 struct GNUNET_RPS_Handle *h;
664 h = GNUNET_new (struct GNUNET_RPS_Handle);
677 * Request n random peers.
679 * @param rps_handle handle to the rps service
680 * @param num_req_peers number of peers we want to receive
681 * @param ready_cb the callback called when the peers are available
682 * @param cls closure given to the callback
683 * @return a handle to cancel this request
685 struct GNUNET_RPS_Request_Handle *
686 GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *rps_handle,
687 uint32_t num_req_peers,
688 GNUNET_RPS_NotifyReadyCB ready_cb,
691 struct GNUNET_RPS_Request_Handle *rh;
693 rh = new_request_handle (rps_handle,
704 * Seed rps service with peerIDs.
706 * @param h handle to the rps service
707 * @param n number of peers to seed
708 * @param ids the ids of the peers seeded
711 GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h,
713 const struct GNUNET_PeerIdentity *ids)
716 uint32_t num_peers_max;
717 const struct GNUNET_PeerIdentity *tmp_peer_pointer;
718 struct GNUNET_MQ_Envelope *ev;
719 struct GNUNET_RPS_CS_SeedMessage *msg;
723 LOG (GNUNET_ERROR_TYPE_DEBUG,
724 "Client wants to seed %" PRIu32 " peers:\n",
726 for (i = 0 ; i < n ; i++)
727 LOG (GNUNET_ERROR_TYPE_DEBUG,
730 GNUNET_i2s (&ids[i]));
732 /* The actual size the message occupies */
733 size_needed = sizeof (struct GNUNET_RPS_CS_SeedMessage) +
734 n * sizeof (struct GNUNET_PeerIdentity);
735 /* The number of peers that fits in one message together with
736 * the respective header */
737 num_peers_max = (GNUNET_MAX_MESSAGE_SIZE -
738 sizeof (struct GNUNET_RPS_CS_SeedMessage)) /
739 sizeof (struct GNUNET_PeerIdentity);
740 tmp_peer_pointer = ids;
742 while (GNUNET_MAX_MESSAGE_SIZE < size_needed)
744 ev = GNUNET_MQ_msg_extra (msg, num_peers_max * sizeof (struct GNUNET_PeerIdentity),
745 GNUNET_MESSAGE_TYPE_RPS_CS_SEED);
746 msg->num_peers = htonl (num_peers_max);
747 GNUNET_memcpy (&msg[1], tmp_peer_pointer, num_peers_max * sizeof (struct GNUNET_PeerIdentity));
748 GNUNET_MQ_send (h->mq, ev);
751 size_needed = sizeof (struct GNUNET_RPS_CS_SeedMessage) +
752 n * sizeof (struct GNUNET_PeerIdentity);
753 /* Set pointer to beginning of next block of num_peers_max peers */
754 tmp_peer_pointer = &ids[num_peers_max];
757 ev = GNUNET_MQ_msg_extra (msg, n * sizeof (struct GNUNET_PeerIdentity),
758 GNUNET_MESSAGE_TYPE_RPS_CS_SEED);
759 msg->num_peers = htonl (n);
760 GNUNET_memcpy (&msg[1], tmp_peer_pointer, n * sizeof (struct GNUNET_PeerIdentity));
762 GNUNET_MQ_send (h->mq, ev);
766 #ifdef ENABLE_MALICIOUS
768 * Turn RPS service to act malicious.
770 * @param h handle to the rps service
771 * @param type which type of malicious peer to turn to.
772 * 0 Don't act malicious at all
773 * 1 Try to maximise representation
774 * 2 Try to partition the network
775 * (isolate one peer from the rest)
776 * @param n number of @a ids
777 * @param ids the ids of the malicious peers
778 * if @type is 2 the last id is the id of the
779 * peer to be isolated from the rest
782 GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h,
785 const struct GNUNET_PeerIdentity *peer_ids,
786 const struct GNUNET_PeerIdentity *target_peer)
789 uint32_t num_peers_max;
790 const struct GNUNET_PeerIdentity *tmp_peer_pointer;
791 struct GNUNET_MQ_Envelope *ev;
792 struct GNUNET_RPS_CS_ActMaliciousMessage *msg;
796 LOG (GNUNET_ERROR_TYPE_DEBUG,
797 "Client turns malicious (type %" PRIu32 ") with %" PRIu32 " other peers:\n",
800 for (i = 0 ; i < num_peers ; i++)
801 LOG (GNUNET_ERROR_TYPE_DEBUG,
804 GNUNET_i2s (&peer_ids[i]));
806 /* The actual size the message would occupy */
807 size_needed = sizeof (struct GNUNET_RPS_CS_SeedMessage) +
808 num_peers * sizeof (struct GNUNET_PeerIdentity);
809 /* The number of peers that fit in one message together with
810 * the respective header */
811 num_peers_max = (GNUNET_MAX_MESSAGE_SIZE -
812 sizeof (struct GNUNET_RPS_CS_SeedMessage)) /
813 sizeof (struct GNUNET_PeerIdentity);
814 tmp_peer_pointer = peer_ids;
816 while (GNUNET_MAX_MESSAGE_SIZE < size_needed)
818 LOG (GNUNET_ERROR_TYPE_DEBUG,
819 "Too many peers to send at once, sending %" PRIu32 " (all we can so far)\n",
821 ev = GNUNET_MQ_msg_extra (msg,
822 num_peers_max * sizeof (struct GNUNET_PeerIdentity),
823 GNUNET_MESSAGE_TYPE_RPS_ACT_MALICIOUS);
824 msg->type = htonl (type);
825 msg->num_peers = htonl (num_peers_max);
828 msg->attacked_peer = peer_ids[num_peers];
829 GNUNET_memcpy (&msg[1],
831 num_peers_max * sizeof (struct GNUNET_PeerIdentity));
833 GNUNET_MQ_send (h->mq, ev);
835 num_peers -= num_peers_max;
836 size_needed = sizeof (struct GNUNET_RPS_CS_SeedMessage) +
837 num_peers * sizeof (struct GNUNET_PeerIdentity);
838 /* Set pointer to beginning of next block of num_peers_max peers */
839 tmp_peer_pointer = &peer_ids[num_peers_max];
842 ev = GNUNET_MQ_msg_extra (msg,
843 num_peers * sizeof (struct GNUNET_PeerIdentity),
844 GNUNET_MESSAGE_TYPE_RPS_ACT_MALICIOUS);
845 msg->type = htonl (type);
846 msg->num_peers = htonl (num_peers);
849 msg->attacked_peer = *target_peer;
850 GNUNET_memcpy (&msg[1], tmp_peer_pointer, num_peers * sizeof (struct GNUNET_PeerIdentity));
852 GNUNET_MQ_send (h->mq, ev);
854 #endif /* ENABLE_MALICIOUS */
858 * Cancle an issued request.
860 * @param rh request handle of request to cancle
863 GNUNET_RPS_request_cancel (struct GNUNET_RPS_Request_Handle *rh)
865 struct GNUNET_RPS_Handle *h;
870 remove_stream_request (rh->srh,
871 h->stream_requests_head,
872 h->stream_requests_tail);
874 if (NULL == h->stream_requests_head) cancel_stream(h);
875 if (NULL != rh->sampler_rh)
877 RPS_sampler_request_cancel (rh->sampler_rh);
879 RPS_sampler_destroy (rh->sampler);
885 * Disconnect from the rps service
887 * @param h the handle to the rps service
890 GNUNET_RPS_disconnect (struct GNUNET_RPS_Handle *h)
892 GNUNET_MQ_destroy (h->mq);
893 if (NULL != h->stream_requests_head)
895 LOG (GNUNET_ERROR_TYPE_WARNING,
896 "Still waiting for replies\n");
898 if (NULL != h->view_update_cb)
900 LOG (GNUNET_ERROR_TYPE_WARNING,
901 "Still waiting for view updates\n");
907 /* end of rps_api.c */