Socket functions such as send and receive may be interrupted by signals. Because of this, some additional code is needed, for example. to check errno == EINTR . This is described on the corresponding manual pages.
I wonder how it works when using OpenSSL functions? SSL_write , SSL_read . The pages of their people do not say anything about signals. I also tried using Google for this, but with no luck. Do you know that OpenSSL processes signals internally, or is some additional code needed? If so, how can I check if a function call was interrupted by a signal?
Update:
OpenSSL doesn't seem to handle repetitions. It sets only the “should try again” flag on the BIO object. Therefore, I need to use something like this to determine if the call has been interrupted and a retry is required:
int result = SSL_write(ssl, buff, length); if ((result < 0) && BIO_should_retry(SSL_get_wbio(ssl))) // need to retry int result = SSL_read(ssl, buff, length); if ((result < 0) && BIO_should_retry(SSL_get_rbio(ssl))) // need to retry
c ++ c linux signals openssl
Daniel Frużyński
source share