Skip to content

Commit bdeaea3

Browse files
committed
Remove check
1 parent 0f5a610 commit bdeaea3

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

http-clients/apache5-client/src/main/java/software/amazon/awssdk/http/apache5/Apache5HttpClient.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -778,10 +778,7 @@ private static ConnectionConfig getConnectionConfig(AttributeMap standardOptions
778778
.setSocketTimeout(Timeout.ofMilliseconds(
779779
standardOptions.get(SdkHttpConfigurationOption.READ_TIMEOUT).toMillis()));
780780
Duration connectionTtl = standardOptions.get(SdkHttpConfigurationOption.CONNECTION_TIME_TO_LIVE);
781-
if (!connectionTtl.isNegative() && !connectionTtl.isZero()) {
782-
// Note: TTL=0 is infinite in 4.x vs immediate expiration in 5.x
783-
connectionConfigBuilder.setTimeToLive(TimeValue.ofMilliseconds(connectionTtl.toMillis()));
784-
}
781+
connectionConfigBuilder.setTimeToLive(TimeValue.ofMilliseconds(connectionTtl.toMillis()));
785782
return connectionConfigBuilder.build();
786783
}
787784

http-clients/apache5-client/src/test/java/software/amazon/awssdk/http/apache5/ConnectionTtlTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void execute_ttlNegative_connectionNotClosed() throws Exception {
110110
}
111111

112112
@Test
113-
public void execute_ttlIsZero_connectionNotClosed() throws Exception {
113+
public void execute_ttlIsZero_connectionClosed() throws Exception {
114114
TestTlsSocketStrategy socketStrategy = TestTlsSocketStrategy.create();
115115

116116
apache5 = Apache5HttpClient.builder()
@@ -123,7 +123,7 @@ public void execute_ttlIsZero_connectionNotClosed() throws Exception {
123123
doGetCall(apache5);
124124

125125
List<SSLSocket> sockets = socketStrategy.getCreatedSockets();
126-
assertThat(sockets).hasSize(1);
126+
assertThat(sockets).hasSize(2);
127127
}
128128

129129
@Test

0 commit comments

Comments
 (0)