-
Notifications
You must be signed in to change notification settings - Fork 38
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
Expose additional configuration options for Http connection manager #204
Conversation
include/aws/s3/s3_client.h
Outdated
struct aws_s3_tcp_keep_alive_options { | ||
|
||
/* Set keepalive true to periodically transmit messages for detecting a disconnected peer.*/ | ||
bool keepalive; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need bool here? wouldnt null keep alive indicate keep alive is on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean null keep alive will indicate that keep alive is off? Since it is just a normal struct, it can't be null. We can turn it into a pointer and remove the keepalive. If the pointer is null, that would mean keepalive is off and vice versa.
Otherwise, we need a keepalive variable so that users can just set keepalive to true and use default values for the rest. This is basically a partial struct from aws_socket_options which has two extra fields enum aws_socket_type type and enum aws_socket_domain domain. I didn't want to allow users to override these two fields.
if (client_config->proxy_ev_settings->tls_options) { | ||
client->proxy_ev_tls_options = aws_mem_calloc(allocator, 1, sizeof(struct aws_tls_connection_options)); | ||
if (aws_tls_connection_options_copy(client->proxy_ev_tls_options, client->proxy_ev_settings->tls_options)) { | ||
goto on_error; | ||
} | ||
client->proxy_ev_settings->tls_options = client->proxy_ev_tls_options; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way to deep copy proxy_ev_settings->tls_options? The problem is that in proxy_ev_settings, tls_options is declared as const. So if I just use that directly instead of using client->proxy_ev_tls_options, I get a bunch of warnings about passing const tls_options to other functions which expect a non-const object like aws_mem_release.
if (client_config->proxy_options) { | ||
client->proxy_config = aws_http_proxy_config_new_from_proxy_options(allocator, client_config->proxy_options); | ||
if (client->proxy_config == NULL) { | ||
goto on_error; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unable to write a test for the proxy_config override. As the struct proxy_config implementation detail is private in the aws-c-http repo, I can't access its members to assert.
Based on awslabs/aws-c-s3#204, this exposes the following `ClientConfiguration` options to CRT: - `connect_timeout_ms`: S3 socket connection timeout; - `enableTcpKeepAlive`: enable TCP keep-alive probes; - `tcpKeepAliveIntervalMs`: TCP keep-alive wait/probe interval; - `lowSpeedLimit`: `aws-c-http` TCP connection speed monitoring; - `requestTimeoutMs`: to provide upper bound on the monitoring interval for `aws-c-http` TCP connection speed monitoring.
Based on awslabs/aws-c-s3#204, this exposes the following `ClientConfiguration` options to CRT: - `connect_timeout_ms`: S3 socket connection timeout; - `enableTcpKeepAlive`: enable TCP keep-alive probes; - `tcpKeepAliveIntervalMs`: TCP keep-alive wait/probe interval; - `lowSpeedLimit`: `aws-c-http` TCP connection speed monitoring; - `requestTimeoutMs`: to provide upper bound on the monitoring interval for `aws-c-http` TCP connection speed monitoring.
* [aws-cpp-sdk-s3-crt]: Configure TCP connection-monitoring options Based on awslabs/aws-c-s3#204, this exposes the following `ClientConfiguration` options to CRT: - `connect_timeout_ms`: S3 socket connection timeout; - `enableTcpKeepAlive`: enable TCP keep-alive probes; - `tcpKeepAliveIntervalMs`: TCP keep-alive wait/probe interval; - `lowSpeedLimit`: `aws-c-http` TCP connection speed monitoring; - `requestTimeoutMs`: to provide upper bound on the monitoring interval for `aws-c-http` TCP connection speed monitoring. * Use stack-allocated rather than dynamically allocated variables * add code gen * use int instead of uint16_t and uint32_t * use static_cast * rework static cast * add another static cast * remove static cast and use unsigned long Co-authored-by: Gerrit Renker <grenker@aurora.tech>
* [aws-cpp-sdk-s3-crt]: Configure TCP connection-monitoring options Based on awslabs/aws-c-s3#204, this exposes the following `ClientConfiguration` options to CRT: - `connect_timeout_ms`: S3 socket connection timeout; - `enableTcpKeepAlive`: enable TCP keep-alive probes; - `tcpKeepAliveIntervalMs`: TCP keep-alive wait/probe interval; - `lowSpeedLimit`: `aws-c-http` TCP connection speed monitoring; - `requestTimeoutMs`: to provide upper bound on the monitoring interval for `aws-c-http` TCP connection speed monitoring. * Use stack-allocated rather than dynamically allocated variables * add code gen * use int instead of uint16_t and uint32_t * use static_cast * rework static cast * add another static cast * remove static cast and use unsigned long Co-authored-by: Gerrit Renker <grenker@aurora.tech>
* [aws-cpp-sdk-s3-crt]: Configure TCP connection-monitoring options Based on awslabs/aws-c-s3#204, this exposes the following `ClientConfiguration` options to CRT: - `connect_timeout_ms`: S3 socket connection timeout; - `enableTcpKeepAlive`: enable TCP keep-alive probes; - `tcpKeepAliveIntervalMs`: TCP keep-alive wait/probe interval; - `lowSpeedLimit`: `aws-c-http` TCP connection speed monitoring; - `requestTimeoutMs`: to provide upper bound on the monitoring interval for `aws-c-http` TCP connection speed monitoring. * Use stack-allocated rather than dynamically allocated variables * add code gen * use int instead of uint16_t and uint32_t * use static_cast * rework static cast * add another static cast * remove static cast and use unsigned long Co-authored-by: Gerrit Renker <grenker@aurora.tech>
Issue #, if available: awslabs/aws-crt-java#502 & aws/aws-sdk-cpp#1882
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.