Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)
if (!TEST_true(ret == 1 || is_want(c_ssl, ret)))
goto err;
- if (ret == 1)
+ if (ret == 1) {
c_connected = 1;
+ } else {
+ /*
+ * keep timer ticking to keep handshake running.
+ * The timer is important for calculation of ping deadline.
+ * If things stall for whatever reason we at least send
+ * ACK eliciting ping to let peer know we are here ready
+ * to hear back.
+ */
+ if (!TEST_true(CRYPTO_THREAD_write_lock(fake_time_lock)))
+ goto err;
+ fake_time = ossl_time_add(fake_time, ossl_ms2time(100));
+ CRYPTO_THREAD_unlock(fake_time_lock);
+ }
}
if (c_connected && !c_write_done) {