Skip to content

Commit

Permalink
Actually commited changes this time. (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanHenson authored Apr 10, 2019
1 parent eeb0597 commit 5c8b3e0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
9 changes: 7 additions & 2 deletions bin/elasticurl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,11 @@ int main(int argc, char **argv) {

struct aws_event_loop_group el_group;
aws_event_loop_group_default_init(&el_group, allocator, 1);
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, NULL, NULL);

struct aws_host_resolver resolver;
aws_host_resolver_init_default(&resolver, allocator, 8, &el_group);

struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);

struct aws_socket_options socket_options = {
.type = AWS_SOCKET_STREAM,
Expand Down Expand Up @@ -580,7 +584,8 @@ int main(int argc, char **argv) {
aws_mutex_lock(&app_ctx.mutex);
aws_condition_variable_wait_pred(&app_ctx.c_var, &app_ctx.mutex, s_completion_predicate, &app_ctx);

aws_client_bootstrap_destroy(bootstrap);
aws_client_bootstrap_release(bootstrap);
aws_host_resolver_clean_up(&resolver);
aws_event_loop_group_clean_up(&el_group);

if (tls_ctx) {
Expand Down
11 changes: 7 additions & 4 deletions tests/test_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct tester {
struct aws_allocator *alloc;
struct aws_logger logger;
struct aws_event_loop_group event_loop_group;
struct aws_host_resolver host_resolver;
struct aws_server_bootstrap *server_bootstrap;
struct aws_http_server *server;
struct aws_client_bootstrap *client_bootstrap;
Expand Down Expand Up @@ -205,7 +206,7 @@ static int s_tester_init(struct tester *tester, const struct tester_options *opt
ASSERT_SUCCESS(aws_condition_variable_init(&tester->wait_cvar));

ASSERT_SUCCESS(aws_event_loop_group_default_init(&tester->event_loop_group, tester->alloc, 1));

ASSERT_SUCCESS(aws_host_resolver_init_default(&tester->host_resolver, tester->alloc, 8, &tester->event_loop_group));
tester->server_bootstrap = aws_server_bootstrap_new(tester->alloc, &tester->event_loop_group);
ASSERT_NOT_NULL(tester->server_bootstrap);

Expand Down Expand Up @@ -244,7 +245,8 @@ static int s_tester_init(struct tester *tester, const struct tester_options *opt
return AWS_OP_SUCCESS;
}

tester->client_bootstrap = aws_client_bootstrap_new(tester->alloc, &tester->event_loop_group, NULL, NULL);
tester->client_bootstrap =
aws_client_bootstrap_new(tester->alloc, &tester->event_loop_group, &tester->host_resolver, NULL);
ASSERT_NOT_NULL(tester->client_bootstrap);

/* Connect */
Expand Down Expand Up @@ -274,11 +276,12 @@ static int s_tester_clean_up(struct tester *tester) {

ASSERT_SUCCESS(s_tester_wait(tester, s_tester_connection_shutdown_pred));

aws_client_bootstrap_destroy(tester->client_bootstrap);
aws_client_bootstrap_release(tester->client_bootstrap);
}

aws_http_server_destroy(tester->server);
aws_server_bootstrap_destroy(tester->server_bootstrap);
aws_server_bootstrap_release(tester->server_bootstrap);
aws_host_resolver_clean_up(&tester->host_resolver);
aws_event_loop_group_clean_up(&tester->event_loop_group);
aws_http_library_clean_up();
aws_logger_clean_up(&tester->logger);
Expand Down

0 comments on commit 5c8b3e0

Please sign in to comment.