[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37211 - in gnunet/src: fs include peerstore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37211 - in gnunet/src: fs include peerstore |
Date: |
Sun, 29 May 2016 13:19:50 +0200 |
Author: schanzen
Date: 2016-05-29 13:19:50 +0200 (Sun, 29 May 2016)
New Revision: 37211
Modified:
gnunet/src/fs/gnunet-service-fs_cp.c
gnunet/src/include/gnunet_peerstore_service.h
gnunet/src/peerstore/gnunet-service-peerstore.c
gnunet/src/peerstore/peerstore_api.c
Log:
- Fix #4532
Modified: gnunet/src/fs/gnunet-service-fs_cp.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_cp.c 2016-05-27 13:51:30 UTC (rev
37210)
+++ gnunet/src/fs/gnunet-service-fs_cp.c 2016-05-29 11:19:50 UTC (rev
37211)
@@ -605,9 +605,8 @@
* @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)
@@ -615,13 +614,18 @@
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;
+ }
}
Modified: gnunet/src/include/gnunet_peerstore_service.h
===================================================================
--- gnunet/src/include/gnunet_peerstore_service.h 2016-05-27 13:51:30 UTC
(rev 37210)
+++ gnunet/src/include/gnunet_peerstore_service.h 2016-05-29 11:19:50 UTC
(rev 37211)
@@ -133,9 +133,8 @@
* @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);
Modified: gnunet/src/peerstore/gnunet-service-peerstore.c
===================================================================
--- gnunet/src/peerstore/gnunet-service-peerstore.c 2016-05-27 13:51:30 UTC
(rev 37210)
+++ gnunet/src/peerstore/gnunet-service-peerstore.c 2016-05-29 11:19:50 UTC
(rev 37211)
@@ -251,7 +251,7 @@
* @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)
{
@@ -270,7 +270,7 @@
GNUNET_SERVER_receive_done (cls_record->client,
NULL == emsg ? GNUNET_OK : GNUNET_SYSERR);
PEERSTORE_destroy_record (cls_record);
- return GNUNET_NO;
+ return;
}
srm =
@@ -282,7 +282,6 @@
(struct GNUNET_MessageHeader *)
srm, GNUNET_NO);
GNUNET_free (srm);
- return GNUNET_YES;
}
Modified: gnunet/src/peerstore/peerstore_api.c
===================================================================
--- gnunet/src/peerstore/peerstore_api.c 2016-05-27 13:51:30 UTC (rev
37210)
+++ gnunet/src/peerstore/peerstore_api.c 2016-05-29 11:19:50 UTC (rev
37211)
@@ -670,7 +670,6 @@
void *callback_cls;
uint16_t msg_type;
struct GNUNET_PEERSTORE_Record *record;
- int continue_iter;
ic = h->iterate_head;
if (NULL == ic)
@@ -704,16 +703,13 @@
{
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;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37211 - in gnunet/src: fs include peerstore,
gnunet <=