From: Christian Grothoff Date: Thu, 21 May 2015 10:07:58 +0000 (+0000) Subject: with respect to #3615: we might (theoretically) get a migration stop before we finish... X-Git-Tag: initial-import-from-subversion-38251~1881 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7fb5550c4dd74db2bc71ec188a645697416ebb11;p=oweals%2Fgnunet.git with respect to #3615: we might (theoretically) get a migration stop before we finished the peerstore lookup; in that case, we would do a GSF_push_start() twice (once via revive migration, and once from peerstore lookup succeeding), and then on disconnect only stop once, keeping the migration going for a disconnected peer. That still does not explain the bug report, as the '*cp' in the report doesn't show BADFOOD, and we'd expect a free'd cp in this case to be used for the transmission. Still, this is a possible issue which can be fixed by ignoring migration stop messages until after peerstore lookup succeeded --- diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 708308f7f..5dcd7689e 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c @@ -741,7 +741,8 @@ GSF_handle_p2p_migration_stop_ (void *cls, GNUNET_i2s (other), GNUNET_STRINGS_relative_time_to_string (bt, GNUNET_YES)); cp->ppd.migration_blocked_until = GNUNET_TIME_relative_to_absolute (bt); - if (NULL == cp->mig_revive_task) + if ( (NULL == cp->mig_revive_task) && + (NULL == cp->respect_iterate_req) ) { GSF_push_stop_ (cp); cp->mig_revive_task = diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c index d1bdad1d5..73813c68e 100644 --- a/src/fs/gnunet-service-fs_push.c +++ b/src/fs/gnunet-service-fs_push.c @@ -611,6 +611,7 @@ GSF_push_start_ (struct GSF_ConnectedPeer *peer) break; if (NULL != mrp) { + /* same peer added twice, must not happen */ GNUNET_break (0); return; }