Added message splitting for areamgr/filemgr mails

This commit is contained in:
Michiel Broek 2002-03-02 23:07:30 +00:00
parent 4f5c7d9201
commit 42b41acfa6
4 changed files with 106 additions and 5 deletions

View File

@ -4644,6 +4644,8 @@ v0.33.20 10-Feb-2002
display the aka to which they are connected.
The file forward function now always puts a 8.3 filename in
the outgoing ticfile. For most files nothing is changed.
AreaMgr and FileMgr netmails are now split into more netmails
when the become too large.
mball:
Will not crash anymore when it needs more then 10 minutes to

6
TODO
View File

@ -57,10 +57,6 @@ mbfido:
N: Process GoldED filerequest netmails with the filereq flag set, we
should create a .req file with the contents of the subject line.
N: When hatch a file with a long filename, the outgoing ticfiles will
have a long uppercase filename and the file is transmitted with
a long filename. I think this should all be 8.3 names.
mbcico:
L: Implement modem connect response translation for ISDN lines, i.e.
make the CAUSE responses human readable. see McMail for this
@ -71,7 +67,7 @@ mbcico:
N: Remove code to make automatic calls after mbtask does this.
mbfile:
N: Add a check to see if the magic filenames are valid.
N: Add a check to see if the magic filenames are (still) valid.
N: Update <filespec> <area> <-touch>

View File

@ -142,12 +142,18 @@ void A_Query(faddr *t, char *replyid)
char Stat[5];
faddr *f, *g;
sysconnect System;
long msgptr;
Syslog('+', "AreaMgr: Query");
f = bestaka_s(t);
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your query request", replyid)) != NULL) {
/*
* Mark begin of message in .pkt
*/
msgptr = ftell(qp);
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
if ((mp = fopen(temp, "r")) == NULL) {
@ -222,6 +228,15 @@ void A_Query(faddr *t, char *replyid)
fprintf(qp, "----------------------------------------------------------------------------\r");
fprintf(qp, "%d connected area(s)\r\r\r", SubTot);
if (((ftell(qp) - msgptr) / 1024) >= CFG.new_split) {
fprintf(qp, "To be continued....\r\r");
Syslog('-', " Splitting message at %ld bytes", ftell(qp) - msgptr);
CloseMail(qp, t);
net_out++;
qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your query request", replyid);
msgptr = ftell(qp);
}
}
}
}
@ -253,6 +268,7 @@ void A_List(faddr *t, char *replyid, int Notify)
char Stat[5];
faddr *f, *g;
sysconnect System;
long msgptr;
if (Notify)
Syslog('+', "AreaMgr: Notify to %s", ascfnode(t, 0xff));
@ -262,6 +278,11 @@ void A_List(faddr *t, char *replyid, int Notify)
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr List", replyid)) != NULL) {
/*
* Mark begin of message in .pkt
*/
msgptr = ftell(qp);
WriteMailGroups(qp, f);
temp = calloc(PATH_MAX, sizeof(char));
@ -335,6 +356,15 @@ void A_List(faddr *t, char *replyid, int Notify)
fprintf(qp, "----------------------------------------------------------------------------\r");
fprintf(qp, "%d available area(s)\r\r\r", SubTot);
if (((ftell(qp) - msgptr) / 1024) >= CFG.new_split) {
fprintf(qp, "To be continued....\r\r");
Syslog('-', " Splitting message at %ld bytes", ftell(qp) - msgptr);
CloseMail(qp, t);
net_out++;
qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr List", replyid);
msgptr = ftell(qp);
}
}
}
}
@ -370,6 +400,7 @@ void A_Flow(faddr *t, char *replyid, int Notify)
struct tm *tt;
int lmonth;
long lw, lm;
long msgptr;
Now = time(NULL);
tt = localtime(&Now);
@ -387,6 +418,11 @@ void A_Flow(faddr *t, char *replyid, int Notify)
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr Flow report", replyid)) != NULL) {
/*
* Mark begin of message in .pkt
*/
msgptr = ftell(qp);
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
if ((mp = fopen(temp, "r")) == NULL) {
@ -455,6 +491,15 @@ void A_Flow(faddr *t, char *replyid, int Notify)
fprintf(qp, "---------------------------------------------------------------------------\r");
fprintf(qp, "Total %58lu %10lu\r\r\r", lw, lm);
if (((ftell(qp) - msgptr) / 1024) >= CFG.new_split) {
fprintf(qp, "To be continued....\r\r");
Syslog('-', " Splitting message at %ld bytes", ftell(qp) - msgptr);
CloseMail(qp, t);
net_out++;
qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr Flow report", replyid);
msgptr = ftell(qp);
}
}
}
}
@ -525,12 +570,18 @@ void A_Unlinked(faddr *t, char *replyid)
char Stat[5];
faddr *f, *g;
sysconnect System;
long msgptr;
Syslog('+', "AreaMgr: Unlinked");
f = bestaka_s(t);
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your unlinked request", replyid)) != NULL) {
/*
* Mark begin of message in .pkt
*/
msgptr = ftell(qp);
WriteMailGroups(qp, f);
temp = calloc(PATH_MAX, sizeof(char));
@ -609,6 +660,15 @@ void A_Unlinked(faddr *t, char *replyid)
fprintf(qp, "----------------------------------------------------------------------------\r");
fprintf(qp, "%d available area(s)\r\r\r", SubTot);
if (((ftell(qp) - msgptr) / 1024) >= CFG.new_split) {
fprintf(qp, "To be continued....\r\r");
Syslog('-', " Splitting message at %ld bytes", ftell(qp) - msgptr);
CloseMail(qp, t);
net_out++;
qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your unlinked request", replyid);
msgptr = ftell(qp);
}
}
}
}

