From f8cee18f1bdb7e5354178849837955d435e56a12 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sat, 7 Dec 2002 15:34:28 +0000 Subject: [PATCH] Changed areas command logging --- ChangeLog | 5 +++++ mbfido/createm.c | 5 ++++- mbfido/mgrutil.c | 35 +++++++++++++++++++++++++++++------ mbfido/ptic.c | 6 ------ 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41909aff..3ed1373f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -49,6 +49,8 @@ v0.35.06 then what MS does. Added long extension to 3 char extensions for mpeg, smil, perl, jpeg and tiff. + The unpack function doesn't complain anymore when it was + testing for the archive format on files smaller then 257 bytes. mbsebbs: Several user input functions don't allow comma's anymore. @@ -74,6 +76,9 @@ v0.35.06 lines now depends on the new nodes setting. When adding unpacked mail for a directory node, the mail packets had the wrong filename. + Changed some logging to debug with auto create areas. + Request messages sent to the uplinks are now logged in the + manager logfile. mbcico: With filetransfer errors, the attempts counter was not diff --git a/mbfido/createm.c b/mbfido/createm.c index 661b10ef..e4262279 100644 --- a/mbfido/createm.c +++ b/mbfido/createm.c @@ -156,9 +156,12 @@ int CheckEchoGroup(char *Area, int SendUplink, faddr *f) */ fseek(mp, 0, SEEK_END); offset = msgshdr.hdrsize + ((mgroup.StartArea -1) * (msgshdr.recsize + msgshdr.syssize)); - Syslog('+', "file end at %ld, offset needed %ld", ftell(mp), offset); + Syslog('m', "file end at %ld, start area offset at %ld", ftell(mp), offset); if (ftell(mp) < offset) { + /* + * Start area record not in database, expand until start record exists. + */ Syslog('m', "Database too small, expanding..."); memset(&msgs, 0, sizeof(msgs)); memset(&System, 0, sizeof(System)); diff --git a/mbfido/mgrutil.c b/mbfido/mgrutil.c index 4b3f939a..4ef7de51 100644 --- a/mbfido/mgrutil.c +++ b/mbfido/mgrutil.c @@ -309,8 +309,8 @@ int UplinkRequest(faddr *t, faddr *From, int FileMgr, char *cmd) struct tm *tm; fidoaddr Orig, Dest; unsigned flags = M_PVT; - char ext[4], *mgrname, *subj; - int i; + char ext[4], *mgrname, *subj, cmdline[81]; + int i, j; memset(&Orig, 0, sizeof(Orig)); Orig.zone = From->zone; @@ -351,7 +351,7 @@ int UplinkRequest(faddr *t, faddr *From, int FileMgr, char *cmd) } subj = xstrcpy(nodes.Apasswd); - Syslog('-', " Netmail from %s to %s", aka2str(Orig), ascfnode(t, 0x1f)); + Mgrlog("%s request from %s to %s", mgrname, aka2str(Orig), ascfnode(t, 0x1f)); Now = time(NULL) - (gmt_offset((time_t)0) * 60); flags |= (nodes.Crash) ? M_CRASH : 0; @@ -396,10 +396,27 @@ int UplinkRequest(faddr *t, faddr *From, int FileMgr, char *cmd) fprintf(qp, "\001PID: MBSE-FIDO %s\r", VERSION); fprintf(qp, "\001TZUTC: %s\r", gmtoffset(Now)); - for (i = 0; i < strlen(cmd); i++) + /* + * Send command, may be format *AREA1\r+AREA2\r=AREA3 + */ + j = 0; + for (i = 0; i < strlen(cmd); i++) { putc(cmd[i], qp); - putc('\r', qp); + if (cmd[i] == '\r') { + cmdline[j] = '\0'; + Mgrlog("%s", cmdline); + j = 0; + } else { + cmdline[j] = cmd[i]; + j++; + } + } + putc('\r', qp); /* There is no return after the last one. */ + cmdline[j] = '\0'; + Mgrlog("%s", cmdline); + Mgrlog("---"); fprintf(qp, TearLine()); + /* * Add a warning after the tearline. */ @@ -501,6 +518,12 @@ void fill_arealist(AreaList **fdp, char *tag, int DoDelete) +/* + * Process areas commandline. Check for missing records in message and + * file groups or areas dropped from the area taglists. Supported taglists + * are plain areaname description lists and for file areas the filegate.zxx + * formatted lists. + */ int Areas(void) { FILE *gp, *ap, *fp; @@ -510,7 +533,7 @@ int Areas(void) sysconnect System; faddr *From, *To; - Mgrlog("Process areas taglists"); + Syslog('+', "Process areas taglists"); if (!do_quiet) { colour(3, 0); diff --git a/mbfido/ptic.c b/mbfido/ptic.c index fe633380..dce02338 100644 --- a/mbfido/ptic.c +++ b/mbfido/ptic.c @@ -86,7 +86,6 @@ int ProcessTic(fa_list *sbl) int BBS_Imp = FALSE, DidBanner = FALSE; faddr *p_from; qualify *qal = NULL, *tmpq; - fa_list *tmp; Now = time(NULL); @@ -301,9 +300,6 @@ int ProcessTic(fa_list *sbl) } } - for (tmp = sbl; tmp; tmp = tmp->next) - Syslog('f', "initial SB list %s", ascfnode(tmp->addr, 0x0f)); - /* * Count the actual downlinks for this area and build the list of * systems qualified to receive this file. @@ -730,13 +726,11 @@ int ProcessTic(fa_list *sbl) * Create file announce record */ if (tic.FileArea) { - Syslog('f', "Start magic check"); if (strlen(TIC.TicIn.Magic)) UpDateAlias(TIC.TicIn.Magic); else Magic_UpDateAlias(); - Syslog('f', "done"); for (i = 0; i <= TIC.File_Id_Ct; i++) strncpy(T_File.LDesc[i], TIC.File_Id[i], 48); T_File.TotLdesc = TIC.File_Id_Ct;