From e8cfac1462a41aa22c43529df25ae7673ae98a6b Mon Sep 17 00:00:00 2001 From: gardners Date: Thu, 6 Dec 2012 09:42:27 +1030 Subject: [PATCH] don't try mdp fall back when performing an http rhizome direct transfer. --- rhizome_fetch.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rhizome_fetch.c b/rhizome_fetch.c index 3390df79..a8e7a763 100644 --- a/rhizome_fetch.c +++ b/rhizome_fetch.c @@ -1156,6 +1156,20 @@ static int rhizome_fetch_mdp_requestmanifest(struct rhizome_fetch_slot *slot) static int rhizome_fetch_switch_to_mdp(struct rhizome_fetch_slot *slot) { + /* In Rhizome Direct we use the same fetch slot system, but we aren't actually + a running servald instance, so we cannot fall back to MDP. This is detected + by checking if we have a SID for this instance. If not, then we are not a + running servald instance, and we shouldn't try to use MDP. + + Later on we could use MDP, but as a client of a running servald instance, + or with a temporary generated SID, so that we don't end up with two + instances with the same SID. + */ + if (!my_subscriber) { + DEBUGF("I don't have an identity, so we cannot fall back to MDP"); + return rhizome_fetch_close(slot); + } + DEBUGF("Trying to switch to MDP for Rhizome fetch: slot=0x%p",slot); /* close socket and stop watching it */