View File

@ -141,6 +141,7 @@ void F_Query(faddr *t, char *replyid)
char Stat[4];
faddr *f, *g;
sysconnect System;
long msgptr;
Syslog('+', "FileMgr: Query");
f = bestaka_s(t);
@ -148,6 +149,11 @@ void F_Query(faddr *t, char *replyid)
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your query request", replyid)) != NULL) {
/*
* Mark begin of message in .pkt
*/
msgptr = ftell(qp);
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/tic.data", getenv("MBSE_ROOT"));
if ((fp = fopen(temp, "r")) == NULL) {
@ -222,6 +228,15 @@ void F_Query(faddr *t, char *replyid)
fprintf(qp, "------------------------------------------------------------------------\r");
fprintf(qp, "%d available area(s)\r\r\r", SubTot);
if (((ftell(qp) - msgptr) / 1024) >= CFG.new_split) {
fprintf(qp, "To be continued....\r\r");
Syslog('-', " Splitting message at %ld bytes", ftell(qp) - msgptr);
CloseMail(qp, t);
net_out++;
qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your query request", replyid);
msgptr = ftell(qp);
}
}
}
}
@ -251,6 +266,7 @@ void F_List(faddr *t, char *replyid, int Notify)
char Stat[4];
faddr *f, *g;
sysconnect System;
long msgptr;
if (Notify)
Syslog('+', "FileMgr: Notify to %s", ascfnode(t, 0xff));
@ -260,6 +276,10 @@ void F_List(faddr *t, char *replyid, int Notify)
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr List", replyid)) != NULL) {
/*
* Mark begin of message in .pkt
*/
msgptr = ftell(qp);
WriteFileGroups(qp, f);
temp = calloc(PATH_MAX, sizeof(char));
@ -331,6 +351,15 @@ void F_List(faddr *t, char *replyid, int Notify)
fprintf(qp, "------------------------------------------------------------------------\r");
fprintf(qp, "%d available area(s)\r\r\r", SubTot);
if (((ftell(qp) - msgptr) / 1024) >= CFG.new_split) {
fprintf(qp, "To be continued....\r\r");
Syslog('-', " Splitting message at %ld bytes", ftell(qp) - msgptr);
CloseMail(qp, t);
net_out++;
qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr List", replyid);
msgptr = ftell(qp);
}
}
}
}
@ -414,12 +443,17 @@ void F_Unlinked(faddr *t, char *replyid)
char Stat[4];
faddr *f, *g;
sysconnect System;
long msgptr;
Syslog('+', "FileMgr: Unlinked");
f = bestaka_s(t);
if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your unlinked request", replyid)) != NULL) {
/*
* Mark begin of message in .pkt
*/
msgptr = ftell(qp);
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/tic.data", getenv("MBSE_ROOT"));
if ((fp = fopen(temp, "r")) == NULL) {
@ -492,6 +526,15 @@ void F_Unlinked(faddr *t, char *replyid)
fprintf(qp, "------------------------------------------------------------------------\r");
fprintf(qp, "%d available area(s)\r\r\r", SubTot);
if (((ftell(qp) - msgptr) / 1024) >= CFG.new_split) {
fprintf(qp, "To be continued....\r\r");
Syslog('-', " Splitting message at %ld bytes", ftell(qp) - msgptr);
CloseMail(qp, t);
net_out++;
qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your unlinked request", replyid);
msgptr = ftell(qp);
}
}
}
}