]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Use rou_alert witin feeder.c
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Sat, 29 Mar 2025 11:55:24 +0000 (07:55 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Sat, 29 Mar 2025 11:55:24 +0000 (07:55 -0400)
Makefile
app/feeder.c
lib/subrou.c

index 257e39c771626a5b6453785f39dcd052c32944ac..c79f11bca7b39fb9f7668deb06a64f7c9988018b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -42,10 +42,11 @@ FEEDPAR     =                                               \
 
 onefeed        :       debug
                @ bin/feeder                            \
+                       -f                              \
                        -d3                             \
                        $(TESTIP)                       \
                        $(TESTPORT)                     \
-                       $(DATATST)/feed*.tst
+                       $(DATATST)/feed00.tst
 
 #direct test
 tstfeed        :       debug
index 9a98dc6ccf1c31b4c1b1e833739e663d7b2b354c..aa854997fdc943ce9042ae137ded3a669e196c4a 100644 (file)
@@ -58,8 +58,8 @@ static void report(int numline,char *line,char *trouble)
 
 
 {
-(void) fprintf(stdout,"line %d %s\n",numline,trouble);
-(void) fprintf(stdout,"\t'%s'\n",line);
+(void) rou_alert(0,"line %d %s",numline,trouble);
+(void) rou_alert(0,"\t'%s'",line);
 }
 /*
 \f
@@ -101,7 +101,7 @@ tocheck=strlen(line);
 phase=0;
 proceed=true;
 while (proceed==true) {
-  //(void) fprintf(stdout,"JMPDBG %s, phase='%d'\n",OPEP,phase);
+  //(void) rou_alert(0,"JMPDBG %s, phase='%d'",OPEP,phase);
   switch (phase) {
     case 0      :       //do we have a "..." sequence at the end
       if (tocheck>0) {
@@ -122,15 +122,15 @@ while (proceed==true) {
       break;
     case 2      :       //get available character
       if (strncmp(line,received,tocheck)!=0) {
-        (void) fprintf(stdout,"Line %04d: Error!\n",numline);
-        (void) fprintf(stdout,"expecting\t'%s'\n",line);
-        (void) fprintf(stdout,"found\t\t'%s'\n",received);
+        (void) rou_alert(0,"Line %04d: Error!",numline);
+        (void) rou_alert(0,"expecting\t'%s'",line);
+        (void) rou_alert(0,"found\t\t'%s'",received);
         phase=999;
         }
       received=rou_freestr(received);
       break;
     case 3      :       //everything fine
-      //(void) fprintf(stdout,"JMPDBG line <%s> OK!\n",line);
+      //(void) rou_alert(0,"JMPDBG line <%s> OK!",line);
       status=true;
       break;
     default     :       //SAFE Guard
@@ -159,7 +159,7 @@ _Bool proceed;
 status=true;
 phase=0;
 proceed=true;
-//(void) fprintf(stdout,"JMPDBG phase='%d' line=<%s>\n",phase,line);
+(void) rou_alert(0,"JMPDBG phase='%d' line=<%s>",phase,line);
 while (proceed==true) {
   switch (phase) {
     case 0      :       //removing first space
@@ -222,13 +222,13 @@ numline=0;
 phase=0;
 proceed=true;
 while (proceed==true) {
-  //(void) fprintf(stdout,"JMPDBG scanfile phase='%d'\n",phase);
+  //(void) rou_alert(0,"JMPDBG scanfile phase='%d'",phase);
   switch (phase) {
     case 0      :       //checking parameters
       (void) fprintf(stdout,"Scanning file <%s>\n",filename);
       if ((fichier=fopen(filename,"r"))==(FILE *)0) {
-        (void) fprintf(stdout,"Unable to open file <%s> (error=<%s>\n",
-                               filename,strerror(errno));
+        (void) rou_alert(0,"Unable to open file <%s> (error=<%s>",
+                            filename,strerror(errno));
         proceed=false;
         }
       break;
@@ -281,7 +281,7 @@ while (next<argc) {
     case  1     :       //opening a socket
       socptr=soc_openonesock(pro_smtp,argv[0],argv[1]);
       if (socptr==(SOCPTR *)0) {
-        (void) fprintf(stdout,"Unable to contact remote!\n");
+        (void) rou_alert(0,"Unable to contact remote!");
         phase=999;
         }
       break;
@@ -347,7 +347,7 @@ while (proceed==true) {
       (void) openlog("feeder",LOG_NDELAY|LOG_PID,LOG_DAEMON);
       numfile=scanallfiles(params->argc,params->argv);
       if (numfile==(params->argc-2))
-        (void) fprintf(stdout,"%d file successfully transmitted to <%s.%s>\n",
+        (void) rou_alert(0,"%d file successfully transmitted to <%s.%s>",
                                numfile,params->argv[0],params->argv[1]);
       (void) closelog();
       break;
index a6c0d810fe7a6f66d10617dad6e4d283c894267b..6224b1ae96d2cedf9044f94594ee9619441e86a5 100644 (file)
@@ -21,7 +21,7 @@
 
 //version definition 
 #define VERSION "0.6"
-#define RELEASE "25"
+#define RELEASE "26"
 
 //Public variables
 PUBLIC  int debug=0;            //debug level