* @param cls handle to connected peer entry
* @param record peerstore record information
* @param emsg error message, or NULL if no errors
- * @return #GNUNET_NO to stop iterating since we only expect 0 or 1 records
*/
-static int
+static void
peer_respect_cb (void *cls,
const struct GNUNET_PEERSTORE_Record *record,
const char *emsg)
struct GSF_ConnectedPeer *cp = cls;
GNUNET_assert (NULL != cp->respect_iterate_req);
- cp->respect_iterate_req = NULL;
+ printf("Got a record!\n");
if ((NULL != record) && (sizeof (cp->disk_respect) == record->value_size))
cp->disk_respect = cp->ppd.respect = *((uint32_t *)record->value);
GSF_push_start_ (cp);
if (NULL != cp->creation_cb)
cp->creation_cb (cp->creation_cb_cls, cp);
- return GNUNET_NO;
+ if (NULL != record)
+ {
+ printf("Cancelling!\n");
+ GNUNET_PEERSTORE_iterate_cancel (cp->respect_iterate_req);
+ cp->respect_iterate_req = NULL;
+ }
}
* @param cls closure
* @param record peerstore record information
* @param emsg error message, or NULL if no errors
- * @return #GNUNET_YES to continue iterating, #GNUNET_NO to stop
*/
-typedef int
+typedef void
(*GNUNET_PEERSTORE_Processor) (void *cls,
const struct GNUNET_PEERSTORE_Record *record,
const char *emsg);
* @param emsg error message or NULL if no errors
* @return #GNUNET_YES to continue iteration
*/
-static int
+static void
record_iterator (void *cls, const struct GNUNET_PEERSTORE_Record *record,
const char *emsg)
{
GNUNET_SERVER_receive_done (cls_record->client,
NULL == emsg ? GNUNET_OK : GNUNET_SYSERR);
PEERSTORE_destroy_record (cls_record);
- return GNUNET_NO;
+ return;
}
srm =
(struct GNUNET_MessageHeader *)
srm, GNUNET_NO);
GNUNET_free (srm);
- return GNUNET_YES;
}
void *callback_cls;
uint16_t msg_type;
struct GNUNET_PEERSTORE_Record *record;
- int continue_iter;
ic = h->iterate_head;
if (NULL == ic)
{
record = PEERSTORE_parse_record_message (msg);
if (NULL == record)
- continue_iter =
- callback (callback_cls, NULL,
+ callback (callback_cls, NULL,
_("Received a malformed response from service."));
else
{
- continue_iter = callback (callback_cls, record, NULL);
+ callback (callback_cls, record, NULL);
PEERSTORE_destroy_record (record);
}
- if (GNUNET_NO == continue_iter)
- ic->callback = NULL;
}
}