static const char *cry="(crypted link is now set in '%s' mode, security level='%d')";
+/*
+^L
+*/
+/********************************************************/
+/* */
+/* Procedure to update the termination condition */
+/* within contact. */
+/* current session. */
+/* */
+/********************************************************/
+static void setterminator(CONTYP *contact,const char *condition)
+
+{
+if (contact!=(CONTYP *)0) {
+ contact->termend=rou_freestr(contact->termend);
+ contact->termend=strdup(condition);
+ }
+}
/*
^L
*/
status=-3;
break;
}
- contact->termend=rou_freestr(contact->termend);
- contact->termend=strdup(str);
+ (void) setterminator(contact,str);
//(void) rou_alert(0,"%s exit status='%d'",OPEP,status);
break; //no need to go further
break;
case c_quit : //QUIT SMTP protocol
contact->credit++; //clean disconnect
- contact->termend=rou_freestr(contact->termend);
- contact->termend=strdup("QUIT received");
+ (void) setterminator(contact,"QUIT received");
(void) transmit(contact,true,"%d 2.0.0 Bye, closing connection CNT=%s",
QUITOK,contact->mainsesid);
status=1; //every thing fine
}
break;
case false : //unable to establish link
+ (void) setterminator(contact,"starttls not successful");
(void) transmit(contact,true,"%d 5.3.3 command starttls not successful",
CMDBAD);
status=-1;