mirror of
https://github.com/transmission/transmission
synced 2025-02-21 21:57:01 +00:00
adjustment to the port checker, including getting rid of an unneeded instance variable of the port; a couple of implicit settings added to the project file
This commit is contained in:
parent
e67b450aeb
commit
cf6e618753
4 changed files with 21 additions and 16 deletions
|
@ -2379,6 +2379,7 @@
|
||||||
);
|
);
|
||||||
IBC_FLATTEN_NIBS = NO;
|
IBC_FLATTEN_NIBS = NO;
|
||||||
IBC_NOTICES = NO;
|
IBC_NOTICES = NO;
|
||||||
|
IBC_WARNINGS = YES;
|
||||||
INFOPLIST_FILE = "$(SRCROOT)/macosx/Info.plist";
|
INFOPLIST_FILE = "$(SRCROOT)/macosx/Info.plist";
|
||||||
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-CC";
|
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-CC";
|
||||||
INFOPLIST_PREFIX_HEADER = "$(SRCROOT)/libtransmission/version.h";
|
INFOPLIST_PREFIX_HEADER = "$(SRCROOT)/libtransmission/version.h";
|
||||||
|
@ -2387,13 +2388,13 @@
|
||||||
"third-party/curl/lib",
|
"third-party/curl/lib",
|
||||||
"third-party/openssl/lib",
|
"third-party/openssl/lib",
|
||||||
);
|
);
|
||||||
LLVM_LTO = YES;
|
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
OTHER_CFLAGS = "$(inherited)";
|
OTHER_CFLAGS = "$(inherited)";
|
||||||
OTHER_LDFLAGS = "";
|
OTHER_LDFLAGS = "";
|
||||||
PREBINDING = NO;
|
PREBINDING = NO;
|
||||||
PRELINK_LIBS = "";
|
PRELINK_LIBS = "";
|
||||||
|
RUN_CLANG_STATIC_ANALYZER = NO;
|
||||||
SDKROOT = macosx10.6;
|
SDKROOT = macosx10.6;
|
||||||
STRIP_INSTALLED_PRODUCT = NO;
|
STRIP_INSTALLED_PRODUCT = NO;
|
||||||
VALID_ARCHS = "i386 ppc ppc7400 ppc970 x86_64";
|
VALID_ARCHS = "i386 ppc ppc7400 ppc970 x86_64";
|
||||||
|
@ -2537,6 +2538,7 @@
|
||||||
"third-party/openssl/include",
|
"third-party/openssl/include",
|
||||||
);
|
);
|
||||||
IBC_NOTICES = NO;
|
IBC_NOTICES = NO;
|
||||||
|
IBC_WARNINGS = YES;
|
||||||
INFOPLIST_FILE = "$(SRCROOT)/macosx/Info.plist";
|
INFOPLIST_FILE = "$(SRCROOT)/macosx/Info.plist";
|
||||||
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-CC";
|
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-CC";
|
||||||
INFOPLIST_PREFIX_HEADER = "$(SRCROOT)/libtransmission/version.h";
|
INFOPLIST_PREFIX_HEADER = "$(SRCROOT)/libtransmission/version.h";
|
||||||
|
@ -2545,10 +2547,10 @@
|
||||||
"third-party/curl/lib",
|
"third-party/curl/lib",
|
||||||
"third-party/openssl/lib",
|
"third-party/openssl/lib",
|
||||||
);
|
);
|
||||||
LLVM_LTO = YES;
|
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||||
OTHER_LDFLAGS = "";
|
OTHER_LDFLAGS = "";
|
||||||
PREBINDING = NO;
|
PREBINDING = NO;
|
||||||
|
RUN_CLANG_STATIC_ANALYZER = NO;
|
||||||
SDKROOT = macosx10.6;
|
SDKROOT = macosx10.6;
|
||||||
VALID_ARCHS = "i386 ppc ppc7400 ppc970 x86_64";
|
VALID_ARCHS = "i386 ppc ppc7400 ppc970 x86_64";
|
||||||
};
|
};
|
||||||
|
@ -2637,6 +2639,7 @@
|
||||||
"third-party/openssl/include",
|
"third-party/openssl/include",
|
||||||
);
|
);
|
||||||
IBC_NOTICES = NO;
|
IBC_NOTICES = NO;
|
||||||
|
IBC_WARNINGS = YES;
|
||||||
INFOPLIST_FILE = "$(SRCROOT)/macosx/Info.plist";
|
INFOPLIST_FILE = "$(SRCROOT)/macosx/Info.plist";
|
||||||
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-CC";
|
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-CC";
|
||||||
INFOPLIST_PREFIX_HEADER = "$(SRCROOT)/libtransmission/version.h";
|
INFOPLIST_PREFIX_HEADER = "$(SRCROOT)/libtransmission/version.h";
|
||||||
|
@ -2645,10 +2648,10 @@
|
||||||
"third-party/curl/lib",
|
"third-party/curl/lib",
|
||||||
"third-party/openssl/lib",
|
"third-party/openssl/lib",
|
||||||
);
|
);
|
||||||
LLVM_LTO = YES;
|
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||||
OTHER_LDFLAGS = "";
|
OTHER_LDFLAGS = "";
|
||||||
PREBINDING = NO;
|
PREBINDING = NO;
|
||||||
|
RUN_CLANG_STATIC_ANALYZER = NO;
|
||||||
SDKROOT = macosx10.6;
|
SDKROOT = macosx10.6;
|
||||||
STRIP_INSTALLED_PRODUCT = NO;
|
STRIP_INSTALLED_PRODUCT = NO;
|
||||||
VALID_ARCHS = "i386 ppc ppc7400 ppc970 x86_64";
|
VALID_ARCHS = "i386 ppc ppc7400 ppc970 x86_64";
|
||||||
|
|
|
@ -36,7 +36,6 @@ typedef enum
|
||||||
{
|
{
|
||||||
id fDelegate;
|
id fDelegate;
|
||||||
port_status_t fStatus;
|
port_status_t fStatus;
|
||||||
NSInteger fPortNumber;
|
|
||||||
|
|
||||||
NSURLConnection * fConnection;
|
NSURLConnection * fConnection;
|
||||||
NSMutableData * fPortProbeData;
|
NSMutableData * fPortProbeData;
|
||||||
|
|
|
@ -24,12 +24,12 @@
|
||||||
|
|
||||||
#import "PortChecker.h"
|
#import "PortChecker.h"
|
||||||
|
|
||||||
#define CHECKER_URL @"http://portcheck.transmissionbt.com/%d"
|
#define CHECKER_URL(port) [NSString stringWithFormat: @"http://portcheck.transmissionbt.com/%d", port]
|
||||||
#define CHECK_FIRE 3.0
|
#define CHECK_FIRE 3.0
|
||||||
|
|
||||||
@interface PortChecker (Private)
|
@interface PortChecker (Private)
|
||||||
|
|
||||||
- (void) startProbe;
|
- (void) startProbe: (NSTimer *) timer;
|
||||||
|
|
||||||
- (void) callBackWithStatus: (port_status_t) status;
|
- (void) callBackWithStatus: (port_status_t) status;
|
||||||
|
|
||||||
|
@ -43,14 +43,12 @@
|
||||||
{
|
{
|
||||||
fDelegate = delegate;
|
fDelegate = delegate;
|
||||||
|
|
||||||
fPortNumber = portNumber;
|
|
||||||
fStatus = PORT_STATUS_CHECKING;
|
fStatus = PORT_STATUS_CHECKING;
|
||||||
|
|
||||||
if (delay)
|
fTimer = [NSTimer scheduledTimerWithTimeInterval: CHECK_FIRE target: self selector: @selector(startProbe:)
|
||||||
fTimer = [NSTimer scheduledTimerWithTimeInterval: CHECK_FIRE target: self
|
userInfo: [NSNumber numberWithInteger: portNumber] repeats: NO];
|
||||||
selector: @selector(startProbe) userInfo: nil repeats: NO];
|
if (!delay)
|
||||||
else
|
[fTimer fire];
|
||||||
[self startProbe];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -124,12 +122,11 @@
|
||||||
|
|
||||||
@implementation PortChecker (Private)
|
@implementation PortChecker (Private)
|
||||||
|
|
||||||
- (void) startProbe
|
- (void) startProbe: (NSTimer *) timer
|
||||||
{
|
{
|
||||||
fTimer = nil;
|
fTimer = nil;
|
||||||
|
|
||||||
NSURLRequest * portProbeRequest = [NSURLRequest requestWithURL: [NSURL URLWithString:
|
NSURLRequest * portProbeRequest = [NSURLRequest requestWithURL: [NSURL URLWithString: CHECKER_URL([[timer userInfo] integerValue])]
|
||||||
[NSString stringWithFormat: CHECKER_URL, fPortNumber]]
|
|
||||||
cachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval: 15.0];
|
cachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval: 15.0];
|
||||||
|
|
||||||
if ((fConnection = [[NSURLConnection alloc] initWithRequest: portProbeRequest delegate: self]))
|
if ((fConnection = [[NSURLConnection alloc] initWithRequest: portProbeRequest delegate: self]))
|
||||||
|
|
|
@ -207,7 +207,7 @@ tr_session * fHandle;
|
||||||
|
|
||||||
//set proxy type
|
//set proxy type
|
||||||
[fProxyAddressField setStringValue: [fDefaults stringForKey: @"ProxyAddress"]];
|
[fProxyAddressField setStringValue: [fDefaults stringForKey: @"ProxyAddress"]];
|
||||||
int proxyType;
|
NSInteger proxyType;
|
||||||
switch (tr_sessionGetProxyType(fHandle))
|
switch (tr_sessionGetProxyType(fHandle))
|
||||||
{
|
{
|
||||||
case TR_PROXY_SOCKS4:
|
case TR_PROXY_SOCKS4:
|
||||||
|
@ -218,6 +218,9 @@ tr_session * fHandle;
|
||||||
break;
|
break;
|
||||||
case TR_PROXY_HTTP:
|
case TR_PROXY_HTTP:
|
||||||
proxyType = PROXY_HTTP;
|
proxyType = PROXY_HTTP;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
NSAssert(NO, @"Unknown proxy type received");
|
||||||
}
|
}
|
||||||
[fProxyTypePopUp selectItemAtIndex: proxyType];
|
[fProxyTypePopUp selectItemAtIndex: proxyType];
|
||||||
|
|
||||||
|
@ -815,6 +818,9 @@ tr_session * fHandle;
|
||||||
break;
|
break;
|
||||||
case PROXY_SOCKS5:
|
case PROXY_SOCKS5:
|
||||||
type = @"SOCKS5";
|
type = @"SOCKS5";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
NSAssert1(NO, @"Unknown index %d received for proxy type", [sender indexOfSelectedItem]);
|
||||||
}
|
}
|
||||||
|
|
||||||
[fDefaults setObject: type forKey: @"ProxyType"];
|
[fDefaults setObject: type forKey: @"ProxyType"];
|
||||||
|
|
Loading…
Reference in a new issue