5#define WHO "ssl_timeout"
16 if (taia_now(&now) == -1) {
21 taia_add(&deadline,&now,&deadline);
23 rfd = SSL_get_fd(ssl);
24 wfd = SSL_get_fd(ssl);
26 SSL_set_accept_state(ssl);
36 x.events = IOPAUSE_READ;
38 if (x.fd == -1)
return -1;
41 x.events = IOPAUSE_WRITE;
43 if (x.fd == -1)
return -1;
46 if (taia_now(&now) == -1) {
50 iopause(&x,1,&deadline,&now);
52 if (taia_less(&deadline,&now)) {
71 taia_add(&deadline,&now,&deadline);
73 rfd = SSL_get_fd(ssl);
74 wfd = SSL_get_fd(ssl);
76 SSL_set_connect_state(ssl);
86 x.events = IOPAUSE_READ;
88 if (x.fd == -1)
return -1;
91 x.events = IOPAUSE_WRITE;
93 if (x.fd == -1)
return -1;
96 if (taia_now(&now) == -1) {
100 iopause(&x,1,&deadline,&now);
101 if (x.revents)
break;
102 if (taia_less(&deadline,&now)) {
117 if (!stralloc_copys(&
sslerror,
""))
return -1;
119 while ((err = ERR_get_error()) != 0) {
120 ERR_error_string_n(err,
buf,
sizeof(
buf));
122 if (!stralloc_cats(&
sslerror,
" "))
return -1;
int ssl_timeoutaccept(SSL *ssl, unsigned int timeout)
int ssl_timeoutconn(SSL *ssl, unsigned int timeout)
Header file to be used with sqmail; previously called ssl.h. (name clash)