Adjust to ObjFW changes

This commit is contained in:
Jonathan Schleifer 2018-12-21 22:45:34 +01:00
parent bdfa70b3e5
commit b8472e162b
No known key found for this signature in database
GPG key ID: D83A76BFE376345E

View file

@ -147,36 +147,22 @@ locking_callback(int mode, int n, const char *file, int line)
- (void)socket: (OF_KINDOF(OFTCPSocket *))sock - (void)socket: (OF_KINDOF(OFTCPSocket *))sock
didConnectToHost: (OFString *)host didConnectToHost: (OFString *)host
port: (uint16_t)port port: (uint16_t)port
exception: (id)exception
{ {
@try { if (exception == nil) {
[sock SSL_startTLSWithExpectedHost: _host @try {
port: _port]; [sock SSL_startTLSWithExpectedHost: _host
} @catch (id e) { port: _port];
[_socket setDelegate: _delegate]; } @catch (id e) {
[_delegate socket: sock exception = e;
didFailToConnectWithException: e }
host: host
port: port];
return;
} }
[_socket setDelegate: _delegate]; [_socket setDelegate: _delegate];
[_delegate socket: sock [_delegate socket: sock
didConnectToHost: host didConnectToHost: host
port: port]; port: port
} exception: exception];
- (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];
} }
@end @end