int newhandle;
-(void) printf("JMPDBG soc handle='%d'\n",soc->handle);
if ((newhandle=accept(soc->handle,(SOCKADDR *)0,(socklen_t *)0))<0) {
if (errno==EAGAIN)
errno=EWOULDBLOCK;
int phase;
_Bool proceed;
-(void) printf("JMPDBG starting from waitincoming\n");
newsoc=(SOCTYP *)0;
ready=false;
phase=0;
}
phase++;
}
-(void) printf("JMPDBG exit from waitincoming\n");
return newsoc;
#undef OPEP
}
polling[0].events=POLLIN|POLLPRI;
polling[0].revents=(short)0;
- (void) printf("JMPDBG modtls='%d'\n",soc->modtls);
switch (soc->modtls) {
case true :
polling[0].fd=SSL_get_fd(soc->tls->ssl);
phase=999; //No End Of Line yet
break;
case 3 : //duplicating carpile
+ (void) printf("JMPDBG carpil=<%s>\n",soc->carpile);
*lineptr=calloc(soc->carin+1,sizeof(char));
*eol='\000';
(void) strcpy(*lineptr,soc->carpile);
(void) strcat(*lineptr,soc->EOL);
+ (void) printf("JMPDBG *lineptr=<%s>\n",*lineptr);
got=strlen(*lineptr);
break;
case 4 : //managing carpile
switch (soc->modtls) {
case true :
got=tls_read(soc->tls,buffer,limit);
+ (void) printf("JMPDBG tls_read got='%d'\n",got);
break;
case false :
got=recv(soc->handle,buffer,limit,MSG_DONTWAIT);
if (got>0) { //we have recived some character
soc->carin+=got; //managing carpile
soc->carpile[soc->carin]='\000';
+ (void) printf("JMPDBG soc_receive carpile=<%s>\n",soc->carpile);
}
}
#undef OPEP
int sent;
sent=0;
-(void) printf("JMPDBG sending<%s>\n",buffer);
if (tls!=(TLSTYP *)0) {
_Bool proceed;
int sofar;
while (proceed==true) {
proceed=false;
sofar=SSL_write(tls->ssl,buffer,tosend);
- switch (sent) {
+ switch (sofar) {
case -1 : //trouble to write
switch (SSL_get_error(tls->ssl,-1)) {
case SSL_ERROR_WANT_READ : //"wanted" error