< prev index next >

src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java

Print this page
*** 536,12 ***
              if (current == LAST_BUFFER) return 0;
              if (current != null) available = current.remaining();
              if (available != 0) return available;
              Iterator<?> iterator = currentListItr;
              if (iterator != null && iterator.hasNext()) return 1;
!             if (buffers.isEmpty()) return 0;
!             return 1;
          }
  
          @Override
          public void onSubscribe(Flow.Subscription s) {
              Objects.requireNonNull(s);
--- 536,12 ---
              if (current == LAST_BUFFER) return 0;
              if (current != null) available = current.remaining();
              if (available != 0) return available;
              Iterator<?> iterator = currentListItr;
              if (iterator != null && iterator.hasNext()) return 1;
!             if (!buffers.isEmpty() && buffers.peek() != LAST_LIST ) return 1;
!             return available;
          }
  
          @Override
          public void onSubscribe(Flow.Subscription s) {
              Objects.requireNonNull(s);
< prev index next >