8 Commits

Author SHA1 Message Date
Rick Newton-Rogers
3f776e9aaf
Migrate CI to use GitHub Actions. (#234)
### Motivation:

To migrate to GitHub actions and centralised infrastructure.

### Modifications:

Changes of note:
* Adopt swift-format using rules from SwiftNIO
* Remove scripts and docker files which are no longer needed

### Result:

Feature parity with old CI.
2024-10-28 14:00:57 +00:00
George Barnett
df34965cd7
Don't reserve capacity for NIOPCAPRingBuffer (#209)
Motivation:

The NIOPCAPRingBuffer can limit the number of fragment or the total
number of bytes in its buffer or both. When configuring the buffer to
limit only the maximum number of bytes it sets the maximum number of
fragments allowed to `.max`. On `init` the buffer has enough capacity
reserved to store tha maximum number of fragments.

This would be a large and potentially totally unnecessary allocation.
That is, if it didn't crash at runtime. It crashes at runtime as
`CircularBuffer` converts the requested capacity to a `UInt32` which
traps if you pass it an `Int.max`.

Modifications:

- Don't reserve capacity on init
- Adjust the test which tests the byte limit to not set a capacity as
  well

Result:

- `NIOPCAPRingBuffer(maximumBytes:)` doesn't crash
2023-11-03 10:04:31 +00:00
Cory Benfield
9cdb93e321
Drop Swift 5.5 (#197)
Motivation

Per SwiftNIO's formal version policy, we are ready to drop support for
Swift 5.5.

Modifications

This patch removes the support for 5.5 and all supporting
infrastructure. This includes the test generation functionality, which
is no longer required, as well as the files generated by that
functionality. It updates the dockerfile for 5.8, and it removes all
conditional compilation checks that are now definitionally true.

Result

A nice, clean, 5.6+ codebase
2023-04-13 16:47:28 +01:00
David Nadoba
5334d949fe
Adopt Sendable in NIOExtras (#174)
Incremental `Sendable` adoption.

Co-authored-by: Cory Benfield <lukasa@apple.com>
2022-08-23 15:20:41 +01:00
Peter Adams
da7c04777b
Docnioextras (#169)
* Improve documentation for NIOExtras

Motivation:

Docs will help users do things correctly.

Modifications:

Add missing comments, improve links.

Result:

Better docc documentation

* Docc in NIOHTTPCompression

* NIOSOCKS docc

* Correct bad symbol

* Minor typo

Co-authored-by: Cory Benfield <lukasa@apple.com>
2022-08-03 01:34:45 -07:00
David Evans
e4dc3c8d1d
Implement Sendable (#160)
Make every non-channel class conform to Sendable (or @unchecked Sendable) to prepare for NIO.
2022-05-04 11:46:21 +01:00
Cory Benfield
d66ae0557e
Clean up imports and dependencies. (#144)
Motivation:

With NIO 2.32.0 we broke the core NIO module up into modules that split
apart the POSIX layer and the core abstractions. As a result, this
package no longer needs to express a hard dependency on the POSIX layer.

Modifications:

- Rewrote imports of NIO to NIOCore.
- Added NIOEmbedded and NIOPosix imports where necessary in tests.
- Extended soundness script to detect NIO imports.
- Note that the main modules still depend on NIO, which is necessary
    for backwards-compatibility reasons. This dependency is unused.

Result:

No need to use NIOPosix.
2021-09-14 16:30:39 +01:00
Peter Adams
fe17f53108
Capture packets leading upto a user triggered event. (#94)
Motivation:

Capturing all packets is expensive. Recording to a ring buffer and
then outputting on a triggering event allows this cost to be reduced.

Modifications:

Add a new handler - NIOPCAPRingCaptureHandler.
This derives from the existing NIOWritePCAPHandler and generates PCAP recordings.
A ring buffer contained in this handler stores the captured packets until RecordPreviousPackets
is received as a user message at which point they are flushed to the sink.

Result:

There is a new handler capable of outputting packet captured data only in the build up to
a known event.

Co-authored-by: Cory Benfield <lukasa@apple.com>
Co-authored-by: George Barnett <gbrntt@gmail.com>
2020-07-24 13:55:12 +01:00