Skip to content

Commit 6c98b24

Browse files
authored
ConnectionManager HTTP/2 updates (#360)
- Fix a bug about goaway received. Not release a connection that's in used. - Don't vend connection to user until the settings done. To help user knows that the connection is really ready to use. TODO: - Does it worth to put tests about http2 stuff here as we also test the stream manager stuff for http2 as the user of connection manager? I think we can just add todo here...
1 parent 7e4cace commit 6c98b24

File tree

4 files changed

+244
-113
lines changed

4 files changed

+244
-113
lines changed

include/aws/http/connection_manager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ struct aws_http_connection_manager *aws_http_connection_manager_new(
121121
* Requests a connection from the manager. The requester is notified of
122122
* an acquired connection (or failure to acquire) via the supplied callback.
123123
*
124+
* For HTTP/2 connections, the callback will not fire until the server's settings have been received.
125+
*
124126
* Once a connection has been successfully acquired from the manager it
125127
* must be released back (via aws_http_connection_manager_release_connection)
126128
* at some point. Failure to do so will cause a resource leak.

include/aws/http/private/connection_manager_system_vtable.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ typedef bool(aws_http_connection_is_connection_available_fn)(const struct aws_ht
1919
typedef bool(aws_http_connection_manager_is_callers_thread_fn)(struct aws_channel *channel);
2020
typedef struct aws_channel *(aws_http_connection_manager_connection_get_channel_fn)(
2121
struct aws_http_connection *connection);
22+
typedef enum aws_http_version(aws_http_connection_manager_connection_get_version_fn)(
23+
const struct aws_http_connection *connection);
2224

2325
struct aws_http_connection_manager_system_vtable {
2426
/*
@@ -31,6 +33,7 @@ struct aws_http_connection_manager_system_vtable {
3133
aws_io_clock_fn *get_monotonic_time;
3234
aws_http_connection_manager_is_callers_thread_fn *is_callers_thread;
3335
aws_http_connection_manager_connection_get_channel_fn *connection_get_channel;
36+
aws_http_connection_manager_connection_get_version_fn *connection_get_version;
3437
};
3538

3639
AWS_HTTP_API

0 commit comments

Comments
 (0)