Commit Graph
2140 Commits
Author SHA1 Message Date
Cory Benfield d61e084d3c Doc comments for NIOHTTP1 2017-11-30 16:07:41 +00:00
Johannes Weiss 557f8940f7 IOData docs 2017-11-30 17:49:28 +00:00
Johannes Weiß a22fc02c51 ByteBuffer: fix a UInt underflow 2017-11-30 16:57:26 +00:00
Johannes Weiss 3f38979347 documentation for NIOAny 2017-11-30 15:04:11 +00:00
Cory Benfield 42eda3a5ae More documentation for NIOOpenSSL 2017-11-30 14:37:07 +00:00
Cory Benfield 5958fdff73 Add docs for concurrency helpers 2017-11-30 14:36:55 +00:00
Johannes Weiss 8335b6c3a0 replace priority queue 2017-11-28 16:13:26 +00:00
Cory Benfield 2cfa8c2381 Remove use of URL and FileManager from NIOOpenSSL 2017-11-23 10:11:38 +00:00
Cory Benfield 99188f3a99 Don't lose close promises 2017-11-21 19:00:36 +00:00
Johannes Weiß 06f9b1d63b merge ConcurrencyHelpers 2017-11-21 18:32:33 +00:00
Johannes Weiß 33fe401322 rename Future/Promise to EventLoopFuture/EventLoopPromise 2017-11-21 17:41:36 +00:00
Johannes Weiß f79aa7ef20 fix integration tests for Linux 2017-11-21 13:30:31 +00:00
Johannes Weiß 202e1c37d7 port integration tests for HTTP server 2017-10-10 19:41:01 +01:00
Cory Benfield 229c23a63b Support X.509 hostname validation 2017-11-20 14:26:22 +00:00
Max (Swift) Moiseev 198d6b447b Explicit access modifiers on members in extensions 2017-11-18 04:40:26 -08:00
Max Moiseev 01b28a3f6d Simplify logic in guards (replace some with ifs instead) 2017-11-16 17:29:35 -08:00
Johannes Weiss 09b8925591 make ChannelHandlerCtx operations not crash if channel is already closed 2017-11-17 14:57:25 +00:00
Norman Maurer 68a475b37a Rename IOError.errno to IOError.errnoCode as errno is always in scope 2017-11-17 15:45:12 +01:00
Johannes Weiß b66d413a38 remove useless private method from StaticString extension 2017-11-17 13:33:20 +00:00
Norman Maurer 854aea060e Not creating IOError for EWOULDBLOCK
Motivation:

Creating an IOError is not "cheap" as we use String formatting to do so. In cases of EWOULDBLOCK we will never use the IOError at the end so we should not even create one.

Modifications:

Handle EWOUDLBOCK without creating and IOError

Result:

Less overhead when a syscall will fail because it would block
2017-11-17 13:06:29 +01:00
Norman Maurer f6d9bcc701 Make check for blacklisted errno an assert
Motivation:

Checking for blacklisted errno values should be an assert and not a precondition as this would signal a bug in our code itself and not something bad the user was doing. Also this will make the code smaller when compiling in release mode.

Modifications:

Change the blacklist check to be an assert.

Result:

Only check for blacklisted errno when asserts are enabled.
2017-11-17 08:20:50 +01:00
Johannes Weiß 936e812b32 make system call wrapper fast & test it 2017-11-16 15:42:03 +00:00
Cory Benfield 1cb736e370 Catch bugs with sync shutdown 2017-11-10 17:28:52 +00:00
Norman Maurer e67fc995cf Remove external depencies
Motivation:

We had a few external dependencies that were mainly used to include header files.

Modifications:

Add extra modules that will be used to export these headers.

Result:

Less external dependencies.
2017-11-16 15:20:13 +01:00
Norman Maurer ba35fcb5a5 Move all syscalls that also need to handle errno in an extra file and ensure we not get any problems with invalid errno handling
* Move all syscalls that also need to handle errno in an extra file and ensure we not get any problems with invalid errno handling

Motivation:

