(void) prc_settitle("Kluge for %d seconds, ip:port=<%s:%s>",
attend-i,binding->ip,binding->port);
(void) sleep(1);
+ if ((hangup==true)||(reload==true)){
+ (void) rou_alert(0,"JMPDBG process terminated");
+ break;
+ }
}
}
/*
*/
/********************************************************/
/* */
-/* Procedure to active child process if necessary */
+/* Procedure to activate child process if necessary*/
/* */
/********************************************************/
static void activate(SOCTYP **bindings)
*/
/********************************************************/
/* */
+/* Procedure to kill all child process if necessary*/
+/* */
+/********************************************************/
+static void release(SOCTYP **bindings)
+
+{
+#define OPEP "modrec.c:release"
+
+int phase;
+_Bool proceed;
+
+phase=0;
+proceed=true;
+while (proceed==true) {
+ switch (phase) {
+ case 0 : //making sur the list is defined
+ if (bindings==(SOCTYP **)0) {
+ (void) rou_alert(0,"%s bindings list pointer is NULL (Bug!?)",OPEP);
+ phase=999; //not going further
+ }
+ break;
+ case 1 : //check need to kill a dispatched process
+ while (*bindings!=(SOCTYP *)0) {
+ for (int i=0;i<(*bindings)->iteration;i++) {
+ if ((*bindings)->childs[i]==(pid_t)0)
+ continue;
+ if (prc_checkprocess((*bindings)->childs[i])==true) {
+ (void) rou_alert(0,"JMPDBG sending a SIGTERM process to '%d'",
+ (*bindings)->childs[i]);
+ (void) kill((*bindings)->childs[i],SIGTERM);
+ (*bindings)->childs[i]=(pid_t)0;
+ }
+ }
+ bindings++;
+ }
+ break;
+ default : //SAFE Guard
+ proceed=false;
+ break;
+ }
+ phase++;
+ }
+#undef OPEP
+}
+/*
+\f
+*/
+/********************************************************/
+/* */
/* Waiting and handling smtp request */
/* */
/********************************************************/
if ((hangup==false)&&(reload==false))
phase--; //normal cycle, lets proceed to actvate again
break;
- case 3 : //closing all socket openend
+ case 3 : //closing all socket currently opened
+ (void) release(bindings);
(void) soc_mulclose(bindings);
break;
default : //SAFE Guard