PUBLIC _Bool soc_starttls(SOCPTR *socptr,_Bool server)
{
+#define OPEP "devsoc.c:soc_starttls,"
_Bool ok;
SOCTYP *soc;
char buffer[100];
peerip=soc_getaddrinfo(socptr,false,false);
- (void) usleep(100000); //lets wait for 100 millisec
- tosend=snprintf(buffer,sizeof(buffer),"%d 2.0.0 Ready to start TLS%s",
- SIGNON,CRLF);
- (void) soc_writebuffer(soc,buffer,tosend);
- if ((soc->tls=tls_opentls(soc->handle,true))!=(TLSTYP *)0) {
+ switch (server) {
+ case true :
+ (void) usleep(100000); //lets wait for 100 millisec
+ tosend=snprintf(buffer,sizeof(buffer),"%d 2.0.0 Ready to start TLS%s",
+ SIGNON,CRLF);
+ (void) soc_writebuffer(soc,buffer,tosend);
+ soc->tls=tls_opentls(soc->handle,true);
+ break;
+ case false :
+ (void) rou_alert(0,"%s JMPDBG starting cleint mode",OPEP);
+ break;
+ }
+ if (soc->tls!=(TLSTYP *)0) {
soc->proto=pro_smtps;
soc->modtls=true;
- (void) socpurge(soc,peerip);
ok=true;
+ switch (server) {
+ case true :
+ (void) socpurge(soc,peerip);
+ break;
+ case false :
+ break;
+ }
}
peerip=rou_freestr(peerip);
}
return ok;
+#undef OPEP
}
/*
^L