Skip to content

Commit 1b431bc

Browse files
committed
Postfix for #7951: Make it possible to handle attach errors in key holder plugin, fixed lost warnings
1 parent fd135f4 commit 1b431bc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/remote/client/interface.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8412,27 +8412,27 @@ static bool init(CheckStatusWrapper* status, ClntAuthBlock& cBlock, rem_port* po
84128412
}
84138413
catch (const Exception& ex)
84148414
{
8415-
FbLocalStatus stAttach;
8415+
FbLocalStatus stAttach, statusAfterAttach;
84168416
ex.stuffException(&stAttach);
84178417

84188418
const ISC_STATUS* v = stAttach->getErrors();
8419-
84208419
if (cb && (fb_utils::containsErrorCode(v, isc_bad_crypt_key) ||
8421-
fb_utils::containsErrorCode(v, isc_db_crypt_key)) &&
8422-
(cb->afterAttach(status, file_name.c_str(), &stAttach) == ICryptKeyCallback::DO_RETRY))
8420+
fb_utils::containsErrorCode(v, isc_db_crypt_key)))
84238421
{
8424-
continue;
8422+
auto rc = cb->afterAttach(&statusAfterAttach, file_name.c_str(), &stAttach);
8423+
if (statusAfterAttach.isSuccess() && rc == ICryptKeyCallback::DO_RETRY)
8424+
continue;
84258425
}
84268426

8427-
status->init();
84288427
throw;
84298428
}
84308429

84318430
// response is success
84328431
if (cb)
84338432
{
8434-
cb->afterAttach(status, file_name.c_str(), nullptr);
8435-
status->init();
8433+
FbLocalStatus statusAfterAttach;
8434+
cb->afterAttach(&statusAfterAttach, file_name.c_str(), nullptr);
8435+
check(&statusAfterAttach);
84368436
}
84378437

84388438
return true;

0 commit comments

Comments
 (0)