Commit Graph

435 Commits

Author SHA1 Message Date
Johannes Weiss 37daab6b50 integration test for blacklisted errnos 2017-12-01 14:58:04 +00:00
Johannes Weiss 98017432b8 dont require Foundation for IOError description creation 2017-12-01 14:31:37 +00:00
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 8549f4229e add Jazzy documentation generation script 2017-11-30 14:36:42 +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
Johannes Weiß a4609aff3a junit xml had wrong package name 2017-11-21 19:00:19 +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ß 901d8cdfed interpret $SWIFT_EXEC correctly as the "swiftc" binary 2017-11-21 16:28:57 +00:00
Johannes Weiß f79aa7ef20 fix integration tests for Linux 2017-11-21 13:30:31 +00:00
Johannes Weiss 4a74aca592 integration test for syscall wrapper 2017-11-21 15:00:25 +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
Norman Maurer f369a17d42 Fix warnings that are cased by using try for functions that not throw. Leftover from 4a315c9e9d12345e70b838cdfea54ddb0b191da8 2017-11-16 19:39:16 +01: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
Johannes Weiss f6343496c3 add another test for a very large number of buffered writes 2017-11-11 00:10:23 -08: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
Max (Swift) Moiseev 8d4eb477ed Xenial and compose
* Docker work

- New image based on xenial.
- Simplified workflow with docker-compose
- Update the readme with docker-compose section
- Move docker related stuff to a dedicated folder

* Add a gen-cert.sh to the container image

* Document certificate generation and how to test all sample servers
2017-11-09 21:34:51 -08: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
Max Moiseev dccbbf0bb7 Remove unnecessary Numeric constraint 2017-11-08 14:46:10 -08:00