Motivation:
It's useful to know the overhead we could be adding by including
the PCAP handler.
Modifications:
Add a new executable based on the NIO performance testing executable.
Result:
There is a new executable which runs a short test of sending and receiving
data through the HTTP/1 handler using multiple eventloops and showing
three options.
1) Vanilla
2) With in memory PCAP never written to disk
3) With a disk based PCAP.
Motivation:
Previously, when using the response compressor, doing a flush() right before finishing the
response data would cause the final compression chunk to be omitted. Some strict decompressors
(such as gzip or the zlib functionality exported in nodejs) would refuse to decompress the
incomplete response.
With this change, the generated compressed response is properly finalized.
Modifications:
In HTTPResponseCompressor.swift, a channel write is now also generated if no body data is
added, but a flush is required.
Result:
The response is now correct for this edge case, enabling gzip, nodejs, et al., to
decompress it without errors.
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>
Motivation:
Ubuntu 16 ruby is too old to support latest cocoapods gem.
Modifications:
Don't install jazzy when on xenial
Result:
Docker image will now build - you need to use bionic images to build documentation.
Motivation:
The build_podspec.sh script generates a podspec which requires exact
versions of its dependencies. This very quickly turns into unresolvable
dependency graphs.
Modifications:
NIO version passed to script must be in the format MAJOR.MINOR
Podspec dependencies are now '>= MAJOR.MINOR', '< MAJOR+1'
Result:
Looser version requirements for podspecs
Motivation:
Previously, WritePCAPHandler would crash if more than 4GiB of data were
either received or sent through the same instance of the
WritePCAPHandler because of a UInt32 overflow representing the TCP
sequence/ACK numbers.
Modifications:
Make TCP sequence/ACK numbers wrap around correctly.
Result:
- now you can send/receive up to 16 EiB of data :P.
- fixes rdar://61887658
Motivation:
NIOHTTPRequestDecompressor and HTTPResponseDecompressor are both affected by an issue where the decompression limits defined by their DecompressionLimit property wasn't correctly checked when is was set with DecompressionLimit.size(...), allowing denial of service attacks.
Modifications:
- Update DecompressionLimit.size(...) to correctly check the size of the decompressed data.
- Update test cases to avoid future regressions regarding the size checks.
Result:
Prevents DoS attacks though maliciously crafted compressed data.
* Added NIOHTTPRequestCompressor to compress requests
Also moved common code from request and response compressor into separate NIOHTTPCompression enum.
* Updates after comments from @weissi
Also reinstated public enum HTTPResponseCompressor.CompressionError
* algorithms are now let not var
* Catch situation where head is flushed before anything else comes through
Content-encoding was not being set
Added additional tests for header values
* Added documentation around 5 bytes added to buffer size and add them
* Renaming NIOHTTPCompressionSetting to NIOCompression
Also
NIOHTTPCompressionSetting.CompressionAlgorithm is NIOCompression.Algorithm
NIOHTTPCompressionSetting.CompressionError is NIOCompression.Error
Algorithm now conforms to Equatable
* Forgot to run generate_linux_tests
* Fix typos
Motivation:
It's 2020; our license checking script should believe that that is an
acceptable year.
Modifications:
- Update scripts/sanity.sh
Result:
2020 is okay in license headers.
Motivation:
We were missing the 5.2 & 5.3 docker compose files and also the syntax
wasn't flexible enough to pull in the new nightlies.
Modifications:
- always specify the full image name
- add 5.2 & 5.3
Result:
More CI & newer Swifts.
motivation: publish api docs for helper modules
changes
* add doc publishing script
* add "shell" docker-compose task to help run document publishing from ci
Co-authored-by: Johannes Weiss <johannesweiss@apple.com>
motivation: more secured ci setup
changes:
* enable :z selinux flag on bind mounts so we can enable selinux on ci
* drop potentially exploitable capabilities from docker-compose
Motivation:
The code-of-conduct email address is out-of-date.
Modifications:
Update code-of-conduct email address to swift-server-conduct@group.apple.com
Result:
- Code of conduct email address is up-to-date.
Motivation:
The test suite for some reason imported NIO as @testable which is
verboten.
Modifications:
Don't do that.
Result:
Feeling better, compatible with the upcoming NIO 2.10.1.
### Motivation:
There will be times when a client wishes to send larger requests with gzipped bodies to save on network traffic. This PR adds a `NIOHTTPRequestDecompressor` which can be added to the server's channel pipeline so those requests are automatically inflated.
### Modifications:
- Added a `CNIOExtrasZlib_voidPtr_to_BytefPtr` C method.
- Added a `NIOHTTPRequestDecompressor` type.
- Added a `HTTPResponseDecompressorTest` test case.
### Result:
Now you don't have to manually check the `Content-Encoding` header and decompress the body on each incoming request.
* extract common classes for server request decompressor
* review fix: make fields private and make state part of the handler
* review fixes
* review fix: reserve capacity before inflating
### Motivation:
Many HTTP servers can send compressed responses to clients and it would be a great feature for `AsyncHTTPClient` to support it. But since we want to minizime usage of unsafe APIs in SSWG projects, I propose to consolidate interfacing with zlib to `nio-extras` since it already supports `zlib` compression.
### Modifications:
Added `HTTPResponseDecompressor` and accompanying tests
### Result:
Users (primarily `AsyncHTTPClient`) can now provide automatic response decompression support.
Motivation:
ServerQuiescingHelper used to swallow close errors and it shoulnd't do
that.
Modifications:
Don't swallow close errors.
Result:
More correctness.
Motivation:
Use B2MDVerifier for the B2MDs in NIOExtras. Already found one bug,
separetely fixed in #51.
Modifications:
Write a basic validation test for all B2MDs.
Result:
Better test coverage.
Motivation:
The script to generate a podspec used the minimum platform versions for
NIOTS instead of NIO.
Modifications:
Lower the minimum platform version to match those supported by NIO.
Result:
Larger Cocoapods platform support.
Motivation:
JSPN-RPC uses various framing methods, one is Content-Length based
framing. NIOExtras should provide encoder/decoders for this.
Modifications:
Add such codecs.
Result:
NIOExtras more useful
Motivation:
LineBasedFrameDecoder previously would only correctly decode \r\n as a
line-ending iff \r\n were not split apart.
Modifications:
Handle \r\n arriving apart.
Result:
more correct line splitting
Motivation:
README has an overview with the handlers that NIOExtras provides, some
were missing.
Modifications:
Add the missing ones.
Result:
Better README.
Motivation:
Especially with TLS but also without, in real production environments it
can be handy to be able to write pcap files from NIO directly.
Modifications:
add a ChannelHandler that can write a PCAP trace from what's going on in
the ChannelPipeline.
Result:
easier debugging in production
Motivation:
LineBasedFrameDecoder discarded everything after EOF and delivered it in
the left-over bytes error. For the real world however that doesn't make
much sense, you'd want all previously received lines and only receive
the partial lines as left-overs.
Modifications:
deliver lines until there are only partial lines left, even in case of
EOF.
Result:
LineBasedFrameDecoder more useful
Fixing a broken link in the readme file.
Modifications:
A single character correction in the readme file.
Result:
Improved pedanticism and/or readability depending upon the readers perspective.
Motivation:
to tag versions, we shouldn't depend on `.branch("master")`
Modifications:
depend on swift-nio: 2.0.0-convergence.1
Result:
ready to soon tag the first version