Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions source/s3_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2627,10 +2627,14 @@ void aws_s3_client_notify_connection_finished(
connection->retry_token = NULL;
}

/* If we weren't successful, and we're here, that means this failure is not eligible for a retry. So finish the
* request, and close our HTTP connection. */
/* If we weren't successful, and we're here, that means this failure is not eligible for a retry.
* Close the HTTP connection only for transport-level failures (no HTTP response was received).
* If we received any HTTP response (response_status > 0), the connection is healthy and should
* be returned to the pool rather than destroyed — a 4xx is an application-level error, not a
* transport error. */
if (finish_code != AWS_S3_CONNECTION_FINISH_CODE_SUCCESS) {
if (connection->http_connection != NULL) {
bool received_response = request->send_data.response_status > 0;
if (!received_response && connection->http_connection != NULL) {
aws_http_connection_close(connection->http_connection);
}
}
Expand Down
Loading