From 0994b1f86f0bed0e26931bf6898bf012b670f16c Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Wed, 13 Nov 2002 21:34:28 +0000 Subject: [PATCH] Another seenby experiment --- mbfido/forward.c | 2 ++ mbfido/ptic.c | 30 +++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/mbfido/forward.c b/mbfido/forward.c index 8ec0f04e..c31c3c9f 100644 --- a/mbfido/forward.c +++ b/mbfido/forward.c @@ -328,6 +328,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl) WriteError("$Can't create %s", fname); } } + Syslog('p', "Forward almost done"); fsync(fileno(fl)); fclose(fl); @@ -343,6 +344,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl) free(queuedir); free(listfile); tidy_faddr(routeto); + Syslog('p', "Forward really done"); } diff --git a/mbfido/ptic.c b/mbfido/ptic.c index b1348edc..1f24018e 100644 --- a/mbfido/ptic.c +++ b/mbfido/ptic.c @@ -731,10 +731,23 @@ int ProcessTic(fa_list *sbl) * Add all our system aka's to the seenby lines in the same zone */ for (i = 0; i < 40; i++) { - if (CFG.akavalid[i] && (tic.Aka.zone == CFG.aka[i].zone) /* && - !((tic.Aka.net == CFG.aka[i].net) && (tic.Aka.node == CFG.aka[i].node)) */) { - sprintf(sbe, "%u:%u/%u", CFG.aka[i].zone, CFG.aka[i].net, CFG.aka[i].node); - fill_list(&sbl, sbe, NULL); + if (TIC.TicIn.Hatch) { + /* + * Hatched file, add all aka's + */ + if (CFG.akavalid[i] && (tic.Aka.zone == CFG.aka[i].zone)) { + sprintf(sbe, "%u:%u/%u", CFG.aka[i].zone, CFG.aka[i].net, CFG.aka[i].node); + fill_list(&sbl, sbe, NULL); + } + } else { + /* + * Incoming file, don't add the aka already in the ticfile of our system. + */ + if (CFG.akavalid[i] && (tic.Aka.zone == CFG.aka[i].zone) && + !((tic.Aka.net == CFG.aka[i].net) && (tic.Aka.node == CFG.aka[i].node))) { + sprintf(sbe, "%u:%u/%u", CFG.aka[i].zone, CFG.aka[i].net, CFG.aka[i].node); + fill_list(&sbl, sbe, NULL); + } } } @@ -761,14 +774,20 @@ int ProcessTic(fa_list *sbl) while (GetTicSystem(&Link, First)) { First = FALSE; if ((Link.aka.zone) && (Link.sendto) && (!Link.pause)) { + Syslog('p', "Forward loop to %s", aka2str(Link.aka)); if (!((TIC.Aka.zone == Link.aka.zone) && (TIC.Aka.net == Link.aka.net) && (TIC.Aka.node == Link.aka.node) && (TIC.Aka.point == Link.aka.point))) { + Syslog('p', "Will send"); tic_out++; ForwardFile(Link.aka, sbl); - } + Syslog('p', "Did send"); + } else { + Syslog('p', "Will not send"); + } } } } + Syslog('p', "Forwarding to all nodes done"); Magic_ExecCommand(); Magic_CopyFile(); @@ -779,6 +798,7 @@ int ProcessTic(fa_list *sbl) unlink(Temp); free(Temp); + Syslog('p', "ptic() done"); return 0; }