Skip to content

Commit

Permalink
Use const in record_connection_failure (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Feb 17, 2023
1 parent f2ff573 commit 3bb94d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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

0 comments on commit 3bb94d5

Please sign in to comment.