Tags: compnerd/swift-nio
Tags
add AcceptHandler after serverChannelInitializer runs (apple#1393) Motivation: For compatibility with 2.13.1 and earlier, we're adding the AcceptHandler after the serverChannelInitializer runs. If that's the best solution is discussed in apple#1392. Modifications: - add AcceptHandler after the serverChannelInitializer - give the AcceptHandler the name AcceptHandler Result: - better compatibility
Update http-parser for CVE. Motivation: http-parser shipped a patche for node.js CVE-2019-15605, which allowed HTTP request smuggling. This affected SwiftNIO as well, and so we need to immediately ship an update to help protect affected users. A CVE for SwiftNIO will follow, but as this patch is in the wild and SwiftNIO is known to be affected we should not delay shipping this fix. Modifications: - Update http-parser. - Add regression tests to validate this behaviour. Result: Close request smugging vector. (cherry picked from commit f94b22b)
Update http-parser for CVE. (apple#1388) Motivation: http-parser shipped a patche for node.js CVE-2019-15605, which allowed HTTP request smuggling. This affected SwiftNIO as well, and so we need to immediately ship an update to help protect affected users. A CVE for SwiftNIO will follow, but as this patch is in the wild and SwiftNIO is known to be affected we should not delay shipping this fix. Modifications: - Update http-parser. - Add regression tests to validate this behaviour. Result: Close request smugging vector. (cherry picked from commit f94b22b)
Rename misnamed closure parameter argument in ServerBootstrap.bind0 (a… …pple#1347) Motivation: Non-functional change: `bind0(_ makeSocketAddress: () throws -> SocketAddress) -> EventLoopFuture<Channel>` calls `bind0` with a `register` closure that is passed an event loop as first argument. However, the name of the first parameter of the closure declaration is named "eventGroup" which is confusing. It should therefore be renamed to "eventLoop" which is consistent with other closures passed as `register` arguments at other callsites. Modifications: Rename (unused) closure parameter "eventGroup" to "eventLoop". Result: Improved code readability. Co-authored-by: Johannes Weiss <johannesweiss@apple.com>
Drain scheduled tasks on EmbeddedChannel finish() (apple#1319) Motivation: EmbeddedChannel advanced time to the distant future so that all scheduled tasks would be run. However, if tasks were recursively scheduled by executing the already scheduled tasks then the channel would never finish. Modifications: When calling finish() on EmbeddedChannel, only run the tasks which have been scheduled at that point in time. Result: Recursively scheduled tasks terminate when finish-ing the EmbeddedChannel.
workaround failed associated type inference (apple#1299) Motivation: Some Swift nightly snapshots fail to compile NIO in release mode (rdar://57793267), this change is to work around this issue by telling them compiler the associatedtypes explicitly. Modifications: - add `Element` and `Indices` typealises to `CircularBuffer` explicitly. Result: Complies on all nightlies also in release mode.
fix AtomicBox by deprecating it and implementing it with a CAS loop (a… …pple#1287) Motivation: Atomic references cannot easily be maintained correctly because the `load` operation gets a pointer value that might (before the loader gets a change to retain the returned reference) be destroyed by another thread. Modifications: - Deprecate `AtomicBox` - Implement `NIOCASLoopBox` with functionality similar to AtomicBox (but implemented using a CAS loop :( ). Result: - fixes apple#1286
Fix running run-nio-alloc-counter-tests.sh for a single test (apple#1245 ) Motivation: Using the single test argument with the run-nio-alloc-counter-tests.sh does not work as expected as the given test would just replace the first test in the list. Modifications: Replace the tests to run with a single-element array containing the test provided as an argument. Result: - A single test can be run when specified as a command line arg.
Allow single test to be specified as an argument to run-nio-alloc-cou… …nter-tests.sh. (apple#1214) * Allow single test to be specified as an argument to run-nio-alloc-counter-tests.sh. Motivation: run-nio-alloc-counter-tests.sh currently runs all tests. When writing or debugging a test, you commonly want to run a single test. At the moment the common practice is to edit the script to hardcode a test to run, which is annoying and error-prone. Modifications: Add an optional argument to the script to specify the test to run. Result: $ ./run-nio-alloc-counter-tests.sh runs all tests. $ ./run-nio-alloc-counter-tests.sh test_decode_1000_ws_frames.swift runs only test_decode_1000_ws_frames.swift.
Add option to reserve writable capacity to writeWithUnsafeMutableBytes ( apple#1105) (apple#1175) Motivation: writeWithUnsafeMutableBytes cannot tolerate arbitrarily large writes because it is not possible to resize the buffer by the time body receives the buffer pointer. This change provides an option for the user to reserve writable capacity before the pointer is passed to body. Modifications: Added a backward compatible optional parameter to writeWithUnsafeMutableBytes which can reserve writable capacity before the pointer is passed to body. Result: Additive change only. Users can optionally specify a minimum writable capacity when calling writeWithUnsafeMutableBytes.
PreviousNext