swift-nio/Sources
Cory Benfield f7c4655298
Avoid double-closing on fcntl failures (#2409)
Motivation:

The fix provided in #2407 was subtly wrong. ignoreSIGPIPE, which throws
the error in question, closes the FD on error _except_ on EINVAL from
fcntl, where it instead does not. This inconsistent behaviour is the
source of the bug. Because this behaviour is inconsistent, the fix from
PR #2407 is also inconsistent and can in some cases double-close the
socket.

The actual issue is not as old as I expected: the code can be observed
by reviewing the change in #1598, which incorrectly inserted the error
transformation before the call to close.

Modifications:

- Revert the change from #2407.
- Move the close in ignoreSIGPIPE to before the error check, rather than
  after, so we unconditionally execute it.

Result:

More resilient fix.
2023-04-20 12:40:39 +01:00
..
CNIOAtomics CNIOAtomics: define types for `uintptr_t` and `intptr_t` (#1401) 2020-02-26 17:07:39 +00:00
CNIODarwin Correctly include netinet/in.h (#2315) 2022-11-15 01:58:25 -08:00
CNIOLLHTTP Update HTTP parser to LLHTTP (#2263) 2022-09-13 14:09:57 +01:00
CNIOLinux Allow UDP GRO tests to fail in some circumstances (#2387) 2023-03-13 11:12:06 +00:00
CNIOSHA1 Final language fix (#1732) 2021-01-22 18:39:10 +00:00
CNIOWindows NIO: extract control message handling into a separate protocol (#1678) 2020-10-19 16:18:57 +01:00
NIO Clean up and regression check the docs. (#2400) 2023-04-11 09:05:22 +01:00
NIOAsyncAwaitDemo Remove `#if compiler(>=5.5)` (#2292) 2022-10-13 07:17:46 -07:00
NIOChatClient Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
NIOChatServer Remove `#if compiler(>=5.5)` (#2292) 2022-10-13 07:17:46 -07:00
NIOConcurrencyHelpers Mildly rework the NIOLock storage (#2395) 2023-03-27 16:37:09 +01:00
NIOCore Drop Swift 5.5 (#2406) 2023-04-17 08:40:35 +01:00
NIOCrashTester OnLoopSendable: Sendable containers if on EventLoop (#2370) 2023-02-27 07:11:37 -08:00
NIOEchoClient Allow NIOEchoClient to receive fragmented echo responses. (#2041) 2022-02-07 01:35:16 -08:00
NIOEchoServer Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
NIOEmbedded Drop Swift 5.5 (#2406) 2023-04-17 08:40:35 +01:00
NIOFoundationCompat Add utilties for reading and writing UUIDs (#2045) 2022-10-31 06:25:28 -07:00
NIOHTTP1 Drop Swift 5.5 (#2406) 2023-04-17 08:40:35 +01:00
NIOHTTP1Client Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
NIOHTTP1Server Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
NIOMulticastChat Adopt `Sendable` for `NIOChatServer` and `MIOMuliticastChat` examples (#2220) 2022-07-06 16:30:24 +01:00
NIOPerformanceTester Throw `CancellationError` instead of returning `nil` during early cancellation. (#2401) 2023-04-11 08:58:01 -07:00
NIOPosix Avoid double-closing on fcntl failures (#2409) 2023-04-20 12:40:39 +01:00
NIOTLS Drop Swift 5.5 (#2406) 2023-04-17 08:40:35 +01:00
NIOTestUtils Drop Swift 5.5 (#2406) 2023-04-17 08:40:35 +01:00
NIOUDPEchoClient Fix typo in the name of a constant (#2262) 2022-09-04 10:23:54 -07:00
NIOUDPEchoServer Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
NIOWebSocket Drop Swift 5.5 (#2406) 2023-04-17 08:40:35 +01:00
NIOWebSocketClient Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
NIOWebSocketServer Move NIO to NIOPosix, make NIO a shell. (#1936) 2021-08-16 16:50:40 +01:00
_NIOConcurrency Readd module _NIOConcurrency to not break adopters (#1970) 2021-09-23 16:50:53 +02:00
_NIODataStructures Remove `#if compiler(>=5.5)` (#2292) 2022-10-13 07:17:46 -07:00