Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use const in record_connection_failure #550

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/aws/io/host_resolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct aws_host_resolver_vtable {
/** gives your implementation a hint that an address has some failed connections occuring. Do whatever you want (or
* nothing) about it.
*/
int (*record_connection_failure)(struct aws_host_resolver *resolver, struct aws_host_address *address);
int (*record_connection_failure)(struct aws_host_resolver *resolver, const struct aws_host_address *address);
/** wipe out anything you have cached. */
int (*purge_cache)(struct aws_host_resolver *resolver);
/** get number of addresses for a given host. */
Expand Down Expand Up @@ -212,7 +212,7 @@ AWS_IO_API int aws_host_resolver_resolve_host(
*/
AWS_IO_API int aws_host_resolver_record_connection_failure(
struct aws_host_resolver *resolver,
struct aws_host_address *address);
const struct aws_host_address *address);

/**
* calls purge_cache on the vtable.
Expand Down
8 changes: 6 additions & 2 deletions source/host_resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ int aws_host_resolver_purge_cache(struct aws_host_resolver *resolver) {
return resolver->vtable->purge_cache(resolver);
}

int aws_host_resolver_record_connection_failure(struct aws_host_resolver *resolver, struct aws_host_address *address) {
int aws_host_resolver_record_connection_failure(
struct aws_host_resolver *resolver,
const struct aws_host_address *address) {
AWS_ASSERT(resolver->vtable && resolver->vtable->record_connection_failure);
return resolver->vtable->record_connection_failure(resolver, address);
}
Expand Down Expand Up @@ -547,7 +549,9 @@ static inline void process_records(
}
}

static int resolver_record_connection_failure(struct aws_host_resolver *resolver, struct aws_host_address *address) {
static int resolver_record_connection_failure(
struct aws_host_resolver *resolver,
const struct aws_host_address *address) {
struct default_host_resolver *default_host_resolver = resolver->impl;

AWS_LOGF_INFO(
Expand Down