Skip to content

Commit d20fe1a

Browse files
committed
first commit
0 parents  commit d20fe1a

File tree

7 files changed

+521
-0
lines changed

7 files changed

+521
-0
lines changed

HTTPTest.xcodeproj/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
project.xcworkspace
2+
xcuserdata

HTTPTest.xcodeproj/project.pbxproj

+253
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 46;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
F892E99B1A0D0FD6008C4209 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F892E99A1A0D0FD6008C4209 /* main.m */; };
11+
F892E9A31A0D1005008C4209 /* HTTPInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = F892E9A21A0D1005008C4209 /* HTTPInputStream.m */; };
12+
F892E9A61A0D13D1008C4209 /* HTTPTest.m in Sources */ = {isa = PBXBuildFile; fileRef = F892E9A51A0D13D1008C4209 /* HTTPTest.m */; };
13+
/* End PBXBuildFile section */
14+
15+
/* Begin PBXCopyFilesBuildPhase section */
16+
F892E9951A0D0FD6008C4209 /* CopyFiles */ = {
17+
isa = PBXCopyFilesBuildPhase;
18+
buildActionMask = 2147483647;
19+
dstPath = /usr/share/man/man1/;
20+
dstSubfolderSpec = 0;
21+
files = (
22+
);
23+
runOnlyForDeploymentPostprocessing = 1;
24+
};
25+
/* End PBXCopyFilesBuildPhase section */
26+
27+
/* Begin PBXFileReference section */
28+
F892E9971A0D0FD6008C4209 /* HTTPTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = HTTPTest; sourceTree = BUILT_PRODUCTS_DIR; };
29+
F892E99A1A0D0FD6008C4209 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
30+
F892E9A11A0D1005008C4209 /* HTTPInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPInputStream.h; sourceTree = "<group>"; };
31+
F892E9A21A0D1005008C4209 /* HTTPInputStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPInputStream.m; sourceTree = "<group>"; };
32+
F892E9A41A0D13D1008C4209 /* HTTPTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPTest.h; sourceTree = "<group>"; };
33+
F892E9A51A0D13D1008C4209 /* HTTPTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPTest.m; sourceTree = "<group>"; };
34+
/* End PBXFileReference section */
35+
36+
/* Begin PBXFrameworksBuildPhase section */
37+
F892E9941A0D0FD6008C4209 /* Frameworks */ = {
38+
isa = PBXFrameworksBuildPhase;
39+
buildActionMask = 2147483647;
40+
files = (
41+
);
42+
runOnlyForDeploymentPostprocessing = 0;
43+
};
44+
/* End PBXFrameworksBuildPhase section */
45+
46+
/* Begin PBXGroup section */
47+
F892E98E1A0D0FD6008C4209 = {
48+
isa = PBXGroup;
49+
children = (
50+
F892E9991A0D0FD6008C4209 /* HTTPTest */,
51+
F892E9981A0D0FD6008C4209 /* Products */,
52+
);
53+
sourceTree = "<group>";
54+
};
55+
F892E9981A0D0FD6008C4209 /* Products */ = {
56+
isa = PBXGroup;
57+
children = (
58+
F892E9971A0D0FD6008C4209 /* HTTPTest */,
59+
);
60+
name = Products;
61+
sourceTree = "<group>";
62+
};
63+
F892E9991A0D0FD6008C4209 /* HTTPTest */ = {
64+
isa = PBXGroup;
65+
children = (
66+
F892E9A11A0D1005008C4209 /* HTTPInputStream.h */,
67+
F892E9A21A0D1005008C4209 /* HTTPInputStream.m */,
68+
F892E99A1A0D0FD6008C4209 /* main.m */,
69+
F892E9A41A0D13D1008C4209 /* HTTPTest.h */,
70+
F892E9A51A0D13D1008C4209 /* HTTPTest.m */,
71+
);
72+
path = HTTPTest;
73+
sourceTree = "<group>";
74+
};
75+
/* End PBXGroup section */
76+
77+
/* Begin PBXNativeTarget section */
78+
F892E9961A0D0FD6008C4209 /* HTTPTest */ = {
79+
isa = PBXNativeTarget;
80+
buildConfigurationList = F892E99E1A0D0FD6008C4209 /* Build configuration list for PBXNativeTarget "HTTPTest" */;
81+
buildPhases = (
82+
F892E9931A0D0FD6008C4209 /* Sources */,
83+
F892E9941A0D0FD6008C4209 /* Frameworks */,
84+
F892E9951A0D0FD6008C4209 /* CopyFiles */,
85+
);
86+
buildRules = (
87+
);
88+
dependencies = (
89+
);
90+
name = HTTPTest;
91+
productName = HTTPTest;
92+
productReference = F892E9971A0D0FD6008C4209 /* HTTPTest */;
93+
productType = "com.apple.product-type.tool";
94+
};
95+
/* End PBXNativeTarget section */
96+
97+
/* Begin PBXProject section */
98+
F892E98F1A0D0FD6008C4209 /* Project object */ = {
99+
isa = PBXProject;
100+
attributes = {
101+
LastUpgradeCheck = 0610;
102+
ORGANIZATIONNAME = "Stefan Reitshamer";
103+
TargetAttributes = {
104+
F892E9961A0D0FD6008C4209 = {
105+
CreatedOnToolsVersion = 6.1;
106+
};
107+
};
108+
};
109+
buildConfigurationList = F892E9921A0D0FD6008C4209 /* Build configuration list for PBXProject "HTTPTest" */;
110+
compatibilityVersion = "Xcode 3.2";
111+
developmentRegion = English;
112+
hasScannedForEncodings = 0;
113+
knownRegions = (
114+
en,
115+
);
116+
mainGroup = F892E98E1A0D0FD6008C4209;
117+
productRefGroup = F892E9981A0D0FD6008C4209 /* Products */;
118+
projectDirPath = "";
119+
projectRoot = "";
120+
targets = (
121+
F892E9961A0D0FD6008C4209 /* HTTPTest */,
122+
);
123+
};
124+
/* End PBXProject section */
125+
126+
/* Begin PBXSourcesBuildPhase section */
127+
F892E9931A0D0FD6008C4209 /* Sources */ = {
128+
isa = PBXSourcesBuildPhase;
129+
buildActionMask = 2147483647;
130+
files = (
131+
F892E9A61A0D13D1008C4209 /* HTTPTest.m in Sources */,
132+
F892E9A31A0D1005008C4209 /* HTTPInputStream.m in Sources */,
133+
F892E99B1A0D0FD6008C4209 /* main.m in Sources */,
134+
);
135+
runOnlyForDeploymentPostprocessing = 0;
136+
};
137+
/* End PBXSourcesBuildPhase section */
138+
139+
/* Begin XCBuildConfiguration section */
140+
F892E99C1A0D0FD6008C4209 /* Debug */ = {
141+
isa = XCBuildConfiguration;
142+
buildSettings = {
143+
ALWAYS_SEARCH_USER_PATHS = NO;
144+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
145+
CLANG_CXX_LIBRARY = "libc++";
146+
CLANG_ENABLE_MODULES = YES;
147+
CLANG_ENABLE_OBJC_ARC = YES;
148+
CLANG_WARN_BOOL_CONVERSION = YES;
149+
CLANG_WARN_CONSTANT_CONVERSION = YES;
150+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
151+
CLANG_WARN_EMPTY_BODY = YES;
152+
CLANG_WARN_ENUM_CONVERSION = YES;
153+
CLANG_WARN_INT_CONVERSION = YES;
154+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
155+
CLANG_WARN_UNREACHABLE_CODE = YES;
156+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
157+
COPY_PHASE_STRIP = NO;
158+
ENABLE_STRICT_OBJC_MSGSEND = YES;
159+
GCC_C_LANGUAGE_STANDARD = gnu99;
160+
GCC_DYNAMIC_NO_PIC = NO;
161+
GCC_OPTIMIZATION_LEVEL = 0;
162+
GCC_PREPROCESSOR_DEFINITIONS = (
163+
"DEBUG=1",
164+
"$(inherited)",
165+
);
166+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
167+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
168+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
169+
GCC_WARN_UNDECLARED_SELECTOR = YES;
170+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
171+
GCC_WARN_UNUSED_FUNCTION = YES;
172+
GCC_WARN_UNUSED_VARIABLE = YES;
173+
MACOSX_DEPLOYMENT_TARGET = 10.10;
174+
MTL_ENABLE_DEBUG_INFO = YES;
175+
ONLY_ACTIVE_ARCH = YES;
176+
SDKROOT = macosx;
177+
};
178+
name = Debug;
179+
};
180+
F892E99D1A0D0FD6008C4209 /* Release */ = {
181+
isa = XCBuildConfiguration;
182+
buildSettings = {
183+
ALWAYS_SEARCH_USER_PATHS = NO;
184+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
185+
CLANG_CXX_LIBRARY = "libc++";
186+
CLANG_ENABLE_MODULES = YES;
187+
CLANG_ENABLE_OBJC_ARC = YES;
188+
CLANG_WARN_BOOL_CONVERSION = YES;
189+
CLANG_WARN_CONSTANT_CONVERSION = YES;
190+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
191+
CLANG_WARN_EMPTY_BODY = YES;
192+
CLANG_WARN_ENUM_CONVERSION = YES;
193+
CLANG_WARN_INT_CONVERSION = YES;
194+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
195+
CLANG_WARN_UNREACHABLE_CODE = YES;
196+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
197+
COPY_PHASE_STRIP = YES;
198+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
199+
ENABLE_NS_ASSERTIONS = NO;
200+
ENABLE_STRICT_OBJC_MSGSEND = YES;
201+
GCC_C_LANGUAGE_STANDARD = gnu99;
202+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
203+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
204+
GCC_WARN_UNDECLARED_SELECTOR = YES;
205+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
206+
GCC_WARN_UNUSED_FUNCTION = YES;
207+
GCC_WARN_UNUSED_VARIABLE = YES;
208+
MACOSX_DEPLOYMENT_TARGET = 10.10;
209+
MTL_ENABLE_DEBUG_INFO = NO;
210+
SDKROOT = macosx;
211+
};
212+
name = Release;
213+
};
214+
F892E99F1A0D0FD6008C4209 /* Debug */ = {
215+
isa = XCBuildConfiguration;
216+
buildSettings = {
217+
CLANG_ENABLE_OBJC_ARC = NO;
218+
PRODUCT_NAME = "$(TARGET_NAME)";
219+
};
220+
name = Debug;
221+
};
222+
F892E9A01A0D0FD6008C4209 /* Release */ = {
223+
isa = XCBuildConfiguration;
224+
buildSettings = {
225+
CLANG_ENABLE_OBJC_ARC = NO;
226+
PRODUCT_NAME = "$(TARGET_NAME)";
227+
};
228+
name = Release;
229+
};
230+
/* End XCBuildConfiguration section */
231+
232+
/* Begin XCConfigurationList section */
233+
F892E9921A0D0FD6008C4209 /* Build configuration list for PBXProject "HTTPTest" */ = {
234+
isa = XCConfigurationList;
235+
buildConfigurations = (
236+
F892E99C1A0D0FD6008C4209 /* Debug */,
237+
F892E99D1A0D0FD6008C4209 /* Release */,
238+
);
239+
defaultConfigurationIsVisible = 0;
240+
defaultConfigurationName = Release;
241+
};
242+
F892E99E1A0D0FD6008C4209 /* Build configuration list for PBXNativeTarget "HTTPTest" */ = {
243+
isa = XCConfigurationList;
244+
buildConfigurations = (
245+
F892E99F1A0D0FD6008C4209 /* Debug */,
246+
F892E9A01A0D0FD6008C4209 /* Release */,
247+
);
248+
defaultConfigurationIsVisible = 0;
249+
};
250+
/* End XCConfigurationList section */
251+
};
252+
rootObject = F892E98F1A0D0FD6008C4209 /* Project object */;
253+
}

