X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/48224640cb97b694c3ea2f159c3e60d64598ba65..fd3cf789304c68aec6def76b24f61ea840c1a919:/test/src/client.c?ds=sidebyside diff --git a/test/src/client.c b/test/src/client.c index de36ef065..c143739d0 100644 --- a/test/src/client.c +++ b/test/src/client.c @@ -578,18 +578,24 @@ nextinput: case SSL_ERROR_ZERO_RETURN: break; case SSL_ERROR_SYSCALL: - printf("%s\n", ERR_error_string(ERR_get_error(), NULL)); break; + printf("%s\n", ERR_error_string(ERR_get_error(), NULL)); rc = -1; + break; case SSL_ERROR_SSL: - printf("%s\n", ERR_error_string(ERR_get_error(), NULL)); break; + printf("%s\nTLS terminated\n", ERR_error_string(ERR_get_error(), NULL)); SSL_shutdown(srv->ssl); SSL_free(srv->ssl); srv->tls_active = FALSE; + { /* OpenSSL leaves it in restartsys mode */ + struct sigaction act = {.sa_handler = sigalrm_handler_flag, .sa_flags = 0}; + sigalrm_seen = 1; + sigaction(SIGALRM, &act, NULL); + } + *inptr = 0; goto nextinput; default: printf("SSL error code %d\n", error); } - #endif #ifdef HAVE_GNUTLS rc = gnutls_record_recv(tls_session, CS inbuffer, bsiz - 1); @@ -601,6 +607,8 @@ nextinput: if (rc < 0) { + if (errno == EINTR && sigalrm_seen && resp_optional) + continue; /* next scriptline */ printf("Read error %s\n", strerror(errno)); exit(81); }