You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2018/08/13 21:21:48 UTC
httpcomponents-core git commit: Use the local var name "readLen"
instead of "l" and "noRead".
Repository: httpcomponents-core
Updated Branches:
refs/heads/master f6b77ed43 -> f0f2906b1
Use the local var name "readLen" instead of "l" and "noRead".
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/f0f2906b
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/f0f2906b
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/f0f2906b
Branch: refs/heads/master
Commit: f0f2906b1a806057c2faf73e43c3878bd050cd65
Parents: f6b77ed
Author: Gary Gregory <ga...@gmail.com>
Authored: Mon Aug 13 15:21:43 2018 -0600
Committer: Gary Gregory <ga...@gmail.com>
Committed: Mon Aug 13 15:21:43 2018 -0600
----------------------------------------------------------------------
.../http/impl/io/SessionInputBufferImpl.java | 30 ++++++++++----------
1 file changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/f0f2906b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/SessionInputBufferImpl.java
----------------------------------------------------------------------
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/SessionInputBufferImpl.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/SessionInputBufferImpl.java
index 5e8c03d..f171375 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/SessionInputBufferImpl.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/SessionInputBufferImpl.java
@@ -143,16 +143,16 @@ public class SessionInputBufferImpl implements SessionInputBuffer {
this.bufferpos = 0;
this.bufferlen = len;
}
- final int l;
+ final int readLen;
final int off = this.bufferlen;
final int len = this.buffer.length - off;
- l = inputStream.read(this.buffer, off, len);
- if (l == -1) {
+ readLen = inputStream.read(this.buffer, off, len);
+ if (readLen == -1) {
return -1;
}
- this.bufferlen = off + l;
- this.metrics.incrementBytesTransferred(l);
- return l;
+ this.bufferlen = off + readLen;
+ this.metrics.incrementBytesTransferred(readLen);
+ return readLen;
}
public boolean hasBufferedData() {
@@ -167,10 +167,10 @@ public class SessionInputBufferImpl implements SessionInputBuffer {
@Override
public int read(final InputStream inputStream) throws IOException {
Args.notNull(inputStream, "Input stream");
- int noRead;
+ int readLen;
while (!hasBufferedData()) {
- noRead = fillBuffer(inputStream);
- if (noRead == -1) {
+ readLen = fillBuffer(inputStream);
+ if (readLen == -1) {
return -1;
}
}
@@ -200,8 +200,8 @@ public class SessionInputBufferImpl implements SessionInputBuffer {
}
// otherwise read to the buffer first
while (!hasBufferedData()) {
- final int noRead = fillBuffer(inputStream);
- if (noRead == -1) {
+ final int readLen = fillBuffer(inputStream);
+ if (readLen == -1) {
return -1;
}
}
@@ -238,7 +238,7 @@ public class SessionInputBufferImpl implements SessionInputBuffer {
public int readLine(final CharArrayBuffer charbuffer, final InputStream inputStream) throws IOException {
Args.notNull(charbuffer, "Char array buffer");
Args.notNull(inputStream, "Input stream");
- int noRead = 0;
+ int readLen = 0;
boolean retry = true;
while (retry) {
// attempt to find end of line (LF)
@@ -275,13 +275,13 @@ public class SessionInputBufferImpl implements SessionInputBuffer {
this.linebuffer.append(this.buffer, this.bufferpos, len);
this.bufferpos = this.bufferlen;
}
- noRead = fillBuffer(inputStream);
- if (noRead == -1) {
+ readLen = fillBuffer(inputStream);
+ if (readLen == -1) {
retry = false;
}
}
}
- if (noRead == -1 && this.linebuffer.isEmpty()) {
+ if (readLen == -1 && this.linebuffer.isEmpty()) {
// indicate the end of stream
return -1;
}