remove invalid IP rule
This commit is contained in:
1 parent
dcdfbc7394
commit
d2a1add105
4 files changed
+2
-23
No files matched your search
@@ -27,6 +27,5 @@
|
|||||||
- (void) pauseDiscoveryForHost:(TemporaryHost *)host;
|
- (void) pauseDiscoveryForHost:(TemporaryHost *)host;
|
||||||
- (void) resumeDiscoveryForHost:(TemporaryHost *)host;
|
- (void) resumeDiscoveryForHost:(TemporaryHost *)host;
|
||||||
- (void) discoverHost:(NSString*)hostAddress withCallback:(void (^)(TemporaryHost*, NSString*))callback;
|
- (void) discoverHost:(NSString*)hostAddress withCallback:(void (^)(TemporaryHost*, NSString*))callback;
|
||||||
+ (void) setBackdoorHostAddress: (NSString*)address;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -21,8 +21,6 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
|
||||||
static NSString* backdoorHostAddress;
|
|
||||||
|
|
||||||
@implementation DiscoveryManager {
|
@implementation DiscoveryManager {
|
||||||
NSMutableArray* _hostQueue;
|
NSMutableArray* _hostQueue;
|
||||||
NSMutableSet* _pausedHosts;
|
NSMutableSet* _pausedHosts;
|
||||||
@@ -117,11 +115,6 @@ static NSString* backdoorHostAddress;
|
|||||||
//BOOL ret = NO;
|
//BOOL ret = NO;
|
||||||
freeaddrinfo(result);
|
freeaddrinfo(result);
|
||||||
|
|
||||||
NSLog(@"backDoorHostAddress: %@", backdoorHostAddress);
|
|
||||||
if(ret){
|
|
||||||
if([address isEqualToString:backdoorHostAddress]) ret = NO;
|
|
||||||
}
|
|
||||||
backdoorHostAddress = nil;
|
|
||||||
NSLog(@"IP Check, is prohibited: %d", ret);
|
NSLog(@"IP Check, is prohibited: %d", ret);
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
@@ -130,10 +123,6 @@ static NSString* backdoorHostAddress;
|
|||||||
//#endif
|
//#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)setBackdoorHostAddress: (NSString* )address{
|
|
||||||
backdoorHostAddress = address;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (ServerInfoResponse*) getServerInfoResponseForAddress:(NSString*)address {
|
- (ServerInfoResponse*) getServerInfoResponseForAddress:(NSString*)address {
|
||||||
HttpManager* hMan = [[HttpManager alloc] initWithAddress:address httpsPort:0 serverCert:nil];
|
HttpManager* hMan = [[HttpManager alloc] initWithAddress:address httpsPort:0 serverCert:nil];
|
||||||
ServerInfoResponse* serverInfoResponse = [[ServerInfoResponse alloc] init];
|
ServerInfoResponse* serverInfoResponse = [[ServerInfoResponse alloc] init];
|
||||||
|
|||||||
@@ -579,16 +579,7 @@ static NSMutableSet* hostList;
|
|||||||
[alertController addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Cancel"] style:UIAlertActionStyleCancel handler:nil]];
|
[alertController addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Cancel"] style:UIAlertActionStyleCancel handler:nil]];
|
||||||
[alertController addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Ok"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
[alertController addAction:[UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Ok"] style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||||
NSString* hostAddress = [((UITextField*)[[alertController textFields] objectAtIndex:0]).text trim];
|
NSString* hostAddress = [((UITextField*)[[alertController textFields] objectAtIndex:0]).text trim];
|
||||||
|
|
||||||
//handles public IP
|
|
||||||
NSString *publicIpBackdoor = @"-666";
|
|
||||||
if ([hostAddress rangeOfString:publicIpBackdoor].location != NSNotFound) {
|
|
||||||
hostAddress = [hostAddress stringByReplacingOccurrencesOfString:publicIpBackdoor withString:@""];
|
|
||||||
[DiscoveryManager setBackdoorHostAddress:hostAddress];
|
|
||||||
} else {
|
|
||||||
[DiscoveryManager setBackdoorHostAddress:nil];
|
|
||||||
}
|
|
||||||
|
|
||||||
[self showLoadingFrame:^{
|
[self showLoadingFrame:^{
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
|
||||||
[self->_discMan discoverHost:hostAddress withCallback:^(TemporaryHost* host, NSString* error){
|
[self->_discMan discoverHost:hostAddress withCallback:^(TemporaryHost* host, NSString* error){
|
||||||
|
|||||||
@@ -733,7 +733,7 @@ const int FrontViewPositionNone = 0xff;
|
|||||||
// tested on iOS17. this method does not call back on iOS14, runtime orientation limitation not working for iOS14. Probably depends on iOS16 or higher.
|
// tested on iOS17. this method does not call back on iOS14, runtime orientation limitation not working for iOS14. Probably depends on iOS16 or higher.
|
||||||
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
|
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
|
||||||
// Return the supported interface orientations based on the current state
|
// Return the supported interface orientations based on the current state
|
||||||
NSLog(@"supportedInterfaceOrientations called back 666");
|
// NSLog(@"supportedInterfaceOrientations called back 666");
|
||||||
//lock the orientation accordingly after streaming is started
|
//lock the orientation accordingly after streaming is started
|
||||||
DataManager* dataMan = [[DataManager alloc] init];
|
DataManager* dataMan = [[DataManager alloc] init];
|
||||||
Settings *currentSettings = [dataMan retrieveSettings];
|
Settings *currentSettings = [dataMan retrieveSettings];
|
||||||
|
|||||||
Reference in new issue
Block a user