Skip to content

Commit 1abce9d

Browse files
committed
Fix copying of zero length resources
Fix #14685 by handling zero length resources
1 parent bc78378 commit 1abce9d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/internal/ByteChannelContentSource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,15 @@ public Content.Chunk read()
156156
{
157157
lockedEnsureOpenOrTerminal();
158158

159+
if (_terminal != null)
160+
return _terminal;
161+
159162
if (_length == 0)
160163
{
161164
lockedSetTerminal(Content.Chunk.EOF);
162165
return Content.Chunk.EOF;
163166
}
164167

165-
if (_terminal != null)
166-
return _terminal;
167-
168168
if (_buffer == null)
169169
{
170170
_buffer = _byteBufferPool.acquire();

0 commit comments

Comments
 (0)