3 Commits

Author SHA1 Message Date
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
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.
2022-09-16 08:22:42 +01:00
Caleb Kleveter
0584020dca Gzip request decompress (#59)
### 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.
2019-10-10 13:51:07 +01:00