5 #define WHO "ssl_timeout"
17 if (taia_now(&now) == -1) {
22 taia_add(&deadline,&now,&deadline);
24 rfd = SSL_get_fd(ssl);
25 wfd = SSL_get_fd(ssl);
27 SSL_set_accept_state(ssl);
37 x.events = IOPAUSE_READ;
39 if (x.fd == -1)
return -1;
42 x.events = IOPAUSE_WRITE;
44 if (x.fd == -1)
return -1;
47 if (taia_now(&now) == -1) {
51 iopause(&x,1,&deadline,&now);
53 if (taia_less(&deadline,&now)) {
73 taia_add(&deadline,&now,&deadline);
75 rfd = SSL_get_fd(ssl);
76 wfd = SSL_get_fd(ssl);
78 SSL_set_connect_state(ssl);
88 x.events = IOPAUSE_READ;
90 if (x.fd == -1)
return -1;
93 x.events = IOPAUSE_WRITE;
95 if (x.fd == -1)
return -1;
98 if (taia_now(&now) == -1) {
102 iopause(&x,1,&deadline,&now);
103 if (x.revents)
break;
104 if (taia_less(&deadline,&now)) {
119 if (!stralloc_copys(&
sslerror,
""))
return -1;
121 while ((err = ERR_get_error()) != 0) {
122 ERR_error_string_n(err,
buf,
sizeof(
buf));
124 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)