swift-nio
swift-nio copied to clipboard
surface errors when connection reset through pipeline
Motivation:
Previously, NIO wouldn't send errors that we pulled out of the socket on connection reset through the pipeline. That meant that you wouldn't for example see connect errors.
Modification:
Send errors through the pipeline if the channel is still alive after trying to read all bytes.
Result:
- More erorrs surfaced to the user.
- fixes #1756
@Lukasa this isn't actually too bad at all. The real changes required are pretty minor. The cool thing is that my change only does much if the channel is still open after readEOF0
. But if we do see an error there, then it'll be closed there and things should be fine because we never get to the new logic. If we do survive readEOF0
without an error, then we should actually surface the error.
This needs much more testing and analysis, therefore still WIP. But I'll do that when I'm actually back at work :)