Add a comment in SetTestState from bssl_shim.

Per Nico's comment in https://boringssl-review.googlesource.com/#/c/3342/3/ssl/test/bssl_shim.cc.

Also remove unnecessary cast and change the variable name to |state|. |async|
is a remnant from when it was |AsyncState| rather than |TestState|.

Change-Id: I83f23593b0c4e64b0ddd056573f75c0aabe96f9e
Reviewed-on: https://boringssl-review.googlesource.com/6555
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
David Benjamin 2015-11-23 13:44:48 -05:00 committed by Adam Langley
parent 6ae67dfee8
commit 2205093e7e

View File

@ -121,9 +121,10 @@ static const TestConfig *GetConfigPtr(const SSL *ssl) {
return (const TestConfig *)SSL_get_ex_data(ssl, g_config_index);
}
static bool SetTestState(SSL *ssl, std::unique_ptr<TestState> async) {
if (SSL_set_ex_data(ssl, g_state_index, (void *)async.get()) == 1) {
async.release();
static bool SetTestState(SSL *ssl, std::unique_ptr<TestState> state) {
// |SSL_set_ex_data| takes ownership of |state| only on success.
if (SSL_set_ex_data(ssl, g_state_index, state.get()) == 1) {
state.release();
return true;
}
return false;