3 ms·
I'm so confused by his analysis: > A look at engine::perform implementation in engine.ipp quickly shows us that... everything is fine. Here's the beginning of
by viraptor 11y ago
I'm so confused by his analysis:
> A look at engine::perform implementation in engine.ipp quickly shows us that... everything is fine.
Here's the beginning of perform():
::ERR_clear_error();
int result = (this->*op)(data, length);
int ssl_error = ::SSL_get_error(ssl_, result);
int sys_error = static_cast<int>(::ERR_get_error());
So the lock contention is in SSL_get_error / ERR_get_error? I see a big problem here - stop checking them on success!
int result = (this->*op)(data, length);
int ssl_error = SSL_ERROR_NONE;
int sys_error = 0;
if (result != 1) {
ssl_error = ::SSL_get_error(ssl_, result);
sys_error = static_cast<int>(::ERR_get_error());
::ERR_clear_error();
}
The move of the error clearing to right after they're retrieved, may not be completely right so the rest of the code needs to be checked. But the general idea should eliminate the lock contention completely. (unless they deal with mostly connection errors)