]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Still working on the disconnect question
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Sun, 30 Mar 2025 19:04:57 +0000 (15:04 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Sun, 30 Mar 2025 19:04:57 +0000 (15:04 -0400)
app/feeder.c
lib/Makefile
lib/devsoc.c
lib/lvleml.c
lib/subrou.c

index aa854997fdc943ce9042ae137ded3a669e196c4a..416c8cbdc4613ac56b9a36a2ba73c484b6d1401a 100644 (file)
@@ -115,7 +115,7 @@ while (proceed==true) {
         }
       break;
     case 1      :       //waiting for a line with CRLF
-      if (tcp_getline(socptr,WAITLINE,&received)==0) {
+      if (tcp_getline(socptr,WAITLINE,&received)<=0) {
         (void) fprintf(stdout,"Unable to receive line in due time\n");
         phase=999;      //No need to go further
         }
index 636c260045cac4f29360920db2833ec787ea9571..30bef5ca7cce0598bfa1c4d3c699ced79bed70e8 100644 (file)
@@ -2,7 +2,7 @@
 #Executable generation area
 #--------------------------------------------------------------------
 debug  :  toremake
-          @ $(MAKE) $(PAR) OPTIME="-g" objs
+          @ $(MAKE) $(PAR) OPTIME="-g -DMODEDEBUG" objs
           @ echo "library compiled in '$@' mode, now ready"
 
 prod   :  toremake
index 2e81c0910b521fe13723910cc72b71ae7b6a1c91..058152366b2fb37b9352384580d402c6265c9ef5 100644 (file)
@@ -891,6 +891,8 @@ if (soc!=(SOCTYP *)0) {
       break;
     case 1      :
       (void) rou_alert(0,"%s Polling return millisec='%d'",OPEP,millisec);
+      (void) usleep(500000);
+      (void) soc_receive(socptr);
       if ((polling[0].revents&POLLHUP)==POLLHUP) {
         (void) close(soc->handle);
         soc->handle=-1;
@@ -1058,6 +1060,7 @@ if (soc!=(SOCTYP *)0) {
       break;
     case false  :
       got=recv(soc->handle,buffer,limit,MSG_DONTWAIT);
+      (void) rou_alert(0,"%s, got=%d char",OPEP,got);
       switch (got) {
         case -1     :             //do not block
           if (errno==EWOULDBLOCK)
@@ -1077,6 +1080,14 @@ if (soc!=(SOCTYP *)0) {
             }
           break;
         case 0      :          //Premature EOF?
+          (void) rou_alert(0,"%s, detected EOF error=<%s:%d>",
+                                  OPEP,strerror(errno),errno);
+          if (close(soc->handle)<0) {
+            (void) rou_alert(0,"%s, after close error=<%s:%d>",
+                                  OPEP,strerror(errno),errno);
+            }
+          soc->handle=-1;
+          soc->connected=false;
           break;
         default     :          //we got some char from remote
           break;
index 471c6e1da9db61690e026da9bfcf1f01c5fbf45f..bbb8067a29559ca774102dcf919ef3caa4f5f5e8 100644 (file)
@@ -161,6 +161,9 @@ static _Bool doehlo(CONTYP *contact,char *parameter)
 
 {
 static char *ehlostr[]= {
+#ifdef  MODEDEBUG
+        "-ORGN",        //specific command to change ORIGIN IP
+#endif
         "-STARTTLS",
         "-8BITMIME",
         "-ENHANCEDSTATUSCODES",
index ee0247a73a08628308fba6d1879af705ccf3f866..eb0b687d10f0027cfaa6bad0f87a0406ff80a8ce 100644 (file)
@@ -21,7 +21,7 @@
 
 //version definition 
 #define VERSION "0.6"
-#define RELEASE "28"
+#define RELEASE "29"
 
 //Public variables
 PUBLIC  int debug=0;            //debug level