Skip to content

HttpConnection always uses the default ClientBootstrap #819

@philossh

Description

@philossh

Describe the bug

In HttpConnection.cpp, when setting up aws_http_client_connection_options, the code decides whether to use the caller’s Bootstrap or the default client bootstrap. The condition uses the wrong variable, so a user-provided Bootstrap is never used.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Use the user-provided ClientBootstrap

Current Behavior

Always use the default ClientBootstrap.

Reproduction Steps

    Http::HttpClientConnectionOptions httpClientConnectionOptions;
    httpClientConnectionOptions.Bootstrap = &clientBootstrap;

    Http::HttpClientConnection::CreateConnection(httpClientConnectionOptions, allocator);

Possible Solution

--- a/source/http/HttpConnection.cpp
+++ b/source/http/HttpConnection.cpp
@@ -133,7 +133,7 @@ namespace Aws
                 AWS_ZERO_STRUCT(options);
                 options.self_size = sizeof(aws_http_client_connection_options);
 
-                if (options.bootstrap != nullptr)
+                if (connectionOptions.Bootstrap != nullptr)
                 {
                     options.bootstrap = connectionOptions.Bootstrap->GetUnderlyingHandle();
                 }

Additional Information/Context

No response

aws-crt-cpp version used

v0.37.2

Compiler and version used

.

Operating System and version

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions