More bugfixes to networking. Small fix in Preferences. Show Player app launch is...
[MenuTunes.git] / NetworkController.m
index f2989e3..33cee8f 100755 (executable)
@@ -98,7 +98,7 @@ static NetworkController *sharedController;
                                         name:name
                                         port:SERVER_PORT];
         fullPass = [[NSUserDefaults standardUserDefaults] dataForKey:@"sharedPlayerPassword"];
-        if (fullPass) {
+        if ([fullPass length]) {
             [fullPass getBytes:&buffer range:NSMakeRange(6, 4)];
             [serverPass release];
             serverPass = [[NSData alloc] initWithBytes:&buffer length:strlen(&buffer)];
@@ -220,6 +220,7 @@ static NetworkController *sharedController;
                                          host:host];
         testConnection = [[NSConnection connectionWithReceivePort:nil sendPort:testPort] retain];
         [testConnection setReplyTimeout:2];
+        [testConnection setRequestTimeout:2];
         tempProxy = (NetworkObject *)[testConnection rootProxy];
         [tempProxy serverName];
         valid = [tempProxy isValid];
@@ -230,7 +231,7 @@ static NetworkController *sharedController;
         return NO;
     NS_ENDHANDLER
     
-    if (!clientProxy) {
+    if (!tempProxy) {
         ITDebugLog(@"Null proxy! Couldn't connect!");
         [testConnection release];
         [testPort release];