From: Jean-Marc Pigeon (Delson) Date: Sun, 30 Mar 2025 19:04:57 +0000 (-0400) Subject: Still working on the disconnect question X-Git-Tag: tag-0.7~46 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=1a89d3f3d291a76c417e07384fb0066b94bcab40;p=jmp%2Fmailleur Still working on the disconnect question --- diff --git a/app/feeder.c b/app/feeder.c index aa85499..416c8cb 100644 --- a/app/feeder.c +++ b/app/feeder.c @@ -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 } diff --git a/lib/Makefile b/lib/Makefile index 636c260..30bef5c 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -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 diff --git a/lib/devsoc.c b/lib/devsoc.c index 2e81c09..0581523 100644 --- a/lib/devsoc.c +++ b/lib/devsoc.c @@ -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; diff --git a/lib/lvleml.c b/lib/lvleml.c index 471c6e1..bbb8067 100644 --- a/lib/lvleml.c +++ b/lib/lvleml.c @@ -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", diff --git a/lib/subrou.c b/lib/subrou.c index ee0247a..eb0b687 100644 --- a/lib/subrou.c +++ b/lib/subrou.c @@ -21,7 +21,7 @@ //version definition #define VERSION "0.6" -#define RELEASE "28" +#define RELEASE "29" //Public variables PUBLIC int debug=0; //debug level