Skip to content
Permalink
Branch: master
Commits on Dec 6, 2019
  1. Add first(name:) to HTTPHeaders (#1282)

    glbrntt authored and weissi committed Dec 6, 2019
    Motivation:
    
    In some cases you only expect (or care about) a single value for a
    header. However, getting this value without allocating an array or
    traversing the whole array requres using first(where:) provided by
    Sequence. This is not very ergonomic as it requires users to do the
    case-insensitive comparison and then exctact the value from the
    HTTPHeaders. Additionally, users cannot use NIO's case insensitive
    ASCII comparison.
    
    Modifications:
    
    - Provide a first(name:) method on HTTPHeaders which returns the value
      from the first header whose name is a case insentive match of the
      subscript parameter.
    
    Result:
    
    It's easier to get the first value from HTTPHeaders matching a given
    name.
  2. Remove weak var from testThreadSpecificDoesNotLeakIfThreadExitsWhilst…

    glbrntt authored and weissi committed Dec 6, 2019
    …SetOnMultipleThreads (#1295)
    
    Motivation:
    
    testThreadSpecificDoesNotLeakIfThreadExitsWhilstSetOnMultipleThreads was
    periodically crashing with a SIGSEGV.
    
    Modifications:
    
    Remove unnecessary weak var, wait on semaphone instead of weak var
    becoming nil.
    
    Result:
    
    Less flaky test.
Commits on Dec 2, 2019
  1. Update Code of Conduct project maintainer (#1278)

    glbrntt authored and Lukasa committed Dec 2, 2019
    Motivation:
    
    The code-of-conduct email address is out-of-date.
    
    Modifications:
    
    Update code-of-conduct email address to swift-server-conduct@group.apple.com
    
    Result:
Commits on Nov 27, 2019
  1. Make ByteBufferView mutable (#1208)

    glbrntt authored and Lukasa committed Nov 27, 2019
    Motivation:
    
    ByteBufferView isn't a mutable collection, but it probably should be.
    
    Modifications:
    
    - Add `copyBytes(at:to:length)` to `ByteBuffer` to copy bytes from a
      readable region of a buffer to another part of the buffer
    - Conform `ByteBufferView` to `MutableCollection`, `RangeReplaceableCollection`
      and `MutableDataProtocol`
    - Add an allocation counting test
    
    Result:
    
    `ByteBufferView` is now mutable.
Commits on Nov 14, 2019
  1. Fix running run-nio-alloc-counter-tests.sh for a single test (#1245)

    glbrntt committed Nov 14, 2019
    Motivation:
    
    Using the single test argument with the run-nio-alloc-counter-tests.sh
    does not work as expected as the given test would just replace the first
    test in the list.
    
    Modifications:
    
    Replace the tests to run with a single-element array containing the test
    provided as an argument.
    
    Result:
    
    - A single test can be run when specified as a command line arg.
Commits on Sep 13, 2019
  1. Fix creating HTTPResponseStatus from 418 (#1140)

    glbrntt authored and Lukasa committed Sep 13, 2019
    Motivation:
    
    I ran across a case in a test where `HTTPResponseStatus(statusCode: 418)`
    unexpectedly returned a `.custom` response status.
    
    Modifications:
    
    - Add a missing `case` for creating a status from `418`
    - Shuffled some of cases around so that they are correctly listed in the
      correct 2xx, 3xx, 4xx etc. sections
    
    Result:
    
    - `HTTPResponseStatus(statusCode: 418)` now returns `.imATeapot`
Commits on Sep 10, 2019
  1. Allow promises to be completed with a `Result<Value, Error>` (#1124)

    glbrntt authored and Lukasa committed Sep 10, 2019
    Motivation:
    
    When dealing with `Result` types and promises it is inconvenient having to
    switch over the result in order to succeed or fail a promise.
    
    Modifications:
    
    - Allow promises to be completed with a `Result<Value, Error>` directly.
    - Added tests.
    
    Result:
    
    Promises are easier to fulfill with `Result` types.
Commits on Jul 4, 2019
  1. Check jq is available before checking API breakages (#1058)

    glbrntt authored and weissi committed Jul 4, 2019
    * Check jq is available before checking API breakages
    
    Motivation:
    
    If jq wasn't installed the API breakage script would erronesouly say
    that there were no breaking API changes. That's pretty bad.
    
    Modifications:
    
    Check jq is available before running the check. Updated the usage
    message to specify that a Swift 5.1+ toolchain is required.
    
    Result:
    
    More correctness.
Commits on Jun 5, 2019
  1. Add an optimization tips document. (#1024)

    glbrntt authored and Lukasa committed Jun 5, 2019
    Motivation:
    
    NIO doesn't offer any tips of on how to write performant code. After
    discussing with @weissi we decided it would be useful to gather and
    document some useful tips and tricks.
    
    Modifications:
    
    Started an optimization tips document.
    
    Result:
    
    Easier for NIO users to write performant code.
Commits on Jun 4, 2019
  1. Fix incorrect closure names in documentation. (#1025)

    glbrntt authored and Lukasa committed Jun 4, 2019
    Motivation:
    
    I noticed some closures were referred to by the wrong name in the
    documentation.
    
    Modifications:
    
    Updated the documentation to use the correct names.
    
    Result:
    
    More correct documentation.
Commits on May 16, 2019
  1. Allow adding a sequence of headers to HTTPHeaders (#1004)

    glbrntt authored and Lukasa committed May 16, 2019
    * Allow adding a sequence of headers to HTTPHeaders
    
    Motivation:
    
    When combining two collections of headers, adding each pair one-by-one
    using add(name:value:) can cause multiple unnecessary reallocations of
    the underlying array.
    
    Modifications:
    
    Provide two additional add methods to HTTPHeaders: one to add a sequence
    of name/value pairs and another to add the headers from another
    HTTPHeaders, both of which use `append(contentsOf:)` on the underlying
    array to avoid additional reallocations.
    
    Result:
    
    Fewer reallocations when adding multiple headers.
    
    * Fix incorrect documentation, make add<S: Sequence>(contentsOf:) @inlineable
    
    * Reserve capacity and add sequentially instead of using append(contentsOf:)
    
    * Add tests and missing @usableFromInline
Commits on Feb 6, 2019
  1. Remove outdated documentation (#808)

    glbrntt authored and Lukasa committed Feb 6, 2019
Commits on Feb 1, 2019
  1. Fix documenation markup (#799)

    glbrntt authored and Lukasa committed Feb 1, 2019
    Motivation:
    
    Quick Documentation was not rendering some parameter documentation
    correctly as it was over-indented.
    
    Modifications:
    
    Reduced indentation for over-indented parameters.
    
    Result:
    
    Quick Documentation renders correctly.
You can’t perform that action at this time.