Skip to content

Commit faf5532

Browse files
committed
fix possibility for infinite signaling on read
1 parent 985755e commit faf5532

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Sources/TCP/Streams/TCPSocketSource.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,9 @@ public final class TCPSocketSource: Async.OutputStream {
142142
/// Called when the read source signals.
143143
private func readSourceSignal(isCancelled: Bool) {
144144
DEBUG("TCPSocketSource.readSourceSignal(\(isCancelled))")
145-
guard !isCancelled else {
145+
if !isCancelled {
146146
// source is cancelled, we will never receive signals again
147147
cancelIsPending = true
148-
if downstreamIsReady {
149-
readData()
150-
}
151-
return
152148
}
153149

154150
guard downstreamIsReady else {

0 commit comments

Comments
 (0)