diff --git a/aeron-archive/src/main/c/client/aeron_archive_context.c b/aeron-archive/src/main/c/client/aeron_archive_context.c index 580affac32..ba02afe776 100644 --- a/aeron-archive/src/main/c/client/aeron_archive_context.c +++ b/aeron-archive/src/main/c/client/aeron_archive_context.c @@ -76,6 +76,8 @@ int aeron_archive_context_init(aeron_archive_context_t **ctx) _ctx->idle_strategy_state = NULL; _ctx->owns_idle_strategy = false; + aeron_archive_context_set_credentials_supplier(_ctx, NULL, NULL, NULL, NULL); + _ctx->error_handler = NULL; _ctx->error_handler_clientd = NULL; diff --git a/aeron-archive/src/main/c/client/aeron_archive_credentials_supplier.c b/aeron-archive/src/main/c/client/aeron_archive_credentials_supplier.c index 56febeee95..76f4a9e9f3 100644 --- a/aeron-archive/src/main/c/client/aeron_archive_credentials_supplier.c +++ b/aeron-archive/src/main/c/client/aeron_archive_credentials_supplier.c @@ -19,6 +19,10 @@ aeron_archive_encoded_credentials_t *aeron_archive_credentials_supplier_encoded_credentials(aeron_archive_credentials_supplier_t *supplier) { + if (NULL == supplier->encoded_credentials) { + return NULL; + } + return supplier->encoded_credentials(supplier->clientd); } @@ -26,6 +30,10 @@ aeron_archive_encoded_credentials_t *aeron_archive_credentials_supplier_on_chall aeron_archive_credentials_supplier_t *supplier, aeron_archive_encoded_credentials_t *encoded_challenge) { + if (NULL == supplier->on_challenge) { + return NULL; + } + return supplier->on_challenge(encoded_challenge, supplier->clientd); } diff --git a/aeron-archive/src/main/c/client/aeron_archive_proxy.c b/aeron-archive/src/main/c/client/aeron_archive_proxy.c index 65c68c81ef..d13d530610 100644 --- a/aeron-archive/src/main/c/client/aeron_archive_proxy.c +++ b/aeron-archive/src/main/c/client/aeron_archive_proxy.c @@ -150,8 +150,8 @@ bool aeron_archive_proxy_try_connect( strlen(control_response_channel)); aeron_archive_client_authConnectRequest_put_encodedCredentials( &codec, - encoded_credentials->data, - encoded_credentials->length); + NULL == encoded_credentials ? "" : encoded_credentials->data, + NULL == encoded_credentials ? 0 : encoded_credentials->length); return aeron_archive_proxy_offer_once( archive_proxy, @@ -197,8 +197,8 @@ bool aeron_archive_proxy_challenge_response( aeron_archive_client_challengeResponse_set_correlationId(&codec, correlation_id); aeron_archive_client_challengeResponse_put_encodedCredentials( &codec, - encoded_credentials->data, - encoded_credentials->length); + NULL == encoded_credentials ? "" : encoded_credentials->data, + NULL == encoded_credentials ? 0 : encoded_credentials->length); return aeron_archive_proxy_offer_once( archive_proxy,