From b8472e162bf9269376b6bfa215b3211d85191f75 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Fri, 21 Dec 2018 22:45:34 +0100 Subject: [PATCH] Adjust to ObjFW changes --- src/SSLSocket.m | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/src/SSLSocket.m b/src/SSLSocket.m index efc0e1f..6daa347 100644 --- a/src/SSLSocket.m +++ b/src/SSLSocket.m @@ -147,36 +147,22 @@ locking_callback(int mode, int n, const char *file, int line) - (void)socket: (OF_KINDOF(OFTCPSocket *))sock didConnectToHost: (OFString *)host port: (uint16_t)port + exception: (id)exception { - @try { - [sock SSL_startTLSWithExpectedHost: _host - port: _port]; - } @catch (id e) { - [_socket setDelegate: _delegate]; - [_delegate socket: sock - didFailToConnectWithException: e - host: host - port: port]; - return; + if (exception == nil) { + @try { + [sock SSL_startTLSWithExpectedHost: _host + port: _port]; + } @catch (id e) { + exception = e; + } } [_socket setDelegate: _delegate]; [_delegate socket: sock didConnectToHost: host - port: port]; -} - -- (void)socket: (OF_KINDOF(OFTCPSocket *))sock - didFailToConnectWithException: (id)exception - host: (OFString *)host - port: (uint16_t)port -{ - [_socket setDelegate: _delegate]; - - return [_delegate socket: sock - didFailToConnectWithException: exception - host: host - port: port]; + port: port + exception: exception]; } @end