File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
http-clients/apache5-client/src
main/java/software/amazon/awssdk/http/apache5
test/java/software/amazon/awssdk/http/apache5 Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments