swift-nio icon indicating copy to clipboard operation
swift-nio copied to clipboard

we should drain the receive buffer on write error even if auto-read is off (probably)

Open weissi opened this issue 6 years ago • 1 comments

When receiving a write error, we run this code

https://github.com/apple/swift-nio/blob/5011c409bb462edb5427c9def58b03cd18bdc251/Sources/NIO/BaseSocketChannel.swift#L443-L454

which is draining the read buffer but only if auto-read is enabled. That's probably not right and we should be draining the read buffer. auto-read off can never mean 'no channelRead events are ever delivered' anyway because of the channel pipeline. So auto-read should be more a hint to the channel rather than a guarantee (which it isn't anyway).

weissi avatar Aug 23 '18 15:08 weissi