Because it is possible ARC cause an syscall and so set the errno value we need to ensure no ARC can ever happen before we were able to read the errno value that was caused by an syscall we made.

Modifications:

Move all syscalls to an extra file (System.swift) and ensure all exposed methods are marked with `@inline(never)` and not capture any classes. This ensures no ARC can ever happen.

Result:

Be able to safely read errno if needed.

* Comments
2017-11-16 16:41:19 +01:00
Cory Benfield 4cf0bbaaf4 Make our circular buffers collections 2017-11-16 12:56:29 +00:00
Johannes Weiß 31cd14eaad fix inEventLoop race and makes TSan happy 2017-11-10 14:56:33 -08:00
Cory Benfield 10f93fdca0 Minor fixups in Channel sending logic 2017-11-13 15:34:01 +00:00
Cory Benfield 8ff2d5bb92 OpenSSL ALPN support 2017-11-13 12:45:57 +00:00
Cory Benfield 8d2f13be68 Add parent property 2017-11-13 10:11:52 +00:00
Cory Benfield be81dbacff Forbid oversized writev calls 2017-11-10 16:08:49 +00:00
Cory Benfield 13d80285c8 Don't write too much to writev 2017-11-10 15:45:41 +00:00
Johannes Weiß 40edb34d8f introduce & test ByteBuffer.readString 2017-11-08 13:06:09 -08:00
Cory Benfield e72569e329 Add client-side SNI support 2017-10-25 15:04:46 +01:00
Cory Benfield 8efedf33fa Add ALPN handler 2017-11-01 16:14:11 +00:00
Norman Maurer b9e70f6e42 Rename HTTP files to make more sense and use uppercase 2017-11-09 20:57:36 -08:00
Johannes Weiß 79726e3b5f make HTTPDecoder typesafe (& refactoring) 2017-11-09 20:19:35 -08:00
Daniel Dunbar 6de5ea7c8b [NIOAny] Avoid need for force casts. 2017-11-09 19:33:17 -08:00
Norman Maurer 976f4752df Add HTTPRequestEncoder / HTTPResponseDecoder implementation and tests 2017-11-02 13:50:46 +01:00
Johannes Weiss c18db56fc2 make >= 0 checks for index/length a precondition 2017-11-09 02:49:11 -08:00
Johannes Weiß 20800ed454 use the now fully featured FixedWidthInteger instead of EndiannessInteger 2017-11-08 13:08:02 -08:00
Norman Maurer 9bb7f6727d Use correct types in default method
Motivation:

The default method we added for the MessageToByteEncoder has the incorrect parameter types and so is useless.

Modifications:

Fix type of parameter.

Result:

Default method match the protocol requirement.
2017-11-08 01:14:43 -08:00
Norman Maurer 6d7928beb2 Remove ; from the code 2017-11-06 21:53:30 +01:00
Cory Benfield 7a7536d076 Add support for X.509 subject commonName. 2017-11-03 13:49:32 +00:00
Johannes Weiss 839a5050dd ByteBuffer: fast path for contiguous collections 2017-11-03 02:39:54 -07:00
Norman Maurer c22e5ead6b Remove ByteBufferAllocator constructor argument from HttpResponseEncoder
Motivation:

We can allocate the buffer on the fly if needed, no need to add the constructor argument.

Modifications:

Just allocate the buffer in the methods itself that need it.

Result:

Easier to construct encoder and cleaner code.
2017-11-02 12:56:00 +01:00
Cory Benfield 4e04a275c0 Add internal support for subjectAltName 2017-11-01 17:46:56 +00:00
Cory Benfield 6d8848d239 Omit chunked encoding for HTTP/1.0 2017-11-01 16:17:23 +00:00
Norman Maurer 22a35b2bdb Add FileRegion support when using HTTP
Motivation:

Often people want to transfer large files over http which should be done using sendfile(...) for best performance.

Modifications:

- Add support for using FileRegion when sending body parts.
- Add tests

Result:

Be able to serve files without loading these into memory
2017-11-01 16:02:14 +01:00
Cory Benfield 8f2d17bc55 Break out common TLS events 2017-11-01 10:56:15 +00:00