mirror of
https://github.com/transmission/transmission.git
synced 2025-12-27 21:53:42 +00:00
use portcheck.transmissionbt.com instead of a third-party site
This commit is contained in:
1
NEWS
1
NEWS
@@ -19,6 +19,7 @@ http://trac.transmissionbt.com/query?group=component&milestone=1.30
|
||||
+ Option to only show the add window when manually adding transfers
|
||||
+ Status strings are toggled from the action button (they are no longer clickable)
|
||||
+ Colors in pieces bar and pieces box more accurately reflect their corresponding values
|
||||
+ The port checker now uses our own portcheck.transmissionbt.com
|
||||
- GTK+
|
||||
+ Add options to inhibit hibernation and to toggle the tray icon
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ typedef enum
|
||||
PORT_STATUS_CHECKING,
|
||||
PORT_STATUS_OPEN,
|
||||
PORT_STATUS_CLOSED,
|
||||
PORT_STATUS_STEALTH,
|
||||
PORT_STATUS_ERROR
|
||||
} port_status_t;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#import "PortChecker.h"
|
||||
#import "NSApplicationAdditions.h"
|
||||
|
||||
#define CHECKER_URL @"https://www.grc.com/x/portprobe=%d"
|
||||
#define CHECKER_URL @"http://portcheck.transmissionbt.com/%d"
|
||||
#define CHECK_FIRE 3.0
|
||||
|
||||
@implementation PortChecker
|
||||
@@ -114,40 +114,26 @@
|
||||
|
||||
- (void) connectionDidFinishLoading: (NSURLConnection *) connection
|
||||
{
|
||||
NSXMLDocument * shieldsUpProbe = [[NSXMLDocument alloc] initWithData: fPortProbeData options: NSXMLDocumentTidyHTML error: nil];
|
||||
NSString * probeString = [[NSString alloc] initWithData: fPortProbeData encoding: NSUTF8StringEncoding];
|
||||
[fPortProbeData release];
|
||||
fPortProbeData = nil;
|
||||
|
||||
if (shieldsUpProbe)
|
||||
if (probeString)
|
||||
{
|
||||
NSArray * nodes = [shieldsUpProbe nodesForXPath: @"/html/body/center/table[3]/tr/td[2]" error: nil];
|
||||
if ([nodes count] == 1)
|
||||
{
|
||||
NSString * portStatus = [[[[nodes objectAtIndex: 0] stringValue] stringByTrimmingCharactersInSet:
|
||||
[[NSCharacterSet letterCharacterSet] invertedSet]] lowercaseString];
|
||||
|
||||
if ([portStatus isEqualToString: @"open"])
|
||||
[self callBackWithStatus: PORT_STATUS_OPEN];
|
||||
else if ([portStatus isEqualToString: @"stealth"])
|
||||
[self callBackWithStatus: PORT_STATUS_STEALTH];
|
||||
else if ([portStatus isEqualToString: @"closed"])
|
||||
[self callBackWithStatus: PORT_STATUS_CLOSED];
|
||||
else
|
||||
{
|
||||
NSLog(@"Unable to get port status: unknown port state");
|
||||
[self callBackWithStatus: PORT_STATUS_ERROR];
|
||||
}
|
||||
}
|
||||
if ([probeString isEqualToString: @"1"])
|
||||
[self callBackWithStatus: PORT_STATUS_OPEN];
|
||||
else if ([probeString isEqualToString: @"0"])
|
||||
[self callBackWithStatus: PORT_STATUS_CLOSED];
|
||||
else
|
||||
{
|
||||
NSLog(@"Unable to get port status: invalid response");
|
||||
[self callBackWithStatus: PORT_STATUS_ERROR];
|
||||
}
|
||||
[shieldsUpProbe release];
|
||||
[probeString release];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Unable to get port status: failed to create xml document");
|
||||
NSLog(@"Unable to get port status: invalid data received");
|
||||
[self callBackWithStatus: PORT_STATUS_ERROR];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#define RPC_KEYCHAIN_SERVICE "Transmission:Remote"
|
||||
#define RPC_KEYCHAIN_NAME "Remote"
|
||||
|
||||
#define WEBUI_URL @"http://localhost:%d/transmission/clutch/"
|
||||
#define WEBUI_URL @"http://localhost:%d/transmission/web/"
|
||||
|
||||
@interface PrefsController (Private)
|
||||
|
||||
@@ -379,10 +379,6 @@
|
||||
[fPortStatusField setStringValue: NSLocalizedString(@"Port is closed", "Preferences -> Network -> port status")];
|
||||
[fPortStatusImage setImage: [NSImage imageNamed: @"RedDot.png"]];
|
||||
break;
|
||||
case PORT_STATUS_STEALTH:
|
||||
[fPortStatusField setStringValue: NSLocalizedString(@"Port is stealth", "Preferences -> Network -> port status")];
|
||||
[fPortStatusImage setImage: [NSImage imageNamed: @"RedDot.png"]];
|
||||
break;
|
||||
case PORT_STATUS_ERROR:
|
||||
[fPortStatusField setStringValue: NSLocalizedString(@"Port check website is down", "Preferences -> Network -> port status")];
|
||||
[fPortStatusImage setImage: [NSImage imageNamed: @"YellowDot.png"]];
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
<html>
|
||||
<html>
|
||||
Reference in New Issue
Block a user