if (tls!=(TLSTYP *)0) {
_Bool proceed;
int sofar;
- int count;
- count=0;
proceed=true;
(void) printf("JMPDBG sending <%s>\n",buffer);
while (proceed==true) {
int status;
+ status=0;
proceed=false;
sofar=SSL_write(tls->ssl,buffer,tosend);
- (void) printf("JMPDBG sent sofar='%d' count='%d'\n",sofar,count);
+ (void) printf("JMPDBG sent sofar='%d'\n",sofar);
switch (sofar) {
case -1 : //trouble to write
switch (status=SSL_get_error(tls->ssl,-1)) {
case SSL_ERROR_WANT_WRITE : //"Wanted" error
(void) printf("JMPDBG SSL_get_error='%d'\n",status);
(void) usleep(1000);
- count++;
proceed=true;
break;
default :
(void) showtlserror(tls,0,"show SSL error",OPEP);
break;
}
- (void) sleep(1);
break;
default : //some character sent
sent+=sofar;
got=-1;
if (tls!=(TLSTYP *)0) {
- _Bool proceed;
- int count;
-
- count=0;
- proceed=true;
-
- (void) printf("JMPDBG receiving\n");
- while (proceed==true) {
- int status;
-
- proceed=false;
- got=SSL_read(tls->ssl,buffer,maxread);
- (void) printf("JMPDBG read got='%d' count='%d'\n",got,count);
- switch (got) {
- case -1 : //trouble to write
- switch (status=SSL_get_error(tls->ssl,-1)) {
- case SSL_ERROR_WANT_READ : //"wanted" error
- case SSL_ERROR_WANT_WRITE : //
- (void) printf("JMPDBG SSL_get_error='%d'\n",status);
- (void) usleep(1000);
- break;
- default :
- (void) showtlserror(tls,-1,"%s Premature EOF with crypted link",OPEP);
- break;
- }
- break;
- case 0 : //no char sent
- switch (SSL_get_error(tls->ssl,0)) {
- case SSL_ERROR_SYSCALL : //EOF received?
- tls->goteof=true;
- if (ERR_get_error()!=0)
- (void) rou_alert(0,"%s wrong EOF",OPEP);
- break;
- default :
- (void) rou_alert(0,"%s Unexpected SSL_read error='%d'",
- OPEP,SSL_get_error(tls->ssl,0));
- (void) showtlserror(tls,0,"show SSL error",OPEP);
- break;
- }
- break;
- default : //some character received
- break;
- }
+ int status;
+
+ status=0;
+ got=SSL_read(tls->ssl,buffer,maxread);
+ (void) printf("JMPDBG read got='%d'\n",got);
+ switch (got) {
+ case -1 : //trouble to write
+ switch (status=SSL_get_error(tls->ssl,-1)) {
+ case SSL_ERROR_WANT_READ : //"wanted" error
+ case SSL_ERROR_WANT_WRITE : //
+ (void) printf("JMPDBG SSL_get_error='%d'\n",status);
+ (void) usleep(1000);
+ break;
+ default :
+ (void) showtlserror(tls,-1,"%s Premature EOF with crypted link",OPEP);
+ break;
+ }
+ break;
+ case 0 : //no char sent
+ switch (SSL_get_error(tls->ssl,0)) {
+ case SSL_ERROR_SYSCALL : //EOF received?
+ tls->goteof=true;
+ if (ERR_get_error()!=0)
+ (void) rou_alert(0,"%s wrong EOF",OPEP);
+ break;
+ default :
+ (void) rou_alert(0,"%s Unexpected SSL_read error='%d'",
+ OPEP,SSL_get_error(tls->ssl,0));
+ (void) showtlserror(tls,0,"show SSL error",OPEP);
+ break;
+ }
+ break;
+ default : //some character received
+ break;
}
}
return got;