Permalink
Commits on Dec 18, 2018
  1. document NIO 2 development in the README (#715)

    weissi committed Dec 18, 2018
    Motivation:
    
    We're at the moment devloping NIO 2 and we should tell people.
    
    Modifications:
    
    - changed readme
    - document how to develop with the latest Xcode
    
    Result:
    
    - fixes #771
  2. remove ContiguousCollection (#709)

    weissi committed Dec 18, 2018
    Motivation:
    
    ContiguousCollection is no longer necessary because Sequence gained
    withContiguousStorageIfAvailable.
    
    Modifications:
    
    Removed ContiguousCollection and switch to withContiguousStorageIfAvailable.
    
    Result:
    
    less code
Commits on Dec 17, 2018
  1. internalise things made public by accident (#463)

    weissi committed Dec 17, 2018
    Motivation:
    
    A few things are public by accident, this makes those internal for NIO
    2.0.0.
    
    Modifications:
    
    internalise a few things
    
    Result:
    
    less public API
  2. fix remaining warnings & -warnings-as-errors (#712)

    weissi committed Dec 17, 2018
    Motivation:
    
    Warnings are bad.
    
    Modifications:
    
    - fixed remaining warnings
    - enabled -warnings-as-errors
    
    Result:
    
    happier devs
Commits on Dec 14, 2018
  1. fix CircularBuffer.replaceSubrange expands (#683)

    weissi committed Dec 14, 2018
    Motivation:
    
    CircularBuffer.replaceSubrange was crazy eager to double the capacity
    which is bad.
    
    Modifications:
    
    Made CircularBuffer.replaceSubrange only double if necessary.
    
    Result:
    
    less memory usage
  2. use String.UTF8View.withContiguousStorageIfAvailable (#707)

    weissi committed Dec 14, 2018
    Motivation:
    
    The new shiny Swift 5 gives us fast access to the UTF8 bytes (if
    available, which mostly means not bridged from Cocoa), we should use
    that.
    
    Modifications:
    
    use UTF8View.withContiguousStorageIfAvailable
    
    Result:
    
    faster String access
  3. allow EventLoopIterator to be constructed using [EventLoop] (#706)

    weissi authored and Lukasa committed Dec 14, 2018
    Motivation:
    
    Modules outside of NIO core must be able to create `EventLoopIterator`s
    in order to conform to the `EventLoop` protocol, therefore we need an
    initialiser that's available.
    
    Modifications:
    
    add public initialiser to construct EventLoopIterator from [EventLoop]
    
    Result:
    
    others can implement EventLoops again
  4. update tools-version to 5.0 & fix latest warnings (#704)

    weissi committed Dec 14, 2018
    Motivation:
    
    The latest Swift 5.0s bring us new goodies (hence tools version) and
    also more warnings, hence the fixes for them.
    
    Modifications:
    
    - set tools-version to 5.0
    - fix warnings
    - workaround https://bugs.swift.org/browse/SR-9514
    
    Result:
    
    happier developers
  5. CI: update to Swift snapshot 13th Dec 2018 (#703)

    weissi committed Dec 14, 2018
    Motivation:
    
    SwiftPM was very outdated on the old Swift snapshots, we should update
    the CI.
    
    Modifications:
    
    use swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-13-a-ubuntu18.04.tar.gz
    
    Result:
    
    can use swift-tools-version: 5.0 and all the goodies from that
Commits on Dec 10, 2018
  1. all caps for SNI (#693)

    weissi authored and Lukasa committed Dec 10, 2018
    Motivation:
    
    In Swift, abbreviations use the same case for all letters, therefore it
    should be `SNI` and not `Sni`.
    
    Modifications:
    
    changes `Sni` to `SNI`
    
    Result:
    
    more consistent with naming guidelines
  2. changed port/HTTP version parts to Ints (#691)

    weissi authored and Lukasa committed Dec 10, 2018
    Motivation:
    
    - `Int` is the currency type for integral things and we already sort of
      changed the the type for ports but not everywhere.
    - generic parameters that aren't just 'any type' shouldn't be just `T`
      or `S` or something
    
    Modifications:
    
    - make more use of `Int`
    - rename generic parameters to something more descriptive like `Bytes`
    
    Result:
    
    easier to read/write NIO code
  3. make factory method names start with make (#692)

    weissi authored and Lukasa committed Dec 10, 2018
    Motivation:
    
    Swift naming guidelines mandate that factory methods start with `make`,
    like `makeSomething`. We had a few that were `newSomething`.
    
    Modifications:
    
    make all factories start with make
    
    Result:
    
    more compliant to Swift naming rules
  4. first cut at B2MD v2 (#675)

    weissi committed Dec 10, 2018
    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.
Commits on Dec 7, 2018
  1. kick off NIO2 (#678)

    weissi authored and Lukasa committed Dec 7, 2018
    Motivation:
    
    NIO2 development starts now.
    
    Modifications:
    
    Made NIO Swift 5-only for everything else see docs/public-api-changes-NIO1-to-NIO2.md
    
    Result:
    
    NIO2 development can start.
Commits on Nov 28, 2018
  1. change newPromise(for: T.Type) to newPromise(of: T.Type) (#672)

    weissi authored and Lukasa committed Nov 28, 2018
    Motivation:
    
    making a promise of a type is more grammatical than making a promise for
    a type.
    
    Modifications:
    
    s/newPromise(for/newPromise(of/g
    
    Result:
    
    more grammar
  2. optional type parameter for newPromise() (#671)

    weissi authored and Lukasa committed Nov 28, 2018
    Motivation:
    
    When creating new promises I always find it very frustrating to type the
    `: EventLoopPromise<Type>` type annotation but it's necessary for the
    compiler to know type the promise will be fulfilled with.
    
    Modifications:
    
    allow an optional `for: SomeType.self` parameter for `newPromise` as
    
        let p = eventLoop.newPromise(for: Int.self)
    
    is much easier to type than
    
        let p: EventLoopPromise<Int> = eventLoop.newPromise()
    
    Result:
    
    easier to write code
  3. update contributors file (#668)

    weissi committed Nov 28, 2018
    Motivation:
    
    Now, shortly before 2.0 is a good time to update the contributors list.
    
    Modifications:
    
    Ran the contributor generation script (ASCII'd my name)
    
    Result:
    
    All contributors get their proper credit.
Commits on Nov 21, 2018
  1. fix some test warnings (#659)

    weissi committed Nov 21, 2018
    Motivation:
    
    I recently removed a bogus assertion but forgot to remove some now
    useless variables.
    
    Modifications:
    
    Remove those useless variables.
    
    Result:
    
    Only deprecation warnings left.
  2. don't capture in the callout closures in BaseSocketChannel (#658)

    weissi authored and Lukasa committed Nov 21, 2018
    Motivation:
    
    We were complaining that we can't use `@convention(thin)` in a place
    where we really need to make sure we don't get allocations for returning
    a closure (that doesn't capture any context), so it should just be a
    function pointer.
    
    In reality however, we were actually capturing context...
    
    Modifications:
    
    Don't capture context anymore.
    
    Result:
    
    Closures should not actually not enclose anything.
Commits on Nov 16, 2018
  1. ignore pthread_setname_np result (#656)

    weissi authored and Lukasa committed Nov 16, 2018
    Motivation:
    
    We have seen pthread_setname_np fail with EPERM in containers, it's
    non-critical so best to ignore.
    
    Modifications:
    
    ignore pthread_setname_np's return code.
    
    Result:
    
    works in containers.
Commits on Nov 15, 2018
  1. ByteBuffer test: remove bogus test assertion (#655)

    weissi committed Nov 15, 2018
    Motivation:
    
    One ByteBuffer test was (for whatever reason) asserting that realloc
    never succeeds in realloc'ing from 16 to 32 bytes. That just failed on
    macOS, presumably an allocator change.
    
    Modifications:
    
    remove bogus assertion about reallocs ability to grow allocations.
    
    Result:
    
    tests more stable
Commits on Nov 13, 2018
  1. connect timeout tests: work around ECONNREFUSED (#653)

    weissi committed Nov 13, 2018
    Motivation:
    
    Some network configurations might disallow connecting to unknown IP
    addresses. The effect of that is that we might see `ECONNREFUSED` when
    trying to connect to 198.51.100.254 which nominally is reserved for
    documentation only (ie. we shouldn't get any RSTs).
    
    Modifications:
    
    ignore `ECONNREFUSED` in the timeout tests too
    
    Result:
    
    tests stable in less permissive network environments
  2. remove ugly and unnecessary ignore result (_ = ...) (#652)

    weissi committed Nov 13, 2018
    Motivation:
    
    _ = expression() is ugly and in many cases unimportant. In fact we train
    ourselves to overread it which makes special cases where you'd actually
    expect a result to be used just look normal.
    
    Modifications:
    
    remove _ = from a lot of places. In many cases we already had a better
    (and sometimes cheaper way) to not return a value but in some cases
    (mostly `remove` functions) I added `@discardableResult`
    
    Result:
    
    NIO source code looks nicer
Commits on Nov 5, 2018
  1. EventLoop.assertInEventLoop and preconditionInEventLoop (#644)

    weissi authored and Lukasa committed Nov 5, 2018
    Motivation:
    
    Dispatch can only precondition that code is run from a certain queue, it
    can't return if code is running on a certain queue.
    To support that this introduces new EventLoop.assertInEventLoop and
    EventLoop.preconditionInEventLoop methods instead of
    assert(eventLoop.inEventLoop).
    
    Modifications:
    
    add EventLoop.assertInEventLoop and EventLoop.preconditionInEventLoop
    
    Result:
    
    better support for Network.framework in NIOTS
Commits on Nov 1, 2018
  1. fix Swift 5 warnings (mostly redundant modifiers (#642)

    weissi authored and Lukasa committed Nov 1, 2018
    Motivation:
    
    Swift 5 complains on redundant modifiers. For example declaring a
    `public func` inside of a `public extension` is now a warning. I don't
    agree with this but I dislike warnings even more, so...
    
    Modifications:
    
    remove all redundant modifiers that the compiler now warns about such as
    
        swift-nio/Sources/NIOPriorityQueue/PriorityQueue.swift:90:5: warning: 'public' modifier is redundant for property declared in a public extension
    
    Result:
    
    no warnings in Swift 5
Commits on Oct 31, 2018
  1. add String blitting benchmarks (#641)

    weissi committed Oct 31, 2018
    Motivation:
    
    Writing Strings to ByteBuffers is important, let's have some more
    benchmarks.
    
    Modifications:
    
    add String to ByteBuffer benchmarks
    
    Result:
    
    more benchmarks
Commits on Oct 30, 2018
  1. ByteBuffer: small & medium sized string copies over 10% faster (#640)

    weissi authored and Lukasa committed Oct 30, 2018
    Motivation:
    
    urbp[start ..< end] is quite a bit faster than when done in two
    operations urbp.dropFirst(start).prefix(length). This improves small (4
    bytes) & medium sized (24 bytes) String copies by over 10%. Good for
    HTTP headers etc.
    
    Modifications:
    
    replace urbp.dropFirst(start).prefix(length) by urbp[start ..< start +
    length]
    
    Result:
    
    small & medium sized String copies faster
  2. String decoding: go through URBP directly instead of Slice (#639)

    weissi authored and Lukasa committed Oct 30, 2018
    Motivation:
    
    String decoding can work faster when going through URBP directly instead
    of a Slice of a URBP. The reason is that if the String has the utf8
    represenation stored directly it'll just be a memcpy (+ validation).
    
    Modifications:
    
    go through URBP when decoding a String using String(decoding:as:)
    
    Result:
    
    faster if the String utf8 representation happens to be available
Commits on Oct 29, 2018
  1. verify that IOThreadPools get shut down (#635)

    weissi authored and Lukasa committed Oct 29, 2018
    Motivation:
    
    Not shutting down IOThreadPools leads to thread leaks so we should
    verify they're actually shut down.
    
    Modifications:
    
    add a check that we're shutting down
    
    Result:
    
    fewer thread leaks
Commits on Oct 19, 2018
  1. fix potential deadlock in BlockingIOThreadPool (#634)

    weissi committed Oct 19, 2018
    Motivation:
    
    BlockingIOThreadPool used to call out with a lock held and on top of
    that on the wrong thread...
    
    Modifications:
    
    Make BlockingIOThreadPool call out on the supplied `queue`
    
    Result:
    
    fewer deadlock and surprises
  2. use umbrella headers for C modules (#636)

    weissi authored and Lukasa committed Oct 19, 2018
    Motivation:
    
    SwiftPM only generates fully usable clang modules for C modules if they
    have umbrella headers. Therefore, adding a generated NIO.xcodeproj to
    another Xcode project as a sub-project never worked.
    To make a header an umbrella header you need to name them _exactly_ like
    the module.
    
    Modifications:
    
    give each C module an umbrella header
    
    Result:
    
    generated NIO Xcode projects can be used as sub-projects.
Commits on Oct 16, 2018
  1. update http_parser.c (#627)

    weissi authored and Lukasa committed Oct 16, 2018
    Motivation:
    
    There was an outstanding change in http_parser.c that we did not yet
    have in our copy.
    
    Modifications:
    
    run the update http parser script and add changes as well as a test case
    designed to hit the change.
    
    Result:
    
    ship the latest and greatest
Commits on Sep 20, 2018
  1. make the allocation limits for Swift 4.2 the main ones (#621)

    weissi authored and Lukasa committed Sep 20, 2018
    Motivation:
    
    We always care most about the latest released Swift version. Therefore I
    added allocation limits for Swift 4.2 and indicated that the old ones
    can be removed as soon as they change.
    
    Modifications:
    
    - added allocation limits for Swift 4.2
    - added a comment to the old ones that they don't need to be changed
      anymore now
    
    Result:
    
    - best support for best version
    - document that Swift 4.2 is awesome, lots fewer allocations!
Commits on Sep 19, 2018
  1. explain some force tries/unwraps (#619)

    weissi authored and Lukasa committed Sep 19, 2018
    Motivation:
    
    It's generally good style to explain why something needs to be force
    unwrapped/tried if not obvious.
    
    Modifications:
    
    Add explanations to a bunch of places.
    
    Result:
    
    Code easier to understand.
Commits on Sep 18, 2018
  1. CI: use Swift 4.2-RELEASE instead of CONVERGENCE (#616)

    weissi authored and Lukasa committed Sep 18, 2018
    Motivation:
    
    Now that 4.2 has been released, there's no reason to use the CONVERGENCE
    version anymore.
    
    Modifications:
    
    use the RELEASE instead of the CONVERGENCE version of Swift 4.2
    
    Result:
    
    use the latest and greatest