FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

chore: ensure leftovers is fully consumed before getting the next ele… · googleapis/java-storage@970242e · GitHub

Commit 970242e

Browse files
committed
chore: ensure leftovers is fully consumed before getting the next element from the queue
1 parent 27d7e3a commit 970242e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎google-cloud-storage/src/main/java/com/google/cloud/storage/BaseObjectReadSessionStreamRead.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ public long read(ByteBuffer[] dsts, int offset, int length) throws IOException {
393393

394394
try {
395395
Object poll;
396-
while ((poll = queue.poll(10, TimeUnit.MICROSECONDS)) != null) {
396+
while (leftovers == null && (poll = queue.poll(10, TimeUnit.MICROSECONDS)) != null) {
397397
if (poll instanceof ChildRef) {
398398
ChildRefHelper ref = new ChildRefHelper((ChildRef) poll);
399399
read += ref.copy(dsts, offset, length);

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL