Skip to content

Commit 4a99068

Browse files
committed
change bonjour
1 parent 871a2b7 commit 4a99068

7 files changed

+61
-5
lines changed

Diff for: iLcatraz.xcodeproj/project.pbxproj

+10-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
410844B51AADF62300919A62 /* NSString+EString.m in Sources */ = {isa = PBXBuildFile; fileRef = 410844B41AADF62300919A62 /* NSString+EString.m */; };
1011
4162747C19FC0ACC0040A86D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4162747B19FC0ACC0040A86D /* Cocoa.framework */; };
1112
4162748619FC0ACC0040A86D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4162748419FC0ACC0040A86D /* InfoPlist.strings */; };
1213
4162748819FC0ACC0040A86D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4162748719FC0ACC0040A86D /* main.m */; };
@@ -67,6 +68,8 @@
6768
/* End PBXContainerItemProxy section */
6869

6970
/* Begin PBXFileReference section */
71+
410844B31AADF62300919A62 /* NSString+EString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+EString.h"; sourceTree = "<group>"; };
72+
410844B41AADF62300919A62 /* NSString+EString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+EString.m"; sourceTree = "<group>"; };
7073
4162747819FC0ACC0040A86D /* iLcatraz.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iLcatraz.app; sourceTree = BUILT_PRODUCTS_DIR; };
7174
4162747B19FC0ACC0040A86D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
7275
4162747E19FC0ACC0040A86D /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@@ -239,6 +242,8 @@
239242
4162748219FC0ACC0040A86D /* Supporting Files */,
240243
41C8B42719FD2DEE00C9BD27 /* FileResponse.h */,
241244
41C8B42819FD2DEE00C9BD27 /* FileResponse.m */,
245+
410844B31AADF62300919A62 /* NSString+EString.h */,
246+
410844B41AADF62300919A62 /* NSString+EString.m */,
242247
);
243248
path = iLcatraz;
244249
sourceTree = "<group>";
@@ -530,6 +535,7 @@
530535
41C8B3E319FC0BAA00C9BD27 /* HTTPRedirectResponse.m in Sources */,
531536
41C8B3DE19FC0BAA00C9BD27 /* MultipartMessageHeaderField.m in Sources */,
532537
41C8B40119FC0C0700C9BD27 /* DDTTYLogger.m in Sources */,
538+
410844B51AADF62300919A62 /* NSString+EString.m in Sources */,
533539
4162748819FC0ACC0040A86D /* main.m in Sources */,
534540
41C8B40D19FC0D4C00C9BD27 /* HTTPConnectionIL.m in Sources */,
535541
41C8B3FD19FC0C0700C9BD27 /* DDAbstractDatabaseLogger.m in Sources */,
@@ -638,7 +644,7 @@
638644
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
639645
GCC_WARN_UNUSED_FUNCTION = YES;
640646
GCC_WARN_UNUSED_VARIABLE = YES;
641-
MACOSX_DEPLOYMENT_TARGET = 10.9;
647+
MACOSX_DEPLOYMENT_TARGET = 10.10;
642648
ONLY_ACTIVE_ARCH = YES;
643649
SDKROOT = macosx;
644650
};
@@ -671,7 +677,7 @@
671677
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
672678
GCC_WARN_UNUSED_FUNCTION = YES;
673679
GCC_WARN_UNUSED_VARIABLE = YES;
674-
MACOSX_DEPLOYMENT_TARGET = 10.9;
680+
MACOSX_DEPLOYMENT_TARGET = 10.10;
675681
SDKROOT = macosx;
676682
};
677683
name = Release;
@@ -685,7 +691,7 @@
685691
GCC_PRECOMPILE_PREFIX_HEADER = YES;
686692
GCC_PREFIX_HEADER = "iLcatraz/iLcatraz-Prefix.pch";
687693
INFOPLIST_FILE = "iLcatraz/iLcatraz-Info.plist";
688-
MACOSX_DEPLOYMENT_TARGET = 10.9;
694+
MACOSX_DEPLOYMENT_TARGET = 10.10;
689695
PRODUCT_NAME = "$(TARGET_NAME)";
690696
WRAPPER_EXTENSION = app;
691697
};
@@ -700,7 +706,7 @@
700706
GCC_PRECOMPILE_PREFIX_HEADER = YES;
701707
GCC_PREFIX_HEADER = "iLcatraz/iLcatraz-Prefix.pch";
702708
INFOPLIST_FILE = "iLcatraz/iLcatraz-Info.plist";
703-
MACOSX_DEPLOYMENT_TARGET = 10.9;
709+
MACOSX_DEPLOYMENT_TARGET = 10.10;
704710
PRODUCT_NAME = "$(TARGET_NAME)";
705711
WRAPPER_EXTENSION = app;
706712
};

Diff for: iLcatraz/FileResponse.m

+2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
//
88

99
#import "FileResponse.h"
10+
#import "NSString+EString.h"
1011

1112
@implementation FileResponse
1213
- (id)initWithFilePath:(NSString *)aFilePath andLocation:(NSString*)location forConnection:(HTTPConnection *)aConnection{
1314
self=[super initWithFilePath:aFilePath forConnection:aConnection];
1415
if (self!=NULL){
16+
location = [location urlencode];
1517
headers = [NSDictionary dictionaryWithObjectsAndKeys:location,@"X-iTunes-Location",nil];
1618
};
1719
return self;

Diff for: iLcatraz/HTTPConnectionIL.m

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ + (NSString*) sanitizePID:(NSString*) pid{
125125
/*
126126
/media/playlists/ID/tracks/ID
127127
*/
128+
NSString *trackPath=[service pathForTrackWithID:tid ofPlaysitWithID:pid];
129+
trackLocation=[service locationForTrackPath:trackPath];
128130
ret=[service jsonTrackWithID:tid ofPlaysitWithID:pid];
129131
}else{
130132
/*

Diff for: iLcatraz/NSString+EString.h

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// NSString+EString.h
3+
// iLcatraz
4+
//
5+
// Created by Macmini on 09.03.15.
6+
// Copyright (c) 2015 dsa. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface NSString (EString)
12+
- (NSString *)urlencode;
13+
@end

Diff for: iLcatraz/NSString+EString.m

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//
2+
// NSString+EString.m
3+
// iLcatraz
4+
//
5+
// Created by Macmini on 09.03.15.
6+
// Copyright (c) 2015 dsa. All rights reserved.
7+
//
8+
9+
#import "NSString+EString.h"
10+
11+
@implementation NSString (EString)
12+
- (NSString *)urlencode {
13+
NSMutableString *output = [NSMutableString string];
14+
const unsigned char *source = (const unsigned char *)[self UTF8String];
15+
unsigned long sourceLen = strlen((const char *)source);
16+
for (int i = 0; i < sourceLen; ++i) {
17+
const unsigned char thisChar = source[i];
18+
if (thisChar == ' '){
19+
[output appendString:@"+"];
20+
} else if (thisChar == '.' || thisChar == '-' || thisChar == '_' || thisChar == '~' ||
21+
(thisChar >= 'a' && thisChar <= 'z') ||
22+
(thisChar >= 'A' && thisChar <= 'Z') ||
23+
(thisChar >= '0' && thisChar <= '9')) {
24+
[output appendFormat:@"%c", thisChar];
25+
} else {
26+
[output appendFormat:@"%%%02X", thisChar];
27+
}
28+
}
29+
return output;
30+
}
31+
@end

Diff for: iLcatraz/RESTResponse.m

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#import "RESTResponse.h"
22
#import "HTTPLogging.h"
3+
#import "NSString+EString.h"
34

45
#if ! __has_feature(objc_arc)
56
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
@@ -48,6 +49,7 @@ - (id)initWithJSON:(NSString *)json status:(NSUInteger)aStatus andLocation:(NSSt
4849

4950
offset = 0;
5051
jsonData = [json dataUsingEncoding:NSUTF8StringEncoding];
52+
location = [location urlencode];
5153
headers = [NSDictionary dictionaryWithObjectsAndKeys: @"application/json; charset=utf-8",@"Content-Type",location,@"X-iTunes-Location",nil];
5254
status=aStatus;
5355
}

Diff for: iLcatraz/me_dsa_iLcatrazAppDelegate.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ - (void)startHTTPServer{
6868
[httpServer setConnectionClass:[HTTPConnectionIL class]];
6969

7070

71-
[httpServer setType:@"_http._tcp."];
71+
[httpServer setType:@"_ilcatraz._tcp."];
7272

7373
BOOL randomPort=[[NSUserDefaults standardUserDefaults] boolForKey:@"randomPort"];
7474
if (!randomPort){

0 commit comments

Comments
 (0)