You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2021/11/11 11:05:53 UTC

[httpcomponents-core] branch master updated: Use cameCase in isSoKeepAlive method.

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 47787fe  Use cameCase in isSoKeepAlive method.
47787fe is described below

commit 47787fee8a74b1edfc92f555a6b3a6dcd291433b
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Thu Nov 11 09:57:48 2021 +0100

    Use cameCase in isSoKeepAlive method.
---
 .../java/org/apache/hc/core5/reactor/IOReactorConfig.java    | 12 +++++++++++-
 .../org/apache/hc/core5/reactor/SingleCoreIOReactor.java     |  2 +-
 .../org/apache/hc/core5/reactor/IOReactorConfigTest.java     |  2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorConfig.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorConfig.java
index be49929..034fce9 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorConfig.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/IOReactorConfig.java
@@ -130,7 +130,17 @@ public final class IOReactorConfig {
 
     /**
      * @see Builder#setSoKeepAlive(boolean)
+     * @since 5.2
      */
+    public boolean isSoKeepAlive() {
+        return this.soKeepAlive;
+    }
+
+    /**
+     * @see Builder#setSoKeepAlive(boolean)
+     * @deprecated use {@link #isSoKeepAlive()}.
+     */
+    @Deprecated
     public boolean isSoKeepalive() {
         return this.soKeepAlive;
     }
@@ -205,7 +215,7 @@ public final class IOReactorConfig {
             .setSoTimeout(config.getSoTimeout())
             .setSoReuseAddress(config.isSoReuseAddress())
             .setSoLinger(config.getSoLinger())
-            .setSoKeepAlive(config.isSoKeepalive())
+            .setSoKeepAlive(config.isSoKeepAlive())
             .setTcpNoDelay(config.isTcpNoDelay())
             .setSndBufSize(config.getSndBufSize())
             .setRcvBufSize(config.getRcvBufSize())
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/SingleCoreIOReactor.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/SingleCoreIOReactor.java
index be273d1..d494c3a 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/SingleCoreIOReactor.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/SingleCoreIOReactor.java
@@ -267,7 +267,7 @@ class SingleCoreIOReactor extends AbstractSingleCoreIOReactor implements Connect
 
     private void prepareSocket(final Socket socket) throws IOException {
         socket.setTcpNoDelay(this.reactorConfig.isTcpNoDelay());
-        socket.setKeepAlive(this.reactorConfig.isSoKeepalive());
+        socket.setKeepAlive(this.reactorConfig.isSoKeepAlive());
         if (this.reactorConfig.getSndBufSize() > 0) {
             socket.setSendBufferSize(this.reactorConfig.getSndBufSize());
         }
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/reactor/IOReactorConfigTest.java b/httpcore5/src/test/java/org/apache/hc/core5/reactor/IOReactorConfigTest.java
index 2bb9a87..cc956e5 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/reactor/IOReactorConfigTest.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/reactor/IOReactorConfigTest.java
@@ -58,7 +58,7 @@ public class IOReactorConfigTest {
         Assert.assertEquals(Timeout.ofSeconds(10), reactorConfig.getSoTimeout());
         Assert.assertTrue(reactorConfig.isSoReuseAddress());
         Assert.assertEquals(TimeValue.ofSeconds(30), reactorConfig.getSoLinger());
-        Assert.assertTrue(reactorConfig.isSoKeepalive());
+        Assert.assertTrue(reactorConfig.isSoKeepAlive());
         Assert.assertFalse(reactorConfig.isTcpNoDelay());
         Assert.assertEquals(0x02, reactorConfig.getTrafficClass());
         Assert.assertEquals(32767, reactorConfig.getSndBufSize());