-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Description
The awaitContent
function in RawSourceChannel
incorrectly returns true
when the channel is already closed but the buffer is empty. This violates the contract of awaitContent
, which should return false
when no more data can arrive.
Current Behavior
When closedToken != null
, the function immediately returns true
regardless of buffer state.
Expected Behavior
When the channel is closed and insufficient data is available in the buffer, awaitContent
should return false
to indicate that the minimum required data cannot be satisfied.
Impact
This causes callers to attempt reads that immediately hit EOF, as they're misled into thinking sufficient data is available.
Context
This issue was identified during migration PR #4940 but kept unchanged to minimize migration scope. The bug exists in both the original JVM implementation and the new common implementation.