Skip to content

Commit

Permalink
fix: adjust default tls negotiation timeouts for mobile and otherwise (
Browse files Browse the repository at this point in the history
  • Loading branch information
kneekey23 authored Oct 29, 2021
1 parent 9902839 commit 5f8a6b9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Source/AwsCommonRuntimeKit/io/TlsConnectionOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ public final class TlsConnectionOptions {
init(_ context: TlsContext, allocator: Allocator) {
self.allocator = allocator

self.rawValue = allocatePointer()
aws_tls_connection_options_init_from_ctx(rawValue, context.rawValue)
var connectionsPointer: UnsafeMutablePointer<aws_tls_connection_options> = allocatePointer()
aws_tls_connection_options_init_from_ctx(connectionsPointer, context.rawValue)
#if os(iOS) || os(watchOS)
connectionsPointer.pointee.timeout_ms = 30_000
#else
connectionsPointer.pointee.timeout_ms = 3_000
#endif
self.rawValue = connectionsPointer
}

public func setAlpnList(_ alpnList: String) throws {
Expand Down

0 comments on commit 5f8a6b9

Please sign in to comment.