HTTPTest/HTTPInputStream.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// HTTPInputStream.h
3+
//
4+
// Created by Stefan Reitshamer on 3/16/12.
5+
// Copyright 2012 Haystack Software. All rights reserved.
6+
//
7+
8+
#import <Foundation/Foundation.h>
9+
10+
11+
@interface HTTPInputStream : NSObject {
12+
NSData *data;
13+
NSInputStream *inputStream;
14+
}
15+
- (id)initWithData:(NSData *)theData;
16+
@end

HTTPTest/HTTPInputStream.m

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
//
2+
// HTTPInputStream.m
3+
//
4+
// Created by Stefan Reitshamer on 3/16/12.
5+
// Copyright 2012 Haystack Software. All rights reserved.
6+
//
7+
8+
#import "HTTPInputStream.h"
9+
10+
11+
@implementation HTTPInputStream
12+
- (id)initWithData:(NSData *)theData {
13+
if (self = [super init]) {
14+
data = [theData retain];
15+
inputStream = [[NSInputStream inputStreamWithData:theData] retain];
16+
}
17+
NSLog(@"created HTTPInputStream: %p", self);
18+
return self;
19+
}
20+
- (void)dealloc {
21+
NSLog(@"destroying HTTPInputStream: %p", self);
22+
[data release];
23+
[inputStream release];
24+
[super dealloc];
25+
}
26+
27+
- (id)retain {
28+
// HSLogDebug(@"retaining %p; retaincount was %ld; threadname=%@", self, [self retainCount], [NSThread currentThread]);
29+
return [super retain];
30+
}
31+
- (oneway void)release {
32+
// HSLogDebug(@"releasing %p; retaincount was %ld; threadname=%@", self, [self retainCount], [NSThread currentThread]);
33+
[super release];
34+
}
35+
36+
- (NSInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)len {
37+
NSInteger ret = [inputStream read:buffer maxLength:len];
38+
return ret;
39+
}
40+
41+
42+
// Implement most of the NSInputStream methods:
43+
- (void)open {
44+
[inputStream open];
45+
}
46+
- (void)close {
47+
[inputStream close];
48+
}
49+
- (id)delegate {
50+
return [inputStream delegate];
51+
}
52+
- (void)setDelegate:(id)theDelegate {
53+
[inputStream setDelegate:theDelegate];
54+
}
55+
- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode {
56+
[inputStream scheduleInRunLoop:aRunLoop forMode:mode];
57+
}
58+
- (void)removeFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode {
59+
[inputStream removeFromRunLoop:aRunLoop forMode:mode];
60+
}
61+
- (id)propertyForKey:(NSString *)key {
62+
return [inputStream propertyForKey:key];
63+
}
64+
- (BOOL)setProperty:(id)property forKey:(NSString *)key {
65+
return [inputStream setProperty:property forKey:key];
66+
}
67+
- (NSStreamStatus)streamStatus {
68+
return [inputStream streamStatus];
69+
}
70+
- (NSError *)streamError {
71+
return [inputStream streamError];
72+
}
73+
74+
75+
// Forward everything else to the inputStream ivar.
76+
- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector {
77+
return [inputStream methodSignatureForSelector:aSelector];
78+
}
79+
- (void)forwardInvocation:(NSInvocation *)anInvocation {
80+
[anInvocation invokeWithTarget:inputStream];
81+
}
82+
@end

HTTPTest/HTTPTest.h

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// HTTPTest.h
3+
// HTTPTest
4+
//
5+
// Created by Stefan Reitshamer on 11/7/14.
6+
// Copyright (c) 2014 Stefan Reitshamer. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface HTTPTest : NSObject {
12+
NSMutableData *body;
13+
NSString *uuid;
14+
BOOL done;
15+
}
16+
- (void)works;
17+
- (void)doesntWork;
18+
@end

0 commit comments

Comments
 (0)