Changeset 6363


Ignore:
Timestamp:
Jul 19, 2008, 2:32:11 PM (13 years ago)
Author:
livings124
Message:

use portcheck.transmissionbt.com instead of a third-party site

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEWS

    r6323 r6363  
    2020   + Status strings are toggled from the action button (they are no longer clickable)
    2121   + Colors in pieces bar and pieces box more accurately reflect their corresponding values
     22   + The port checker now uses our own portcheck.transmissionbt.com
    2223- GTK+
    2324   + Add options to inhibit hibernation and to toggle the tray icon
  • trunk/macosx/PortChecker.h

    r4423 r6363  
    3030    PORT_STATUS_OPEN,
    3131    PORT_STATUS_CLOSED,
    32     PORT_STATUS_STEALTH,
    3332    PORT_STATUS_ERROR
    3433} port_status_t;
  • trunk/macosx/PortChecker.m

    r6252 r6363  
    2626#import "NSApplicationAdditions.h"
    2727
    28 #define CHECKER_URL @"https://www.grc.com/x/portprobe=%d"
     28#define CHECKER_URL @"http://portcheck.transmissionbt.com/%d"
    2929#define CHECK_FIRE  3.0
    3030
     
    115115- (void) connectionDidFinishLoading: (NSURLConnection *) connection
    116116{
    117     NSXMLDocument * shieldsUpProbe = [[NSXMLDocument alloc] initWithData: fPortProbeData options: NSXMLDocumentTidyHTML error: nil];
     117    NSString * probeString = [[NSString alloc] initWithData: fPortProbeData encoding: NSUTF8StringEncoding];
    118118    [fPortProbeData release];
    119119    fPortProbeData = nil;
    120120   
    121     if (shieldsUpProbe)
     121    if (probeString)
    122122    {
    123         NSArray * nodes = [shieldsUpProbe nodesForXPath: @"/html/body/center/table[3]/tr/td[2]" error: nil];
    124         if ([nodes count] == 1)
    125         {
    126             NSString * portStatus = [[[[nodes objectAtIndex: 0] stringValue] stringByTrimmingCharactersInSet:
    127                                         [[NSCharacterSet letterCharacterSet] invertedSet]] lowercaseString];
    128            
    129             if ([portStatus isEqualToString: @"open"])
    130                 [self callBackWithStatus: PORT_STATUS_OPEN];
    131             else if ([portStatus isEqualToString: @"stealth"])
    132                 [self callBackWithStatus: PORT_STATUS_STEALTH];
    133             else if ([portStatus isEqualToString: @"closed"])
    134                 [self callBackWithStatus: PORT_STATUS_CLOSED];
    135             else
    136             {
    137                 NSLog(@"Unable to get port status: unknown port state");
    138                 [self callBackWithStatus: PORT_STATUS_ERROR];
    139             }
    140         }
     123        if ([probeString isEqualToString: @"1"])
     124            [self callBackWithStatus: PORT_STATUS_OPEN];
     125        else if ([probeString isEqualToString: @"0"])
     126            [self callBackWithStatus: PORT_STATUS_CLOSED];
    141127        else
    142128        {
     
    144130            [self callBackWithStatus: PORT_STATUS_ERROR];
    145131        }
    146         [shieldsUpProbe release];
     132        [probeString release];
    147133    }
    148134    else
    149135    {
    150         NSLog(@"Unable to get port status: failed to create xml document");
     136        NSLog(@"Unable to get port status: invalid data received");
    151137        [self callBackWithStatus: PORT_STATUS_ERROR];
    152138    }
  • trunk/macosx/PrefsController.m

    r6361 r6363  
    5757#define RPC_KEYCHAIN_NAME       "Remote"
    5858
    59 #define WEBUI_URL   @"http://localhost:%d/transmission/clutch/"
     59#define WEBUI_URL   @"http://localhost:%d/transmission/web/"
    6060
    6161@interface PrefsController (Private)
     
    378378        case PORT_STATUS_CLOSED:
    379379            [fPortStatusField setStringValue: NSLocalizedString(@"Port is closed", "Preferences -> Network -> port status")];
    380             [fPortStatusImage setImage: [NSImage imageNamed: @"RedDot.png"]];
    381             break;
    382         case PORT_STATUS_STEALTH:
    383             [fPortStatusField setStringValue: NSLocalizedString(@"Port is stealth", "Preferences -> Network -> port status")];
    384380            [fPortStatusImage setImage: [NSImage imageNamed: @"RedDot.png"]];
    385381            break;
  • trunk/macosx/TransmissionHelp/html/portforward.html

    r5533 r6363  
    6262
    6363
    64                                                 <p>If you get a red dot and the message 'Port is closed'/'Port is Stealth', <a href="troubleshoot.html">click here</a>.</li>
     64                                                <p>If you get a red dot and the message 'Port is closed', <a href="troubleshoot.html">click here</a>.</li>
    6565
    6666
Note: See TracChangeset for help on using the changeset viewer.