From: Jean-Marc Pigeon (Delson) Date: Mon, 9 Jun 2025 18:16:13 +0000 (-0400) Subject: Better out.log display X-Git-Tag: tag-0.8~42 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=bf2933e828abbf9e5e2337fbca8f1140ce11eb5a;p=jmp%2Fmailleur Better out.log display --- diff --git a/lib/devlog.c b/lib/devlog.c index 90aa4e6..953cbab 100644 --- a/lib/devlog.c +++ b/lib/devlog.c @@ -282,7 +282,7 @@ return logptr; /* log file. */ /* */ /********************************************************/ -PUBLIC int log_fprintlog(LOGPTR *logptr,_Bool suite,const char *format,...) +PUBLIC int log_fprintlog(LOGPTR *logptr,_Bool showtime,const char *format,...) { #define OPEP "devlog.c:log_fprintlog" @@ -325,7 +325,7 @@ while (proceed==true) { } else { (void) snprintf(chrono,sizeof(chrono),"%12s"," "); - if (suite==false) { + if (showtime==true) { unsigned int delta; delta=rou_getdifftime(&(log->start)); diff --git a/lib/devlog.h b/lib/devlog.h index 8b42caf..60c4524 100644 --- a/lib/devlog.h +++ b/lib/devlog.h @@ -19,7 +19,7 @@ extern LOGPTR *log_openlog(char *logname,_Bool inlog,const char *cmt); extern LOGPTR *log_closelog(LOGPTR *logptr); //procedure to write a sequence within the current log -extern int log_fprintlog(LOGPTR *logptr,_Bool suite,const char *format,...); +extern int log_fprintlog(LOGPTR *logptr,_Bool showtime,const char *format,...); //procedure to merge session log contents to //current daily log diff --git a/lib/geseml.h b/lib/geseml.h index 11b88b3..08fef29 100644 --- a/lib/geseml.h +++ b/lib/geseml.h @@ -22,6 +22,7 @@ typedef struct { char *sessid; //session id char *mailfrom; //EMail Originator char *rcptto; //EMail Recipient + int sendcode; //Email sending status; }TRATYP; //procedure to dump a list of transfert record diff --git a/lib/lvleml.c b/lib/lvleml.c index f2d5b4b..32575d7 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "subrou.h" @@ -840,6 +841,7 @@ static int senddata(RMTTYP *rmt,TRATYP **tosend,const char *sessid) int rspcode; int sent; +TIMESPEC start; int phase; _Bool proceed; @@ -847,6 +849,7 @@ rspcode=0; sent=0; phase=0; proceed=true; +(void) clock_gettime(CLOCK_REALTIME,&start); while (proceed==true) { switch (phase) { case 0 : //Sendig data request @@ -861,12 +864,23 @@ while (proceed==true) { break; case 1 : //sending session data sent=tcp_send_smtp_data(rmt,sessid); - (void) log_fprintlog(rmt->logptr,false,"Sent '%05d' bytes",sent); if (sent<0) phase=999; //No need to wait form response code break; - case 2 : //sending session data - rspcode=tcp_smtp_command(rmt,"."); + case 2 : //send the text termination + (void) tcp_write(rmt->socptr,"."); + rspcode= tcp_get_smtp_reply(rmt,WAITRMT); + break; + case 3 : //sending session data + const char *fmt; + unsigned int delta; + + + sent+=1023; + sent/=1024; //Sent now in KByes + fmt="Data Sent %d Kbytes within %d.%03d seconds"; + delta=rou_getdifftime(&start); + (void) log_fprintlog(rmt->logptr,false,fmt,sent,delta/1000,delta%1000); switch (rspcode) { case CMDOK : const char *cmt; @@ -880,6 +894,8 @@ while (proceed==true) { break; } break; + case 4 : //Updating sending + break; default : //SAFE Guard proceed=false; break;