From bbf7bf0053e02e5785c2c670184f17433277932a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 21 May 2010 07:26:13 +0000 Subject: [PATCH] fix --- TODO | 14 -------------- src/datastore/datastore_api.c | 12 +++++++++++- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/TODO b/TODO index 195eee571..05a3d3289 100644 --- a/TODO +++ b/TODO @@ -12,20 +12,6 @@ May 16 12:49:50 fs-13737 WARNING Could not access indexed file `ENUTBMBR' at off NOTE: corrupted filename in open message NOTE: odd directory name in open message -This calls 'receive' while receive is pending! - -#0 0x00002b53fc14ef45 in *__GI_raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 -#1 0x00002b53fc151d80 in *__GI_abort () at abort.c:88 -#2 0x00002b53fbcda6e4 in GNUNET_CONNECTION_receive (sock=0x2021740, max=65536, timeout=..., receiver=0x2b53fbcd43de , receiver_cls=0x2031880) at connection.c:1180 -#3 0x00002b53fbcd48a5 in GNUNET_CLIENT_receive (sock=0x2031880, handler=0x2b53fb6bc695 , handler_cls=0x208b740, timeout=...) at client.c:535 -#4 0x00002b53fb6bcd8b in GNUNET_DATASTORE_get_next (h=0x2034370, more=1) at datastore_api.c:1237 -#5 0x00002b53fb6bce5b in GNUNET_DATASTORE_cancel (qe=0x208b740) at datastore_api.c:1271 -#6 0x00000000004044c1 in shutdown_task (cls=0x0, tc=0x7fff251a8b00) at gnunet-service-fs.c:1376 -#7 0x00002b53fbcf1f50 in run_ready (sched=0x7fff251a8b70) at scheduler.c:514 -#8 0x00002b53fbcf2360 in GNUNET_SCHEDULER_run (task=0x2b53fbcf77e7 , task_cls=0x7fff251a8e20) at scheduler.c:642 -#9 0x00002b53fbcf86da in GNUNET_SERVICE_run (argc=3, argv=0x7fff251a9048, serviceName=0x409845 "fs", opt=GNUNET_SERVICE_OPTION_NONE, task=0x40801f , task_cls=0x0) at service.c:1404 -#10 0x0000000000408127 in main (argc=3, argv=0x7fff251a9048) at gnunet-service-fs.c:3536 - May 18 10:53:51 transport-8149 WARNING External protocol violation detected at plugin_transport_tcp.c:1275. diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index dfbdd4392..81ceba9e5 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c @@ -214,6 +214,11 @@ struct GNUNET_DATASTORE_Handle */ unsigned int queue_size; + /** + * Are we currently trying to receive from the service? + */ + int in_receive; + }; @@ -535,6 +540,7 @@ transmit_request (void *cls, GNUNET_SCHEDULER_cancel (h->sched, qe->task); qe->task = GNUNET_SCHEDULER_NO_TASK; + h->in_receive = GNUNET_YES; GNUNET_CLIENT_receive (h->client, qe->response_proc, qe, @@ -628,6 +634,7 @@ process_status_message (void *cls, int32_t status; int was_transmitted; + h->in_receive = GNUNET_NO; was_transmitted = qe->was_transmitted; if (msg == NULL) { @@ -1027,6 +1034,7 @@ process_result_message (void *cls, const struct DataMessage *dm; int was_transmitted; + h->in_receive = GNUNET_NO; if (msg == NULL) { was_transmitted = qe->was_transmitted; @@ -1234,6 +1242,7 @@ GNUNET_DATASTORE_get_next (struct GNUNET_DATASTORE_Handle *h, GNUNET_assert (&process_result_message == qe->response_proc); if (GNUNET_YES == more) { + h->in_receive = GNUNET_YES; GNUNET_CLIENT_receive (h->client, qe->response_proc, qe, @@ -1268,7 +1277,8 @@ GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe) if (qe->response_proc == &process_result_message) { qe->qc.rc.iter = NULL; - GNUNET_DATASTORE_get_next (h, GNUNET_YES); + if (GNUNET_YES != h->in_receive) + GNUNET_DATASTORE_get_next (h, GNUNET_YES); return; } reconnect = GNUNET_YES; -- 2.25.1