]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Better out.log display
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 9 Jun 2025 18:16:13 +0000 (14:16 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 9 Jun 2025 18:16:13 +0000 (14:16 -0400)
lib/devlog.c
lib/devlog.h
lib/geseml.h
lib/lvleml.c

index 90aa4e6b831be77716310b978488d791446830fb..953cbab6b9e2d2a59a207b613dc8a055e2a475d0 100644 (file)
@@ -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));
index 8b42caf5560568006ecf39ebb54dfb79d9f33f09..60c4524926778498312a66e634fdf686a2e71682 100644 (file)
@@ -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
index 11b88b3f9ce91628e3cd1d829157df9f6652d593..08fef293d681910cb08bdc0b78fe518a509d0948 100644 (file)
@@ -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 
index f2d5b4b3e7ccf2141a7dce3125aab926cd8d30cd..32575d789d25d9e38c3adda176591e3431224b8f 100644 (file)
@@ -15,6 +15,7 @@
 #include        <stdio.h>
 #include        <string.h>
 #include        <signal.h>
+#include        <time.h>
 #include        <unistd.h>
 
 #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;