Tags: BEDLAM520/swift-nio
Tags
Fix exclusive access violation in `NIOAsyncChannelOutboundWriterHandl… …er` (apple#2580) # Motivation We were setting `self.sink = nil` in the `NIOAsyncChannelOutboundWriterHandler` twice in the same call stack which is an exclusivity violation. This happens because the first `self.sink = nil` triggers the `didTerminate` delegate call which again triggered `self.sink = nil`. # Modification This PR changes the code to only call `self.sink?.finish()` and only sets the `sink` to `nil` in the `didTerminate` implementation. This follows what we do for the inbound handler implementation. I also added a test that triggers this exclusivity violation. # Result No more exclusivity violations in our code.
Fix thread-safety issues in TCPThroughputBenchmark (apple#2537) Motivation: Several thread-safety issues were missed in code review. This patch fixes them. Modifications: - Removed the use of an unstructured Task, replaced with eventLoop.execute to ServerHandler's EventLoop. - Stopped ClientHandler reaching into the benchmark object without any synchronization, used promises and event loop hops instead. Result: Thread safety is back
Support for custom protocols in DatagramBootstrap (apple#2516) Motivation This patch adds support for custom protocol families to DatagramBootstrap. In most cases this isn't useful, and will fail, but in many OSes it's a recognised system for non-root processes to get a way to send ICMP echo requests. This is worth supporting. Modifications - Expose the `ProtocolSubtype` type publicly. - Add a `protocolSubtype` setter on `DatagramBootstrap` - Write a test that actually does ICMP as non-root Results Users can send ICMP echo requests without root privileges.
Avoid using deinit to fulfil the protocol negotiation promise (apple#… …2497) # Motivation Fixes apple#2494 # Modification This PR avoids using `deinit` to fulfil the protocol negotiation promise and opts to trap instead when it is being accessed before the handler is added. This allows us to use `handlerAdded` and `handlerRemoved`. # Result No more `deinit` usage that can be observed.
Add configuration for `NIOAsyncChannel` (apple#2464) # Motivation While adopting the new `NIOAsyncChannel` type we saw an exploding number of parameters passed to the various connect/bind/configure methods. All these methods had in common that we had to pass configuration for the `NIOAsyncChannel`. # Modification This PR introduces a new type `NIOAsyncChannel.Configuration` which groups all four configuration parameters into a struct. # Result We can now write more concise methods that use a single configuration object.
Fix last remaining test on Android (apple#2457) Motivation Get all tests passing on Android AArch64 Modifications - Check if localhost is set for IPv6 in BootstrapTest/testClientBindWorksOnSocketsBoundToEitherIPv4OrIPv6Only, and use ip6-localhost if not Result All tests pass natively on Android AArch64
Tolerate sending data after close(mode: .output) (apple#2421) Motivation We shouldn't crash on somewhat likely user error. Modifications Pass on writes after close(mode: .output) instead of crashing. Result User code is more robust to weird edge cases.
PreviousNext