HTTPConnection.h
上传用户:kc0325
上传日期:2020-06-20
资源大小:204k
文件大小:2k
- #import <Foundation/Foundation.h>
- #if TARGET_OS_IPHONE
- // Note: You may need to add the CFNetwork Framework to your project
- #import <CFNetwork/CFNetwork.h>
- #endif
- @class AsyncSocket;
- @class HTTPServer;
- @protocol HTTPResponse;
- #define HTTPConnectionDidDieNotification @"HTTPConnectionDidDie"
- @interface HTTPConnection : NSObject
- {
- AsyncSocket *asyncSocket;
- HTTPServer *server;
-
- CFHTTPMessageRef request;
- int numHeaderLines;
-
- NSString *nonce;
- long lastNC;
-
- NSObject<HTTPResponse> *httpResponse;
-
- NSMutableArray *ranges;
- NSMutableArray *ranges_headers;
- NSString *ranges_boundry;
- int rangeIndex;
-
- UInt64 requestContentLength;
- UInt64 requestContentLengthReceived;
- }
- - (id)initWithAsyncSocket:(AsyncSocket *)newSocket forServer:(HTTPServer *)myServer;
- - (BOOL)supportsMethod:(NSString *)method atPath:(NSString *)path;
- - (BOOL)isSecureServer;
- - (NSArray *)sslIdentityAndCertificates;
- - (BOOL)isPasswordProtected:(NSString *)path;
- - (BOOL)useDigestAccessAuthentication;
- - (NSString *)realm;
- - (NSString *)passwordForUser:(NSString *)username;
- - (NSString *)filePathForURI:(NSString *)path;
- - (NSObject<HTTPResponse> *)httpResponseForMethod:(NSString *)method URI:(NSString *)path;
- - (void)prepareForBodyWithSize:(UInt64)contentLength;
- - (void)processDataChunk:(NSData *)postDataChunk;
- - (void)handleVersionNotSupported:(NSString *)version;
- - (void)handleAuthenticationFailed;
- - (void)handleResourceNotFound;
- - (void)handleInvalidRequest:(NSData *)data;
- - (void)handleUnknownMethod:(NSString *)method;
- - (NSData *)preprocessResponse:(CFHTTPMessageRef)response;
- - (NSData *)preprocessErrorResponse:(CFHTTPMessageRef)response;
- - (void)die;
- @end