forked from tcurdt/iProxy
/
HTTPResponseHandler.h
50 lines (43 loc) · 1.29 KB
/
HTTPResponseHandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// HTTPResponseHandler.h
// TextTransfer
//
// Created by Matt Gallagher on 2009/07/13.
// Copyright 2009 Matt Gallagher. All rights reserved.
//
// Permission is given to use this source code file, free of charge, in any
// project, commercial or otherwise, entirely at your risk, with the condition
// that any redistribution (in part or whole) of source code must retain
// this copyright and permission notice. Attribution in compiled projects is
// appreciated but not required.
//
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#import <CFNetwork/CFNetwork.h>
#else
#import <Cocoa/Cocoa.h>
#endif
@class HTTPServer;
@interface HTTPResponseHandler : NSObject
{
CFHTTPMessageRef request;
NSString *requestMethod;
NSDictionary *headerFields;
NSFileHandle *fileHandle;
HTTPServer *server;
NSURL *url;
}
+ (NSUInteger)priority;
+ (void)registerHandler:(Class)handlerClass;
+ (HTTPResponseHandler *)handlerForRequest:(CFHTTPMessageRef)aRequest
fileHandle:(NSFileHandle *)requestFileHandle
server:(HTTPServer *)aServer;
- (id)initWithRequest:(CFHTTPMessageRef)aRequest
method:(NSString *)method
url:(NSURL *)requestURL
headerFields:(NSDictionary *)requestHeaderFields
fileHandle:(NSFileHandle *)requestFileHandle
server:(HTTPServer *)aServer;
- (void)startResponse;
- (void)endResponse;
@end