removed fdn parameter from attach and un_attach functions
This commit is contained in:
parent
ef224fb6c2
commit
b0e53bb1fa
@ -3,6 +3,11 @@ $Id$
|
|||||||
|
|
||||||
v0.61.3 25-Jul-2004
|
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
|
v0.61.2 11-Jul-2004 - 25-Jul-2004
|
||||||
|
|
||||||
upgrade:
|
upgrade:
|
||||||
|
24
lib/attach.c
24
lib/attach.c
@ -35,12 +35,8 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Attach a file to the real outbound fo a given node.
|
* 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;
|
FILE *fp;
|
||||||
char *flofile, *thefile;
|
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
|
* 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));
|
flofile = calloc(PATH_MAX, sizeof(char));
|
||||||
thefile = 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.
|
* The real unatach function, return 1 if a file is removed.
|
||||||
*/
|
*/
|
||||||
int check_flo(faddr *, char *, char, int);
|
int check_flo(faddr *, char *, char);
|
||||||
int check_flo(faddr *node, char *filename, char flavor, int fdn)
|
int check_flo(faddr *node, char *filename, char flavor)
|
||||||
{
|
{
|
||||||
char *flofile, *ticfile, *buf;
|
char *flofile, *ticfile, *buf;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -189,7 +185,7 @@ int check_flo(faddr *node, char *filename, char flavor, int fdn)
|
|||||||
fflush(fp);
|
fflush(fp);
|
||||||
fseek(fp, newpos, SEEK_SET);
|
fseek(fp, newpos, SEEK_SET);
|
||||||
filepos = newpos;
|
filepos = newpos;
|
||||||
if (fdn && fgets(buf, PATH_MAX +2, fp)) {
|
if (fgets(buf, PATH_MAX +2, fp)) {
|
||||||
Striplf(buf);
|
Striplf(buf);
|
||||||
if (buf[strlen(buf)-1] == '\r')
|
if (buf[strlen(buf)-1] == '\r')
|
||||||
buf[strlen(buf)-1] = '\0';
|
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.
|
* 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;
|
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);
|
allname = xstrcpy(filename);
|
||||||
base = basename(allname);
|
base = basename(allname);
|
||||||
|
|
||||||
@ -244,8 +240,8 @@ void un_attach(faddr *node, char *filename, int fdn)
|
|||||||
}
|
}
|
||||||
free(allname);
|
free(allname);
|
||||||
|
|
||||||
if (check_flo(node, filename, 'h', fdn) == 0)
|
if (check_flo(node, filename, 'h') == 0)
|
||||||
if (check_flo(node, filename, 'f', fdn) == 0)
|
if (check_flo(node, filename, 'f') == 0)
|
||||||
check_flo(node, filename, 'c', fdn);
|
check_flo(node, filename, 'c');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2114,8 +2114,8 @@ int le_int(int);
|
|||||||
/*
|
/*
|
||||||
* From attach.c
|
* From attach.c
|
||||||
*/
|
*/
|
||||||
int attach(faddr, char *, int, char, int);
|
int attach(faddr, char *, int, char);
|
||||||
void un_attach(faddr *, char *, int);
|
void un_attach(faddr *, char *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ int Add_BBS(qualify **qal)
|
|||||||
for (tmpq = *qal; tmpq; tmpq = tmpq->next) {
|
for (tmpq = *qal; tmpq; tmpq = tmpq->next) {
|
||||||
if (tmpq->send) {
|
if (tmpq->send) {
|
||||||
taka = fido2faddr(tmpq->aka);
|
taka = fido2faddr(tmpq->aka);
|
||||||
un_attach(taka, temp2, TRUE);
|
un_attach(taka, temp2);
|
||||||
tidy_faddr(taka);
|
tidy_faddr(taka);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ void flush_dir(char *ndir)
|
|||||||
FILE *fp, *inf, *ouf;
|
FILE *fp, *inf, *ouf;
|
||||||
faddr noden, *bestaka;
|
faddr noden, *bestaka;
|
||||||
fidoaddr nodenr;
|
fidoaddr nodenr;
|
||||||
int flavor, mode, Attach, fage, first, bread, rc, fdn;
|
int flavor, mode, Attach, fage, first, bread, rc;
|
||||||
long fsize;
|
long fsize;
|
||||||
char *p, *temp, *fname, *arcfile, *pktfile, *ext, maxnr, nr, oldnr, *buf;
|
char *p, *temp, *fname, *arcfile, *pktfile, *ext, maxnr, nr, oldnr, *buf;
|
||||||
time_t Now;
|
time_t Now;
|
||||||
@ -407,7 +407,7 @@ void flush_dir(char *ndir)
|
|||||||
* Attach file to .flo, not for FTP or Directory sessions.
|
* Attach file to .flo, not for FTP or Directory sessions.
|
||||||
*/
|
*/
|
||||||
if (Attach && nodes.Session_out == S_DIRECT)
|
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 = strchr(p, ' ');
|
||||||
p++;
|
p++;
|
||||||
if (strncmp(p, "NOR ", 4) == 0)
|
// Here is a extra now unused keyword.
|
||||||
fdn = FALSE;
|
|
||||||
else if (strncmp(p, "FDN ", 4) == 0)
|
|
||||||
fdn = TRUE;
|
|
||||||
else
|
|
||||||
fdn = FALSE;
|
|
||||||
p = strchr(p, ' ');
|
p = strchr(p, ' ');
|
||||||
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) {
|
if (nodes.Session_out == S_DIRECT) {
|
||||||
attach(noden, p, mode, flavor, fdn);
|
attach(noden, p, mode, flavor);
|
||||||
} else if (nodes.Session_out == S_DIR) {
|
} else if (nodes.Session_out == S_DIR) {
|
||||||
sprintf(arcfile, "%s/%s", nodes.Dir_out_path, Basename(p));
|
sprintf(arcfile, "%s/%s", nodes.Dir_out_path, Basename(p));
|
||||||
if (mode == LEAVE) {
|
if (mode == LEAVE) {
|
||||||
|
Reference in New Issue
Block a user