HTTPConnection.h.svn-base
上传用户:kc0325
上传日期:2020-06-20
资源大小:204k
文件大小:2k
源码类别:
iPhone
开发平台:
Objective-C
- #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;
- int lastNC;
- NSObject<HTTPResponse> *httpResponse;
- NSMutableArray *ranges;
- NSMutableArray *ranges_headers;
- NSString *ranges_boundry;
- int rangeIndex;
- UInt64 postContentLength;
- UInt64 postTotalBytesReceived;
- int dataStartIndex;
- NSMutableArray* multipartData;
- BOOL postHeaderOK;
- }
- - (id)initWithAsyncSocket:(AsyncSocket *)newSocket forServer:(HTTPServer *)myServer;
- - (BOOL)supportsPOST:(NSString *)path withSize:(UInt64)contentLength;
- - (BOOL)isSecureServer;
- - (NSArray *)sslIdentityAndCertificates;
- - (BOOL)isBrowseable:(NSString *)path;
- - (NSString *) createBrowseableIndex:(NSString *)path;
- - (BOOL)isPasswordProtected:(NSString *)path;
- - (BOOL)useDigestAccessAuthentication;
- - (NSString *)realm;
- - (NSString *)passwordForUser:(NSString *)username;
- - (NSString *)filePathForURI:(NSString *)path;
- - (NSObject<HTTPResponse> *)httpResponseForURI:(NSString *)path;
- - (void)processPostDataChunk:(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