]> SAFE projects GIT repository - jmp/mailleur/commitdiff
interaction between maild and emlrec is working fine
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 11 Jul 2024 03:45:39 +0000 (23:45 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 11 Jul 2024 03:45:39 +0000 (23:45 -0400)
app/Makefile
app/emlrec.c
app/maild.c
lib/modrec.c
lib/modrec.h
lib/subrou.c

index 7f6fcf53e4eb51bfea9e69202b1b2718b923f7fa..2dc36db5f26c467382b5ba78c253b0cbcd9774bb 100644 (file)
@@ -47,13 +47,14 @@ emlrec      :  toremake emlrec.o
 
 emlrec.o:  emlrec.c                            \
           ../lib/modrec.h                      \
+          ../lib/unisig.h                      \
           ../lib/uniprc.h                      \
           ../lib/unipar.h                      \
           ../lib/subrou.h                      \
 
 maild.o        :  maild.c                              \
-          ../lib/modrec.h                      \
           ../lib/uniprc.h                      \
+          ../lib/unisig.h                      \
           ../lib/unipar.h                      \
           ../lib/subrou.h                      \
 
index e0e14deb5dfdb1731045ec5be237fc8278cf8cce..8e82be9a6a0840508cf55bcc37e32333af0f559a 100644 (file)
 \f
 */
 /********************************************************/
-/*                                                     */
-/*      Waiting and handling smtp request               */
-/*                                                     */
-/********************************************************/
-static void rec_handlesmtp()
-
-{
-int phase;
-_Bool proceed;
-
-phase=0;
-proceed=true;
-while (proceed==true) {
-  switch (phase) {
-    case 0      :       //looping forever email receiving processes
-      (void) prc_settitle("emlrec with pid='%06d'",getpid());
-      break;
-    case 1      :       //Terminating all remaining process
-      (void) sleep(1);
-      if (hangup==false)
-        phase--;       //looping forever
-      break;
-    default     :       //SAFE Guard
-      proceed=false;
-      break;
-    }
-  phase++;
-  }
-}
-/*
-\f
-*/
-/********************************************************/
 /*                                                     */
 /*     Main routine                                    */
 /*             Start multiple SMTP daemon and make     */
index 4f46f9f9b19af5971beb15744adbcb0c78b8053d..f8ada5355b009ddd8bd5e198c4694f83282e13da 100644 (file)
 #include       "unipar.h"
 #include       "uniprc.h"
 #include       "unisig.h"
-#include       "modrec.h"
 
-//port listening format is "IP:PORT NUMBER:num iteration"
-#define PORTREC "192.168.0.1:25:2"
 /*
 \f
 */
@@ -145,7 +142,6 @@ while (proceed==true) {
       (void) par_modeunipar(true);
       (void) prc_modeuniprc(true);
       (void) sig_modeunisig(true);
-      (void) rec_modemodrec(true);
       (void) sig_trapsignal(true,sig_alrm);
       break;
     case 3      :       //doing main tash
@@ -158,7 +154,6 @@ while (proceed==true) {
       (void) prc_cleantitle();
       params=par_freeparams(params);
       (void) sig_trapsignal(false,sig_alrm);
-      (void) rec_modemodrec(false);
       (void) sig_modeunisig(false);
       (void) prc_modeuniprc(false);
       (void) par_modeunipar(false);
index 223429f5d8f6ec16723ea098e1fff20bb20385a5..9b68d17267d5569c67905690c9a9df4a963ad4b1 100644 (file)
 #include        "modrec.h"
 
 static  _Bool modopen;          //boolean module open/close
-
 /*
 \f
 */
 /********************************************************/
 /*                                                     */
+/*      Waiting and handling smtp request               */
 /*                                                     */
 /********************************************************/
-//procedure to receive email form outside
-void rec_getemail(int attend)
+PUBLIC void rec_handlesmtp()
 
 {
-(void) rou_alert(0,"JMPDBG getemail with pid='%06d' (wait for '%0d')",
-                    getpid(),attend);
-(void) prc_settitle("JMPDBG getemail with pid='%06d' (wait for '%0d')",
-                    getpid(),attend);
-while (attend>0) {
-  (void) sleep(1);
-  if (hangup==true) {
-    (void) rou_alert(0,"JMPDBG got hangup signal");
-    break;
+int phase;
+_Bool proceed;
+
+phase=0;
+proceed=true;
+while (proceed==true) {
+  switch (phase) {
+    case 0      :       //looping forever email receiving processes
+      (void) prc_settitle("emlrec with pid='%06d'",getpid());
+      break;
+    case 1      :       //Terminating all remaining process
+      (void) sleep(1);
+      if (hangup==false)
+        phase--;       //looping forever
+      break;
+    default     :       //SAFE Guard
+      proceed=false;
+      break;
     }
-  attend--;
+  phase++;
   }
-(void) rou_alert(0,"JMPDBG exiting from  pid='%06d'",getpid());
 }
 /*
 ^L
index 0b0a29d4f7e480814ea9563f60145eb29a91c50c..1c2e4bbfb37c686ea7ac08caf52813f59ee35c6d 100644 (file)
@@ -10,7 +10,7 @@
 #include        <stdbool.h>
 
 //procedure to receive email form outside
-extern void rec_getemail(int attend);
+extern void rec_handlesmtp();
 
 //homework to be done before starting/stoping module.
 extern int rec_modemodrec(_Bool mode);
index 1c7990191db6d81b84572232ea3d2a497e534ee8..c3b48e86eef5ad08c3492df7e9e1b9604a657474 100644 (file)
@@ -18,7 +18,7 @@
 
 //version definition 
 #define VERSION "0.2"
-#define RELEASE "2"
+#define RELEASE "3"
 
 //Public variables
 PUBLIC  int debug=0;            //debug level