*/
/********************************************************/
/* */
+/* Procedure to transmit a string to the remot peer*/
+/* */
+/********************************************************/
+static void transmit(CONTYP *contact,char *fmt,...)
+
+{
+va_list args;
+char line[300];
+
+va_start(args,fmt);
+(void) vsnprintf(line,sizeof(line),fmt,args);
+(void) tcp_write(contact,line,strlen(line));
+(void) tcp_write(contact,CRLF,strlen(CRLF));
+va_end(args);
+}
+/*
+^L
+*/
+/********************************************************/
+/* */
/* Procedure to proceed with peer exchange */
/* 3 return values: */
/* -1 exit with trouble. */
{
#define OPEP "lvleml.c:eml_docontact"
int status;
+_Bool proceed;
status=1;
-while (status>0) {
+proceed=true;
+while (proceed==true) {
char *line;
TIMESPEC attend;
break; //no need to go further
switch (eml_getcode(line)) {
case c_quit : //quit SMTP protocol
- status=0;
+ (void) transmit(contact,"%d closing connection",QUITOK);
+ proceed=false;
break;
case c_unknown : //uknown keyword
- if (line[0]!='\000') { //always
- char info[300];
-
- (void) snprintf(info,sizeof(info),"%d command <%s> is unknown",CMDBAD,line);
- (void) tcp_write(contact,info,strlen(info));
- (void) tcp_write(contact,CRLF,strlen(CRLF));
- }
+ (void) transmit(contact,"%d command <%s> is unknown",CMDBAD,line);
break;
default :
(void) rou_alert(0,"Unable to find keyword for <%s> (Bug?)",OPEP,line);