Motivation:
Explain here the context, and why you're making that change.
What is the problem you're trying to solve.
Modifications:
Describe the modifications you've done.
Result:
After your change, what will change.
Before this was printed out.
NIOOpenSSLTests/SSLCertificateTest.swift:105: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
Motiviation:
We used to only allocate one buffer per read loop (by default we use multiple reads per loop) and record for the next loop iteration if we need to allocate a bigger buffer or not. This can lead to very slowely ramping up of number of bytes we read. We should better detect if we should allocate a new buffer because we used all the writable bytes to allow faster ramping up of numbre of bytes to read .
Modification:
- Change RecvByteBufferAllocator.record to return a Bool that wil lsignal if we used all the writable bytes of the last allocation and so may want to try to allocate a bigger buffer again
- Adjust tests.
Result:
Faster adjustment of the ByteBuffer capacity when reading data.
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
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.