removed fdn parameter from attach and un_attach functions

This commit is contained in:
Michiel Broek 2004-07-29 19:07:15 +00:00
parent ef224fb6c2
commit b0e53bb1fa
5 changed files with 23 additions and 27 deletions

View File

@ -3,6 +3,11 @@ $Id$
v0.61.3 25-Jul-2004
libmbse.a:
Removed the fdn parameter from the attach and un_attach
functions, not needed anymore.
v0.61.2 11-Jul-2004 - 25-Jul-2004
upgrade:

View File

@ -35,12 +35,8 @@
/*
* Attach a file to the real outbound fo a given node.
* If fdn == TRUE, the the file is a forwarded tic file, then
* make sure to see if there was an old file with the same name
* that the old attach is removed including the .tic file so
* that we will send the new file with the right .tic file.
*/
int attach(faddr noden, char *ofile, int mode, char flavor, int fdn)
int attach(faddr noden, char *ofile, int mode, char flavor)
{
FILE *fp;
char *flofile, *thefile;
@ -57,7 +53,7 @@ int attach(faddr noden, char *ofile, int mode, char flavor, int fdn)
/*
* Check if we attach a file with the same name
*/
un_attach(&noden, ofile, fdn);
un_attach(&noden, ofile);
flofile = calloc(PATH_MAX, sizeof(char));
thefile = calloc(PATH_MAX, sizeof(char));
@ -159,8 +155,8 @@ int is_my_tic(char *filename, char *ticfile)
/*
* The real unatach function, return 1 if a file is removed.
*/
int check_flo(faddr *, char *, char, int);
int check_flo(faddr *node, char *filename, char flavor, int fdn)
int check_flo(faddr *, char *, char);
int check_flo(faddr *node, char *filename, char flavor)
{
char *flofile, *ticfile, *buf;
FILE *fp;
@ -189,7 +185,7 @@ int check_flo(faddr *node, char *filename, char flavor, int fdn)
fflush(fp);
fseek(fp, newpos, SEEK_SET);
filepos = newpos;
if (fdn && fgets(buf, PATH_MAX +2, fp)) {
if (fgets(buf, PATH_MAX +2, fp)) {
Striplf(buf);
if (buf[strlen(buf)-1] == '\r')
buf[strlen(buf)-1] = '\0';
@ -225,11 +221,11 @@ int check_flo(faddr *node, char *filename, char flavor, int fdn)
/*
* Remove a file from the flofile, also search for a .tic file.
*/
void un_attach(faddr *node, char *filename, int fdn)
void un_attach(faddr *node, char *filename)
{
char *base, *allname;
Syslog('p', "un_attach: %s %s %s", ascfnode(node, 0x1f), filename, fdn ?"FDN":"NOR");
Syslog('p', "un_attach: %s %s %s", ascfnode(node, 0x1f), filename);
allname = xstrcpy(filename);
base = basename(allname);
@ -244,8 +240,8 @@ void un_attach(faddr *node, char *filename, int fdn)
}
free(allname);
if (check_flo(node, filename, 'h', fdn) == 0)
if (check_flo(node, filename, 'f', fdn) == 0)
check_flo(node, filename, 'c', fdn);
if (check_flo(node, filename, 'h') == 0)
if (check_flo(node, filename, 'f') == 0)
check_flo(node, filename, 'c');
}

View File

@ -2114,8 +2114,8 @@ int le_int(int);
/*
* From attach.c
*/
int attach(faddr, char *, int, char, int);
void un_attach(faddr *, char *, int);
int attach(faddr, char *, int, char);
void un_attach(faddr *, char *);

View File

@ -292,7 +292,7 @@ int Add_BBS(qualify **qal)
for (tmpq = *qal; tmpq; tmpq = tmpq->next) {
if (tmpq->send) {
taka = fido2faddr(tmpq->aka);
un_attach(taka, temp2, TRUE);
un_attach(taka, temp2);
tidy_faddr(taka);
}
}

View File

@ -70,7 +70,7 @@ void flush_dir(char *ndir)
FILE *fp, *inf, *ouf;
faddr noden, *bestaka;
fidoaddr nodenr;
int flavor, mode, Attach, fage, first, bread, rc, fdn;
int flavor, mode, Attach, fage, first, bread, rc;
long fsize;
char *p, *temp, *fname, *arcfile, *pktfile, *ext, maxnr, nr, oldnr, *buf;
time_t Now;
@ -407,7 +407,7 @@ void flush_dir(char *ndir)
* Attach file to .flo, not for FTP or Directory sessions.
*/
if (Attach && nodes.Session_out == S_DIRECT)
attach(noden, arcfile, TFS, flavor, FALSE);
attach(noden, arcfile, TFS, flavor);
}
/*
@ -551,18 +551,13 @@ void flush_dir(char *ndir)
}
p = strchr(p, ' ');
p++;
if (strncmp(p, "NOR ", 4) == 0)
fdn = FALSE;
else if (strncmp(p, "FDN ", 4) == 0)
fdn = TRUE;
else
fdn = FALSE;
// Here is a extra now unused keyword.
p = strchr(p, ' ');
p++;
Syslog('p', "File attach (fdn=%s) %s to %s", fdn?"True":"False", p, ascfnode(&noden, 0x1f));
Syslog('p', "File attach %s to %s", p, ascfnode(&noden, 0x1f));
if (nodes.Session_out == S_DIRECT) {
attach(noden, p, mode, flavor, fdn);
attach(noden, p, mode, flavor);
} else if (nodes.Session_out == S_DIR) {
sprintf(arcfile, "%s/%s", nodes.Dir_out_path, Basename(p));
if (mode == LEAVE) {