apple / swift-nio-ssl

TLS Support for SwiftNIO, based on BoringSSL.
https://swiftpackageindex.com/apple/swift-nio-ssl/main/documentation/niossl
Apache License 2.0
388 stars 139 forks source link

Clean up write logic #385

Closed Lukasa closed 2 years ago

Lukasa commented 2 years ago

Motivation:

Unnecessary empty writes should be avoided, and we should avoid completing promises too often.

Modifications:

Result:

Slightly better write behaviour.

Note that this is fundamentally un-testable: there's no place to put a test hook here, and we coalesce writes on the far side, so we can't do much here.