/* return the number of char sent on channel. */
/* */
/********************************************************/
-PUBLIC int tcp_write(SOCPTR *socptr,char *buffer)
+PUBLIC int tcp_Swrite(SOCPTR *socptr,char *buffer)
{
int sent;
taille=strlen(buffer);
if (taille>0)
sent=soc_writebuffer(socptr,buffer,taille);
+ (void) rou_alert(0,"JMPDBG Swrite=<%s>",buffer);
}
return sent;
}
va_end(args);
(void) log_fprintlog(rmt->logptr,false,strloc);
(void) strcat(strloc,CRLF);
-(void) tcp_write(rmt->socptr,strloc);
+(void) tcp_Swrite(rmt->socptr,strloc);
return tcp_get_smtp_reply(rmt,WAITRMT,resp);
}
/*
char data[300];
sent=0;
- while (fgets(data,sizeof(data),qfile)!=(char *)0) {
- do { //cleaning line
+ while (fgets(data,sizeof(data)-4,qfile)!=(char *)0) {
+ do {
register int taille;
register char *ptr;
taille=strlen(data)-1;
if (taille<0)
break;
- ptr=data+taille;
+ ptr=data+taille;
if ((*ptr!='\n')&&(*ptr!='\r'))
- break;
+ break; //Line too long!
*ptr='\000';
}
while (strlen(data)>0);
- if ((strlen(data)>0)&&(data[0]=='.')) //dot escape
- (void) memmove(data+1,data,strlen(data));
- (void) rou_alert(0,"%s sending<
- sent+=tcp_write(rmt->socptr,data);
+ //dot escape
+ if ((strlen(data)>0)&&(data[0]=='.'))
+ (void) memmove(data,data+1,strlen(data+1));
+ (void) strcat(data,CRLF);
+ sent+=tcp_Swrite(rmt->socptr,data);
}
break;
}
case 2 : //end of transmission
- sent+=tcp_write(rmt->socptr,ENDDATA);
+ sent+=tcp_Swrite(rmt->socptr,ENDDATA);
break;
case 3 : //closing datafile
qfile=eml_closeqfile(qfile);
extern int tcp_getline(SOCPTR *socptr,u_int secwait,char **lineptr);
//Transmit formated data to the contact channel
-extern int tcp_write(SOCPTR *socptr,char *buffer);
+extern int tcp_Swrite(SOCPTR *socptr,char *buffer);
//wait and answer from remote and return the reply code
extern int tcp_get_smtp_reply(RMTTYP *rmt,int wait,char ***resp);
contact->transout=tcp_addline(contact->transout,line);
}
if (flush==true) {
- (void) tcp_write(contact->socptr,contact->transout);
+ (void) tcp_Swrite(contact->socptr,contact->transout);
contact->transout=rou_freestr(contact->transout);
}
line=rou_freestr(line);
phase=999; //No need to wait form response code
break;
case 2 : //send the text termination
- rspcode= tcp_get_smtp_reply(rmt,WAITRMT,&resp);
+ rspcode=tcp_get_smtp_reply(rmt,WAITRMT,&resp);
break;
case 3 : //sending session data
const char *fmt;