* Convert argument to const
* Correct javadoc for isStale()
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/BHttpConnectionBase.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/BHttpConnectionBase.java
index 9d2531d..f22ddc2 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/BHttpConnectionBase.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/BHttpConnectionBase.java
@@ -67,6 +67,7 @@
class BHttpConnectionBase implements BHttpConnection {
+ private static final Timeout STALE_CHECK_TIMEOUT = Timeout.ofMilliseconds(1);
final Http1Config http1Config;
final SessionInputBufferImpl inBuffer;
final SessionOutputBufferImpl outbuffer;
@@ -292,7 +293,7 @@
return true;
}
try {
- final int bytesRead = fillInputBuffer(Timeout.ofMilliseconds(1));
+ final int bytesRead = fillInputBuffer(STALE_CHECK_TIMEOUT);
return bytesRead < 0;
} catch (final SocketTimeoutException ex) {
return false;
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/io/BHttpConnection.java b/httpcore5/src/main/java/org/apache/hc/core5/http/io/BHttpConnection.java
index d96fe35..c23af9b 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/io/BHttpConnection.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/io/BHttpConnection.java
@@ -62,9 +62,9 @@
* method may block for a small amount of time before returning a result.
* It is therefore an <i>expensive</i> operation.
*
- * @return {@code true} if attempts to use this connection are
- * likely to succeed, or {@code false} if they are likely
- * to fail and this connection should be closed
+ * @return {@code true} if attempts to use this connection are likely
+ * to fail and this connection should be closed,
+ * or {@code false} if they are likely to succeed
*/
boolean isStale() throws IOException;