168 Commits

Author SHA1 Message Date
Iceman
682d1f4fba Fix decompressor is not initialized collectly 2024-03-19 15:58:15 +09:00
Hovik Melikyan
c992030a2d
Fixed the shutdown order for quiescing demo (#220) 2024-03-18 01:11:05 -07:00
George Barnett
a33bb16e79
Raise minimum swift version to 5.8 (#218) 2024-03-11 08:48:32 +00:00
Adam Fowler
a3b640d7dc
Make HTTP type conversion code public (#216)
* Make HTTP1 type conversion code public

* Convert HTTP1TypeConversionError to struct

---------

Co-authored-by: Franz Busch <f.busch@apple.com>
1.22.0
2024-02-12 02:25:12 -08:00
Johannes Weiss
cdd1580a03
LineBasedFrameDecoder: can be a NIOSingleStepByteToMessageDecoder (#217)
Co-authored-by: Johannes Weiss <johannes@jweiss.io>
2024-02-06 16:31:09 +00:00
Si Beaumont
363da63c19
Add missing availability guards in tests (#214) 1.21.0 2023-12-15 08:05:29 -08:00
Adam Fowler
6717fd068f
Add RemovableChannelHandler comformance to HTTPType channel handlers (#213) 2023-12-06 10:00:50 +00:00
Cory Benfield
7264a5a0d7
Add retroactive marker to test conformances (#212)
Motivation

Nightly CI builds require annotations on retroactive conformances.
We have a few used only in tests, which are totally safe.

Modifications

Add retroactive conformance marker.

Result

Nightly CI works again
2023-11-28 17:53:58 +00:00
Alastair Houghton
373b8bba29
Changes for Musl support. (#211)
Make sure we import `Musl` rather than `Glibc`.
2023-11-28 08:38:46 -08: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
Guoye Zhang
798c962495
Add HTTP types adapter for SwiftNIO (#202)
* Add HTTP types adapter for SwiftNIO

* swiftformat

* Guard on Swift 5.8

* Review comments

* Update swift-http-types to 0.1.1

* Update swift-http-types to 1.0.0

* Review feedback

* Review feedback

* Bump minimum Swift version to 5.7.1

* Allow Host in any order
1.20.0
2023-10-20 17:55:23 +01:00
Rick Newton-Rogers
6c3819cf2a
Bump minimum Swift version to 5.7 (#207)
Motivation:

Now that Swift 5.9 is GM we should update the supported versions and
remove 5.6

Modifications:

* Update `Package.swift`
* Remove `#if swift(>=5.7)` guards
* Delete the 5.6 docker compose file and make a 5.10 one
* Update docs

Result:

Remove support for Swift 5.6, add 5.10
2023-10-04 10:17:34 +01:00
Franz Busch
fb70a0f5e9
Use #if canImport(Darwin) where possible (#201) 1.19.1 2023-06-21 14:12:47 +01:00
Cory Benfield
868a89ffdc
Adopt the Swift CoC (#200)
Motivation:

We're centralizing on the Swift code of conduct, so we'll x-reference
that instead of holding our own.

Modifications:

Hyperlink out to Swift.

Result:

Shared CoC across the projects.
2023-06-06 09:10:59 -07: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
Yim Lee
78d6cc4942
Add docker-compose file for Swift 5.9 (#198) 2023-04-13 09:44:52 +01:00
Cory Benfield
0e0d0aab66
Fix documentation and add support for CI-ing it (#196)
* Fix documentation and add support for CI-ing it

* Soundness cleanup
1.19.0
2023-04-11 11:25:17 +01:00
Johannes Weiss
df2810507b
TaggedRequestResponseHandler (#157) 2023-03-22 13:02:05 +00:00
Johannes Weiss
4569c6911b
add the NFS3 protocol (#155)
* add the NFS3 protocol

* make writes return the amount of bytes written

* nits, docs, removes

* compiler errors on old swifts

* Hashable everything

* delay errors

* remove typealiases

* Sendables

* implicit endiannes

* more changes
2023-03-21 17:10:58 +00:00
Cory Benfield
cc1e527507
Make SynchronizedFileSink.close unavailable from async (#195)
Motivation

syncClose will block whatever thread it's on indefinitely. That makes it
unsafe to call in async contexts.

Modifications

Add a new close() method that's async.
Make the existing method unavailable from async.
Add some tests.

Results

Easier to close these from async contexts
1.18.0
2023-03-03 05:48:20 -08:00
Franz Busch
d75ed708d0
Refactor QuiescingHelper to exhaustively iterate state (#193)
# Motivation
Currently the `QuiescingHelper` is crashing on a precondition if you call shutdown when it already was shutdown. However, that can totally happen and we should support it.

# Modification
Refactor the `QuiescingHelper` to exhaustively switch over its state in every method. Furthermore, I added a few more test cases to test realistic scenarios.

# Result
We are now reliable checking our state and making sure to allow most transitions.
1.17.0
2023-02-24 09:24:37 -08:00
carolinacass
6bd9bf5c29
ServerQuiescingHelper no longer leaking promises (#192)
* ServerQuiescingHelper no longer leaking promises

Motivation:
ServerQuiescingHelper leaked promises when promise left scope and not succeeded

Modifications:
Failing promise within a deinit

* Minor fixes

* generating linux tests

* mini update
2023-02-13 11:45:10 +00:00
George Barnett
98378d1fe5
Remove Jazzy doc generation (#191)
Motivation:

Docs are generated by and hosted on the Swift Package Index. We no
longer need the script to generate docs via Jazzy.

Modifications:

- Remove the generate_docs script
- Remove Jazzy from the Dockerfile but keep Ruby; it's used for
  generating test manifests.
- Remove SwiftFormat from the Dockerfile; we don't use it.

Result:

Fewer unused things.
1.16.0
2023-01-23 15:43:51 +00:00
David Nadoba
e4efedbf47
Add Swift 5.8 CI and update nightly CI to Ubuntu 22.04 (#190)
* Add Swift 5.8 CI
@dnadoba

* Update nightly CI to Ubuntu 22.04

* Run `generate_linux_tests.rb`
2023-01-18 09:15:17 +01:00
Rick Newton-Rogers
5ff8cc59a6
Migrate http1 proxy connect handler (#185)
Motivation:

Moving the HTTP1ProxyConnectHandler into swift-nio-extras will make the
code which is generally useful when dealing with HTTP1 proxies available
more easily to a wider audience.

Modifications:

The code and tests are copied over from 0b5bec741b/Sources/AsyncHTTPClient/ConnectionPool/ChannelHandler/HTTP1ProxyConnectHandler.swift.

Result:

HTTP1ProxyConnectHandler will be surfaced via the NIOExtras library
2023-01-12 13:56:04 +00:00
Rick Newton-Rogers
54def83a52
update generated test script from swift-nio (#188)
The newer version of the script automatically calculates accurate
copyright date statements.
2022-12-02 15:17:43 +00:00
Yim Lee
b89549b289
Add .spi.yml for Swift Package Index DocC support (#186) 2022-12-02 09:48:47 +00:00
carolinacass
91dd2d61fb
Use #fileID/#filePath instead of #file (#184)
Motivation:

Modifications:

Changed #file to #filePath or #fileID depending on situation
1.15.0
2022-10-28 13:56:39 +01:00
David Nadoba
d373eaf7db
Replace NIOSendable with Sendable (#181) 2022-10-13 07:43:15 -07:00
David Nadoba
e9ed606ce3
Fix README.md (#183)
I have accidentally added an additional dot in https://github.com/apple/swift-nio-extras/pull/182
This PR removes it again.
2022-10-13 06:17:37 -07:00
David Nadoba
985a485f71
Remove #if compiler(>=5.5) (#182) 2022-10-13 14:04:27 +01:00
George Barnett
55f37f388c
Raise minimum supported Swift version from 5.4 to 5.5 (#180)
Motivation:

SwiftNIO periodically drops support for older Swift versions. Now that
5.7 has been released, 5.4 will be dropped.

Modifications:

- Remove 5.4 specific Package.swift and docker-compose
- Update the 5.7 docker-compose to use the released 5.7 and move from
  focal (2004) to jammy (2204)
- Update docs

Results:

Minimum Swift version is 5.5
2022-09-29 09:21:17 +01:00
Cory Benfield
6c84d24775
Correctly validate the bounds of decompression (#177)
Motivation

Currently we don't confirm that the decompression has completed
successfully. This means that we can incorrectly spin forever attempting
to decompress past the end of a message, and that we can fail to notice
that a message is truncated. Neither of these is good.

Modifications

Propagate the message zlib gives us as to whether or not decompression
is done, and keep track of it.
Add some tests written by @vojtarylko to validate the behaviour.

Result

Correctly police the bounds of the messages.
Resolves #175 and #176.
1.14.0
2022-09-16 08:22:42 +01:00
David Nadoba
5334d949fe
Adopt Sendable in NIOExtras (#174)
Incremental `Sendable` adoption.

Co-authored-by: Cory Benfield <lukasa@apple.com>
1.13.0
2022-08-23 15:20:41 +01:00
David Nadoba
b64e59956e
Adopt Sendable in NIOSOCKS (#173)
Incremental `Sendable` adoption.

Co-authored-by: Cory Benfield <lukasa@apple.com>
2022-08-23 05:28:01 -07:00
David Nadoba
1ef46c0352
Adopt Sendable in NIOHTTPCompression (#172) 2022-08-23 13:24:16 +01:00
Cory Benfield
9697a611c4
Validate missing imports in CI (#171) 2022-08-16 01:19:37 -07:00
Peter Adams
dabef818d3
Simple index pages for docc (#170)
Motivation:

An index page ties all the other documentation together

Modifications:

Add index pages for the library targets.
Correct a few minor errors in the main docs.

Result:

A more joined up documentation experience.
2022-08-12 07:31:17 -07: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
Peter Adams
ca22c12528
Deprecate cumulationBuffer (#168)
Motivation:

It is no longer used.

Modifications:

Deprecate the 3 cumulationBuffers

Result:

Less confusion and accidental usage.
2022-08-02 09:46:57 +01:00
Peter Adams
f4359b987d
Prepare for docc (#167)
Motivation:

Publishing docs is a good thing.

Modifications:

Update Package.swift to allow docc documentation to be generated.

Result:

It is possible to generate docc docs.
2022-08-01 14:21:15 +01:00
Cory Benfield
a75e92bde3
Bump the lowest NIO version to 2.34.0 (#165) 1.12.1 2022-06-14 03:59:18 -07:00
Cory Benfield
8e4f5cfdec
Use 5.7 nightlies (#164) 2022-06-13 04:17:06 -07:00
David Evans
e4dc3c8d1d
Implement Sendable (#160)
Make every non-channel class conform to Sendable (or @unchecked Sendable) to prepare for NIO.
1.12.0
2022-05-04 11:46:21 +01:00
George Barnett
79586313bd
Remove build_podspec.sh (#162)
Motivation:

We no longer support Cocoapods.

Modifications:

- Remove build_podspec.sh

Result:

Less unused code.
2022-05-04 11:02:26 +01:00
George Barnett
ba05378671
Update podspec generation (#161)
Motivation:

Pods need to include all transitive dependencies in order
to work around https://github.com/apple/swift-nio/issues/2073.

We also ship a second library from this repo: NIOSOCKS which doesn't yet
have a pod published.

Modifications:

- Update the pod generation script

Result:

Pods include all transitive dependencies
2022-05-03 16:31:04 +01:00
Fabian Fett
8eea84ec61
Fix warnings, that appeared after requiring Swift 5.4 (#159) 1.11.0 2022-04-22 07:57:02 +01:00
Fabian Fett
59971a8c69
Drop support for Swift 5.2 and 5.3 (#154)
As outlined in a [Swift forums post in November ’21](https://forums.swift.org/t/swiftnio-swift-version-support/53232), SwiftNIO will only support the latest non-patch Swift release and the 2 immediately prior non-patch versions.

- drop support for Swift 5.2 and 5.3. 
- update CI for Swift 5.4 to run on bionic instead of focal to ensure that we still test bionic.
2022-04-21 08:49:12 +02:00
Peter Adams
0cd4cc3e38
Fix concurrency warning (#153)
Motivation:

A clean build is good.

Modifications:

Make the warning string for debug mode a let constant.

Result:

No warning about concurrency safety.

Co-authored-by: Peter Adams <peteradamshc76@gmail.com>
2022-03-20 12:29:58 +00:00
tomer doron
344a517828
ci update (#152)
motivation: 5.6 is out

changes:
* use release version of 5.6
* add docker setup for 5.7 (using nightly for now)
2022-03-16 21:18:47 -07:00