From: Jean-Marc Pigeon (Delson) Date: Wed, 26 Mar 2025 15:48:02 +0000 (-0400) Subject: Tracing lost contact with remote in logs X-Git-Tag: tag-0.7~58 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=cb84a3d9b006920cb7fce9be045320314483bfac;p=jmp%2Fmailleur Tracing lost contact with remote in logs --- diff --git a/Makefile b/Makefile index e85004f..4d4c96a 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ emlrcvr : clean debug newtest #starting email receiver @ echo "--------------" @ echo "starting $@" @ $(TESTDIR)/$(SBINDIR)/$@ \ - -f \ + -f \ $(EMLPAR) @ echo "--------------" diff --git a/lib/devlog.c b/lib/devlog.c index dd98808..0735d4e 100644 --- a/lib/devlog.c +++ b/lib/devlog.c @@ -96,7 +96,8 @@ while (proceed==true) { break; case 3 : //writing a minimal data (void) clock_gettime(CLOCK_REALTIME,&(log->start)); - (void) fprintf(log->file,"#%s\n",ctime(&(log->start.tv_sec))); + (void) fprintf(log->file,"#%s",ctime(&(log->start.tv_sec))); + (void) fflush(log->file); log->start.tv_sec=0; break; default : //SAFE guard @@ -218,6 +219,10 @@ while (proceed==true) { phase=999; } break; + case 3 : //string the formated line within logs + (void) fprintf(log->file,"%s %s\n",chrono,line); + (void) fflush(log->file); + break; default : //SAFE guard line=rou_freestr(line); proceed=false; diff --git a/lib/lvleml.c b/lib/lvleml.c index 352ccaf..eea99ed 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -320,7 +320,8 @@ while (proceed==true) { status=tcp_getline(contact->socptr,&attend,&line); (void) rou_alert(0,"%s, JMPDBG tcp_getline status='%d'",OPEP,status); if (status<=0) { //timeout or trouble? - (void) rou_alert(0,"%s, lost contact",OPEP); + (void) log_fprintlog(contact->logptr,false,"%s","Lost contact with remote"); + (void) rou_alert(0,"%s, JMPDBG lost contact",OPEP); break; //no need to go further } (void) log_fprintlog(contact->logptr,false,"%s",line); diff --git a/lib/subrou.c b/lib/subrou.c index 0b76f1a..15d52f9 100644 --- a/lib/subrou.c +++ b/lib/subrou.c @@ -21,7 +21,7 @@ //version definition #define VERSION "0.6" -#define RELEASE "16" +#define RELEASE "17" //Public variables PUBLIC int debug=0; //debug level