swift-nio
swift-nio copied to clipboard
we should drain the receive buffer on write error even if auto-read is off (probably)
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).