@@ -146,11 +146,11 @@ @end @interface OFTCPSocket_ConnectContext: OFObject { @public - bool _connected; + bool _done; id _exception; } - (void)socketDidConnect: (OFTCPSocket *)sock context: (id)context @@ -655,14 +655,12 @@ - (void)socketDidConnect: (OFTCPSocket *)sock context: (id)context exception: (id)exception { - if (exception != nil) - _exception = [exception retain]; - - _connected = true; + _exception = [exception retain]; + _done = true; } @end @implementation OFTCPSocket @synthesize SOCKS5Host = _SOCKS5Host, SOCKS5Port = _SOCKS5Port; @@ -781,11 +779,11 @@ runLoopMode: connectRunLoopMode target: context selector: @selector(socketDidConnect:context:exception:) context: nil]; - while (!context->_connected) + while (!context->_done) [runLoop runMode: connectRunLoopMode beforeDate: nil]; /* Cleanup */ [runLoop runMode: connectRunLoopMode