Commits

Tuukka Norri committed 0649ffa

Moved unscheduling of CFHosts earlier in connection process

  • Participants
  • Parent commits 3f6d623

Comments (0)

Files changed (2)

Sources/PGTSConnector.h

 	CFSocketCallBackType mExpectedCallBack;
 	CFStreamError mHostError;
 }
+
+- (CFRunLoopRef) CFRunLoop;
+- (void) setCFRunLoop: (CFRunLoopRef) aRef;
+
 - (void) socketReady: (CFSocketCallBackType) callBackType;
 - (void) continueFromNameResolution: (const CFStreamError *) error;
 - (BOOL) startNegotiation: (const char *) conninfo;

Sources/PGTSConnector.m

 HostReady (CFHostRef theHost, CFHostInfoType typeInfo, const CFStreamError *error, void *self)
 {
 	BXLogDebug (@"CFHost got ready.");
+	CFHostUnscheduleFromRunLoop (theHost, [(id) self CFRunLoop], kCFRunLoopCommonModes);
 	[(id) self continueFromNameResolution: error];
 }
 
 }
 
 
+- (CFRunLoopRef) CFRunLoop
+{
+	return mRunLoop;
+}
+
+
 - (void) setCFRunLoop: (CFRunLoopRef) aRef
 {
 	if (mRunLoop != aRef)
 		status = CFHostStartInfoResolution (mHost, kCFHostAddresses, &mHostError);
 		BXLogDebug (@"Started host info resolution: %d.", status);
 		if (! status)
+		{
+			CFHostUnscheduleFromRunLoop (mHost, runloop, kCFRunLoopCommonModes);
 			[self continueFromNameResolution: &mHostError];
+		}
 	}
 	else
 	{