]> SAFE projects GIT repository - jmp/mailleur/commitdiff
procedure eml_countqfile is working fine
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 13 Jun 2025 09:00:15 +0000 (05:00 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 13 Jun 2025 09:00:15 +0000 (05:00 -0400)
Makefile
lib/geseml.c
lib/unieml.c

index 28335a9362b13c02fa3de99054ed647940c2ac91..67ade01614fa1412fef493480e89b99d1bd60619 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -40,6 +40,7 @@ TESTITER=     1
 #To test sorter
 dosorter:  
           @ bin/sorter                                 \
+                  -f                                   \
                   -d 2                                 \
                   -c ./conf/mailleur.conf.dvl          \
                   -r $(TESTDIR) 
index 48247944b119a9691d8c8a5ca7d70bdff8beb12d..3037aa53245ad2f58ad3822ae532561951e6c573 100644 (file)
@@ -489,55 +489,33 @@ PUBLIC void eml_doneqfile(TRATYP **list)
 {
 #define OPEP    "geseml.c:eml_doneqfile,"
 
-SIDTYP **sids;
 TRATYP **next;
 
-sids=(SIDTYP **)0;
 next=(TRATYP **)0;
 if (list!=(TRATYP **)0) {
   TRATYP **ptr;
 
   ptr=list;
   while (*ptr!=(TRATYP *)0) {
-    SIDTYP *found;
-
-    found=eml_addsid(&sids,(*ptr)->sessid);
-    switch ((*ptr)->code) {
-      case 'C'  :       //completed
-        break;
-      default   :
-        next=(TRATYP **)rou_addlist((void **)next,(void *)eml_duptra(*ptr));
-        found->count++;
-        break;
-      }
-    ptr++;
-    }
-  }
-if (sids!=(SIDTYP **)0) {
-  SIDTYP **ptr;
-
-  ptr=sids;
-  while (*ptr!=(SIDTYP *)0) {
-    if ((*ptr)->count==0) {
+    if (((*ptr)->code=='C')&&(eml_countqfile((*ptr)->sessid,-1)==0)) {
       (void) rou_alert(0,"%s JMPDBG need to remove <%s>",OPEP,(*ptr)->sessid);
       (void) eml_deleteqfile((*ptr)->sessid);
       }
+    else 
+      next=(TRATYP **)rou_addlist((void **)next,(void *)eml_duptra(*ptr));
     ptr++;
     }
-  sids=eml_freesid(sids);
   }
 if (next!=(TRATYP **)0) {
   FILE *qfile;
-  uuid_t id;
+  time_t current;
   char qname[150];
-  char struuid[40];
   int phase;
   _Bool proceed;
    
   qfile=(FILE *)0;
-  (void) uuid_generate(id);
-  (void) uuid_unparse(id,struuid);
-  (void) snprintf(qname,sizeof(qname),"%s-%s-%04d",struuid,"redo",0);
+  (void) time(&current);
+  (void) snprintf(qname,sizeof(qname),"%08ld-%08d-%04d",current,getpid(),0);
   phase=0;
   proceed=true;
   while (proceed==true) {
index 3b19f87d6a6e9485a2bfa746ff2e69de454d61f6..fd66b8cd940449e381f72c491ac846f10ed68954 100644 (file)
@@ -703,8 +703,8 @@ while (proceed==true) {
     case 1      :       //opening count file
       char name[300];
 
-      (void) snprintf(name,sizeof(name),"%s.%s/%s",filename,qfilename,EXTCNT);
-      if ((fcount=fopen(name,"rw"))==(FILE *)0) {
+      (void) snprintf(name,sizeof(name),"%s/%s.%s",filename,qfilename,EXTCNT);
+      if ((fcount=fopen(name,"r+"))==(FILE *)0) {
         (void) rou_alert(0,"%s unable to open count file <%s> (error=<%s>)",
                              OPEP,name,strerror(errno));
         phase=999;    //Big trouble