mirror of
https://github.com/transmission/transmission
synced 2025-02-20 21:26:53 +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_NOTICES = NO;
|
||||
IBC_WARNINGS = YES;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/macosx/Info.plist";
|
||||
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-CC";
|
||||
INFOPLIST_PREFIX_HEADER = "$(SRCROOT)/libtransmission/version.h";
|
||||
|
@ -2387,13 +2388,13 @@
|
|||
"third-party/curl/lib",
|
||||
"third-party/openssl/lib",
|
||||
);
|
||||
LLVM_LTO = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_CFLAGS = "$(inherited)";
|
||||
OTHER_LDFLAGS = "";
|
||||
PREBINDING = NO;
|
||||
PRELINK_LIBS = "";
|
||||
RUN_CLANG_STATIC_ANALYZER = NO;
|
||||
SDKROOT = macosx10.6;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
VALID_ARCHS = "i386 ppc ppc7400 ppc970 x86_64";
|
||||
|
@ -2537,6 +2538,7 @@
|
|||
"third-party/openssl/include",
|
||||
);
|
||||
IBC_NOTICES = NO;
|
||||
IBC_WARNINGS = YES;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/macosx/Info.plist";
|
||||
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-CC";
|
||||
INFOPLIST_PREFIX_HEADER = "$(SRCROOT)/libtransmission/version.h";
|
||||
|
@ -2545,10 +2547,10 @@
|
|||
"third-party/curl/lib",
|
||||
"third-party/openssl/lib",
|
||||
);
|
||||
LLVM_LTO = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||
OTHER_LDFLAGS = "";
|
||||
PREBINDING = NO;
|
||||
RUN_CLANG_STATIC_ANALYZER = NO;
|
||||
SDKROOT = macosx10.6;
|
||||
VALID_ARCHS = "i386 ppc ppc7400 ppc970 x86_64";
|
||||
};
|
||||
|
@ -2637,6 +2639,7 @@
|
|||
"third-party/openssl/include",
|
||||
);
|
||||
IBC_NOTICES = NO;
|
||||
IBC_WARNINGS = YES;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/macosx/Info.plist";
|
||||
INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-CC";
|
||||
INFOPLIST_PREFIX_HEADER = "$(SRCROOT)/libtransmission/version.h";
|
||||
|
@ -2645,10 +2648,10 @@
|
|||
"third-party/curl/lib",
|
||||
"third-party/openssl/lib",
|
||||
);
|
||||
LLVM_LTO = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||
OTHER_LDFLAGS = "";
|
||||
PREBINDING = NO;
|
||||
RUN_CLANG_STATIC_ANALYZER = NO;
|
||||
SDKROOT = macosx10.6;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
VALID_ARCHS = "i386 ppc ppc7400 ppc970 x86_64";
|
||||
|
|
|
@ -36,7 +36,6 @@ typedef enum
|
|||
{
|
||||
id fDelegate;
|
||||
port_status_t fStatus;
|
||||
NSInteger fPortNumber;
|
||||
|
||||
NSURLConnection * fConnection;
|
||||
NSMutableData * fPortProbeData;
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
|
||||
#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
|
||||
|
||||
@interface PortChecker (Private)
|
||||
|
||||
- (void) startProbe;
|
||||
- (void) startProbe: (NSTimer *) timer;
|
||||
|
||||
- (void) callBackWithStatus: (port_status_t) status;
|
||||
|
||||
|
@ -43,14 +43,12 @@
|
|||
{
|
||||
fDelegate = delegate;
|
||||
|
||||
fPortNumber = portNumber;
|
||||
fStatus = PORT_STATUS_CHECKING;
|
||||
|
||||
if (delay)
|
||||
fTimer = [NSTimer scheduledTimerWithTimeInterval: CHECK_FIRE target: self
|
||||
selector: @selector(startProbe) userInfo: nil repeats: NO];
|
||||
else
|
||||
[self startProbe];
|
||||
fTimer = [NSTimer scheduledTimerWithTimeInterval: CHECK_FIRE target: self selector: @selector(startProbe:)
|
||||
userInfo: [NSNumber numberWithInteger: portNumber] repeats: NO];
|
||||
if (!delay)
|
||||
[fTimer fire];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -124,12 +122,11 @@
|
|||
|
||||
@implementation PortChecker (Private)
|
||||
|
||||
- (void) startProbe
|
||||
- (void) startProbe: (NSTimer *) timer
|
||||
{
|
||||
fTimer = nil;
|
||||
|
||||
NSURLRequest * portProbeRequest = [NSURLRequest requestWithURL: [NSURL URLWithString:
|
||||
[NSString stringWithFormat: CHECKER_URL, fPortNumber]]
|
||||
NSURLRequest * portProbeRequest = [NSURLRequest requestWithURL: [NSURL URLWithString: CHECKER_URL([[timer userInfo] integerValue])]
|
||||
cachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval: 15.0];
|
||||
|
||||
if ((fConnection = [[NSURLConnection alloc] initWithRequest: portProbeRequest delegate: self]))
|
||||
|
|
|
@ -207,7 +207,7 @@ tr_session * fHandle;
|
|||
|
||||
//set proxy type
|
||||
[fProxyAddressField setStringValue: [fDefaults stringForKey: @"ProxyAddress"]];
|
||||
int proxyType;
|
||||
NSInteger proxyType;
|
||||
switch (tr_sessionGetProxyType(fHandle))
|
||||
{
|
||||
case TR_PROXY_SOCKS4:
|
||||
|
@ -218,6 +218,9 @@ tr_session * fHandle;
|
|||
break;
|
||||
case TR_PROXY_HTTP:
|
||||
proxyType = PROXY_HTTP;
|
||||
break;
|
||||
default:
|
||||
NSAssert(NO, @"Unknown proxy type received");
|
||||
}
|
||||
[fProxyTypePopUp selectItemAtIndex: proxyType];
|
||||
|
||||
|
@ -815,6 +818,9 @@ tr_session * fHandle;
|
|||
break;
|
||||
case PROXY_SOCKS5:
|
||||
type = @"SOCKS5";
|
||||
break;
|
||||
default:
|
||||
NSAssert1(NO, @"Unknown index %d received for proxy type", [sender indexOfSelectedItem]);
|
||||
}
|
||||
|
||||
[fDefaults setObject: type forKey: @"ProxyType"];
|
||||
|
|
Loading…
Reference in a new issue