diff options
author | Marino Faggiana <m.faggiana@twsweb.it> | 2018-11-12 14:09:53 +0300 |
---|---|---|
committer | Marino Faggiana <marinofaggiana@MacBook-Pro-di-Marino.local> | 2018-11-12 14:09:53 +0300 |
commit | 6e2561ed812052af04008c7b7576d8e9f373f701 (patch) | |
tree | b03a531aa20f6e1ee68b02e8863ae3ec60c15f40 /Libraries external | |
parent | 3942ae7fbfbe0d52a4afe1c7dab7e47cfbe6fade (diff) |
update project
Diffstat (limited to 'Libraries external')
22 files changed, 0 insertions, 992 deletions
diff --git a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/HTTPConnection.h b/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/HTTPConnection.h deleted file mode 100755 index 224141cfe..000000000 --- a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/HTTPConnection.h +++ /dev/null @@ -1,119 +0,0 @@ -#import <Foundation/Foundation.h> - -@class GCDAsyncSocket; -@class HTTPMessage; -@class HTTPServer; -@class WebSocket; -@protocol HTTPResponse; - - -#define HTTPConnectionDidDieNotification @"HTTPConnectionDidDie" - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -@interface HTTPConfig : NSObject -{ - HTTPServer __unsafe_unretained *server; - NSString __strong *documentRoot; - dispatch_queue_t queue; -} - -- (id)initWithServer:(HTTPServer *)server documentRoot:(NSString *)documentRoot; -- (id)initWithServer:(HTTPServer *)server documentRoot:(NSString *)documentRoot queue:(dispatch_queue_t)q; - -@property (nonatomic, unsafe_unretained, readonly) HTTPServer *server; -@property (nonatomic, strong, readonly) NSString *documentRoot; -@property (nonatomic, readonly) dispatch_queue_t queue; - -@end - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -@interface HTTPConnection : NSObject -{ - dispatch_queue_t connectionQueue; - GCDAsyncSocket *asyncSocket; - HTTPConfig *config; - - BOOL started; - - HTTPMessage *request; - unsigned int numHeaderLines; - - BOOL sentResponseHeaders; - - NSString *nonce; - long lastNC; - - NSObject<HTTPResponse> *httpResponse; - - NSMutableArray *ranges; - NSMutableArray *ranges_headers; - NSString *ranges_boundry; - int rangeIndex; - - UInt64 requestContentLength; - UInt64 requestContentLengthReceived; - UInt64 requestChunkSize; - UInt64 requestChunkSizeReceived; - - NSMutableArray *responseDataSizes; -} - -- (id)initWithAsyncSocket:(GCDAsyncSocket *)newSocket configuration:(HTTPConfig *)aConfig; - -- (void)start; -- (void)stop; - -- (void)startConnection; - -- (BOOL)supportsMethod:(NSString *)method atPath:(NSString *)path; -- (BOOL)expectsRequestBodyFromMethod:(NSString *)method atPath:(NSString *)path; - -- (BOOL)isSecureServer; -- (NSArray *)sslIdentityAndCertificates; - -- (BOOL)isPasswordProtected:(NSString *)path; -- (BOOL)useDigestAccessAuthentication; -- (NSString *)realm; -- (NSString *)passwordForUser:(NSString *)username; - -- (NSDictionary *)parseParams:(NSString *)query; -- (NSDictionary *)parseGetParams; - -- (NSString *)requestURI; - -- (NSArray *)directoryIndexFileNames; -- (NSString *)filePathForURI:(NSString *)path; -- (NSString *)filePathForURI:(NSString *)path allowDirectory:(BOOL)allowDirectory; -- (NSObject<HTTPResponse> *)httpResponseForMethod:(NSString *)method URI:(NSString *)path; -- (WebSocket *)webSocketForURI:(NSString *)path; - -- (void)prepareForBodyWithSize:(UInt64)contentLength; -- (void)processBodyData:(NSData *)postDataChunk; -- (void)finishBody; - -- (void)handleVersionNotSupported:(NSString *)version; -- (void)handleAuthenticationFailed; -- (void)handleResourceNotFound; -- (void)handleInvalidRequest:(NSData *)data; -- (void)handleUnknownMethod:(NSString *)method; - -- (NSData *)preprocessResponse:(HTTPMessage *)response; -- (NSData *)preprocessErrorResponse:(HTTPMessage *)response; - -- (void)finishResponse; - -- (BOOL)shouldDie; -- (void)die; - -@end - -@interface HTTPConnection (AsynchronousHTTPResponse) -- (void)responseHasAvailableData:(NSObject<HTTPResponse> *)sender; -- (void)responseDidAbort:(NSObject<HTTPResponse> *)sender; -@end diff --git a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/HTTPMessage.h b/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/HTTPMessage.h deleted file mode 100755 index 20ea921c3..000000000 --- a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/HTTPMessage.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * The HTTPMessage class is a simple Objective-C wrapper around Apple's CFHTTPMessage class. -**/ - -#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 - -#define HTTPVersion1_0 ((NSString *)kCFHTTPVersion1_0) -#define HTTPVersion1_1 ((NSString *)kCFHTTPVersion1_1) - - -@interface HTTPMessage : NSObject -{ - CFHTTPMessageRef message; -} - -- (id)initEmptyRequest; - -- (id)initRequestWithMethod:(NSString *)method URL:(NSURL *)url version:(NSString *)version; - -- (id)initResponseWithStatusCode:(NSInteger)code description:(NSString *)description version:(NSString *)version; - -- (BOOL)appendData:(NSData *)data; - -- (BOOL)isHeaderComplete; - -- (NSString *)version; - -- (NSString *)method; -- (NSURL *)url; - -- (NSInteger)statusCode; - -- (NSDictionary *)allHeaderFields; -- (NSString *)headerField:(NSString *)headerField; - -- (void)setHeaderField:(NSString *)headerField value:(NSString *)headerFieldValue; - -- (NSData *)messageData; - -- (NSData *)body; -- (void)setBody:(NSData *)body; - -@end diff --git a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/HTTPResponse.h b/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/HTTPResponse.h deleted file mode 100755 index f303cf30b..000000000 --- a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/HTTPResponse.h +++ /dev/null @@ -1,149 +0,0 @@ -#import <Foundation/Foundation.h> - - -@protocol HTTPResponse - -/** - * Returns the length of the data in bytes. - * If you don't know the length in advance, implement the isChunked method and have it return YES. -**/ -- (UInt64)contentLength; - -/** - * The HTTP server supports range requests in order to allow things like - * file download resumption and optimized streaming on mobile devices. -**/ -- (UInt64)offset; -- (void)setOffset:(UInt64)offset; - -/** - * Returns the data for the response. - * You do not have to return data of the exact length that is given. - * You may optionally return data of a lesser length. - * However, you must never return data of a greater length than requested. - * Doing so could disrupt proper support for range requests. - * - * To support asynchronous responses, read the discussion at the bottom of this header. -**/ -- (NSData *)readDataOfLength:(NSUInteger)length; - -/** - * Should only return YES after the HTTPConnection has read all available data. - * That is, all data for the response has been returned to the HTTPConnection via the readDataOfLength method. -**/ -- (BOOL)isDone; - -@optional - -/** - * If you need time to calculate any part of the HTTP response headers (status code or header fields), - * this method allows you to delay sending the headers so that you may asynchronously execute the calculations. - * Simply implement this method and return YES until you have everything you need concerning the headers. - * - * This method ties into the asynchronous response architecture of the HTTPConnection. - * You should read the full discussion at the bottom of this header. - * - * If you return YES from this method, - * the HTTPConnection will wait for you to invoke the responseHasAvailableData method. - * After you do, the HTTPConnection will again invoke this method to see if the response is ready to send the headers. - * - * You should only delay sending the headers until you have everything you need concerning just the headers. - * Asynchronously generating the body of the response is not an excuse to delay sending the headers. - * Instead you should tie into the asynchronous response architecture, and use techniques such as the isChunked method. - * - * Important: You should read the discussion at the bottom of this header. -**/ -- (BOOL)delayResponseHeaders; - -/** - * Status code for response. - * Allows for responses such as redirect (301), etc. -**/ -- (NSInteger)status; - -/** - * If you want to add any extra HTTP headers to the response, - * simply return them in a dictionary in this method. -**/ -- (NSDictionary *)httpHeaders; - -/** - * If you don't know the content-length in advance, - * implement this method in your custom response class and return YES. - * - * Important: You should read the discussion at the bottom of this header. -**/ -- (BOOL)isChunked; - -/** - * This method is called from the HTTPConnection class when the connection is closed, - * or when the connection is finished with the response. - * If your response is asynchronous, you should implement this method so you know not to - * invoke any methods on the HTTPConnection after this method is called (as the connection may be deallocated). -**/ -- (void)connectionDidClose; - -@end - - -/** - * Important notice to those implementing custom asynchronous and/or chunked responses: - * - * HTTPConnection supports asynchronous responses. All you have to do in your custom response class is - * asynchronously generate the response, and invoke HTTPConnection's responseHasAvailableData method. - * You don't have to wait until you have all of the response ready to invoke this method. For example, if you - * generate the response in incremental chunks, you could call responseHasAvailableData after generating - * each chunk. Please see the HTTPAsyncFileResponse class for an example of how to do this. - * - * The normal flow of events for an HTTPConnection while responding to a request is like this: - * - Send http resopnse headers - * - Get data from response via readDataOfLength method. - * - Add data to asyncSocket's write queue. - * - Wait for asyncSocket to notify it that the data has been sent. - * - Get more data from response via readDataOfLength method. - * - ... continue this cycle until the entire response has been sent. - * - * With an asynchronous response, the flow is a little different. - * - * First the HTTPResponse is given the opportunity to postpone sending the HTTP response headers. - * This allows the response to asynchronously execute any code needed to calculate a part of the header. - * An example might be the response needs to generate some custom header fields, - * or perhaps the response needs to look for a resource on network-attached storage. - * Since the network-attached storage may be slow, the response doesn't know whether to send a 200 or 404 yet. - * In situations such as this, the HTTPResponse simply implements the delayResponseHeaders method and returns YES. - * After returning YES from this method, the HTTPConnection will wait until the response invokes its - * responseHasAvailableData method. After this occurs, the HTTPConnection will again query the delayResponseHeaders - * method to see if the response is ready to send the headers. - * This cycle will continue until the delayResponseHeaders method returns NO. - * - * You should only delay sending the response headers until you have everything you need concerning just the headers. - * Asynchronously generating the body of the response is not an excuse to delay sending the headers. - * - * After the response headers have been sent, the HTTPConnection calls your readDataOfLength method. - * You may or may not have any available data at this point. If you don't, then simply return nil. - * You should later invoke HTTPConnection's responseHasAvailableData when you have data to send. - * - * You don't have to keep track of when you return nil in the readDataOfLength method, or how many times you've invoked - * responseHasAvailableData. Just simply call responseHasAvailableData whenever you've generated new data, and - * return nil in your readDataOfLength whenever you don't have any available data in the requested range. - * HTTPConnection will automatically detect when it should be requesting new data and will act appropriately. - * - * It's important that you also keep in mind that the HTTP server supports range requests. - * The setOffset method is mandatory, and should not be ignored. - * Make sure you take into account the offset within the readDataOfLength method. - * You should also be aware that the HTTPConnection automatically sorts any range requests. - * So if your setOffset method is called with a value of 100, then you can safely release bytes 0-99. - * - * HTTPConnection can also help you keep your memory footprint small. - * Imagine you're dynamically generating a 10 MB response. You probably don't want to load all this data into - * RAM, and sit around waiting for HTTPConnection to slowly send it out over the network. All you need to do - * is pay attention to when HTTPConnection requests more data via readDataOfLength. This is because HTTPConnection - * will never allow asyncSocket's write queue to get much bigger than READ_CHUNKSIZE bytes. You should - * consider how you might be able to take advantage of this fact to generate your asynchronous response on demand, - * while at the same time keeping your memory footprint small, and your application lightning fast. - * - * If you don't know the content-length in advanced, you should also implement the isChunked method. - * This means the response will not include a Content-Length header, and will instead use "Transfer-Encoding: chunked". - * There's a good chance that if your response is asynchronous and dynamic, it's also chunked. - * If your response is chunked, you don't need to worry about range requests. -**/ diff --git a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/HTTPServer.h b/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/HTTPServer.h deleted file mode 100755 index 1d37cb697..000000000 --- a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/HTTPServer.h +++ /dev/null @@ -1,205 +0,0 @@ -#import <Foundation/Foundation.h> - -@class GCDAsyncSocket; -@class WebSocket; - -#if TARGET_OS_IPHONE - #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 // iPhone 4.0 - #define IMPLEMENTED_PROTOCOLS <NSNetServiceDelegate> - #else - #define IMPLEMENTED_PROTOCOLS - #endif -#else - #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 // Mac OS X 10.6 - #define IMPLEMENTED_PROTOCOLS <NSNetServiceDelegate> - #else - #define IMPLEMENTED_PROTOCOLS - #endif -#endif - - -@interface HTTPServer : NSObject IMPLEMENTED_PROTOCOLS -{ - // Underlying asynchronous TCP/IP socket - GCDAsyncSocket *asyncSocket; - - // Dispatch queues - dispatch_queue_t serverQueue; - dispatch_queue_t connectionQueue; - void *IsOnServerQueueKey; - void *IsOnConnectionQueueKey; - - // HTTP server configuration - NSString *documentRoot; - Class connectionClass; - NSString *interface; - UInt16 port; - - // NSNetService and related variables - NSNetService *netService; - NSString *domain; - NSString *type; - NSString *name; - NSString *publishedName; - NSDictionary *txtRecordDictionary; - - // Connection management - NSMutableArray *connections; - NSMutableArray *webSockets; - NSLock *connectionsLock; - NSLock *webSocketsLock; - - BOOL isRunning; -} - -/** - * Specifies the document root to serve files from. - * For example, if you set this to "/Users/<your_username>/Sites", - * then it will serve files out of the local Sites directory (including subdirectories). - * - * The default value is nil. - * The default server configuration will not serve any files until this is set. - * - * If you change the documentRoot while the server is running, - * the change will affect future incoming http connections. -**/ -- (NSString *)documentRoot; -- (void)setDocumentRoot:(NSString *)value; - -/** - * The connection class is the class used to handle incoming HTTP connections. - * - * The default value is [HTTPConnection class]. - * You can override HTTPConnection, and then set this to [MyHTTPConnection class]. - * - * If you change the connectionClass while the server is running, - * the change will affect future incoming http connections. -**/ -- (Class)connectionClass; -- (void)setConnectionClass:(Class)value; - -/** - * Set what interface you'd like the server to listen on. - * By default this is nil, which causes the server to listen on all available interfaces like en1, wifi etc. - * - * The interface may be specified by name (e.g. "en1" or "lo0") or by IP address (e.g. "192.168.4.34"). - * You may also use the special strings "localhost" or "loopback" to specify that - * the socket only accept connections from the local machine. -**/ -- (NSString *)interface; -- (void)setInterface:(NSString *)value; - -/** - * The port number to run the HTTP server on. - * - * The default port number is zero, meaning the server will automatically use any available port. - * This is the recommended port value, as it avoids possible port conflicts with other applications. - * Technologies such as Bonjour can be used to allow other applications to automatically discover the port number. - * - * Note: As is common on most OS's, you need root privledges to bind to port numbers below 1024. - * - * You can change the port property while the server is running, but it won't affect the running server. - * To actually change the port the server is listening for connections on you'll need to restart the server. - * - * The listeningPort method will always return the port number the running server is listening for connections on. - * If the server is not running this method returns 0. -**/ -- (UInt16)port; -- (UInt16)listeningPort; -- (void)setPort:(UInt16)value; - -/** - * Bonjour domain for publishing the service. - * The default value is "local.". - * - * Note: Bonjour publishing requires you set a type. - * - * If you change the domain property after the bonjour service has already been published (server already started), - * you'll need to invoke the republishBonjour method to update the broadcasted bonjour service. -**/ -- (NSString *)domain; -- (void)setDomain:(NSString *)value; - -/** - * Bonjour name for publishing the service. - * The default value is "". - * - * If using an empty string ("") for the service name when registering, - * the system will automatically use the "Computer Name". - * Using an empty string will also handle name conflicts - * by automatically appending a digit to the end of the name. - * - * Note: Bonjour publishing requires you set a type. - * - * If you change the name after the bonjour service has already been published (server already started), - * you'll need to invoke the republishBonjour method to update the broadcasted bonjour service. - * - * The publishedName method will always return the actual name that was published via the bonjour service. - * If the service is not running this method returns nil. -**/ -- (NSString *)name; -- (NSString *)publishedName; -- (void)setName:(NSString *)value; - -/** - * Bonjour type for publishing the service. - * The default value is nil. - * The service will not be published via bonjour unless the type is set. - * - * If you wish to publish the service as a traditional HTTP server, you should set the type to be "_http._tcp.". - * - * If you change the type after the bonjour service has already been published (server already started), - * you'll need to invoke the republishBonjour method to update the broadcasted bonjour service. -**/ -- (NSString *)type; -- (void)setType:(NSString *)value; - -/** - * Republishes the service via bonjour if the server is running. - * If the service was not previously published, this method will publish it (if the server is running). -**/ -- (void)republishBonjour; - -/** - * -**/ -- (NSDictionary *)TXTRecordDictionary; -- (void)setTXTRecordDictionary:(NSDictionary *)dict; - -/** - * Attempts to starts the server on the configured port, interface, etc. - * - * If an error occurs, this method returns NO and sets the errPtr (if given). - * Otherwise returns YES on success. - * - * Some examples of errors that might occur: - * - You specified the server listen on a port which is already in use by another application. - * - You specified the server listen on a port number below 1024, which requires root priviledges. - * - * Code Example: - * - * NSError *err = nil; - * if (![httpServer start:&err]) - * { - * NSLog(@"Error starting http server: %@", err); - * } -**/ -- (BOOL)start:(NSError **)errPtr; - -/** - * Stops the server, preventing it from accepting any new connections. - * You may specify whether or not you want to close the existing client connections. - * - * The default stop method (with no arguments) will close any existing connections. (It invokes [self stop:NO]) -**/ -- (void)stop; -- (void)stop:(BOOL)keepExistingConnections; - -- (BOOL)isRunning; - -- (void)addWebSocket:(WebSocket *)ws; - -- (NSUInteger)numberOfHTTPConnections; -- (NSUInteger)numberOfWebSocketConnections; - -@end diff --git a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/KTVCocoaHTTPServer.h b/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/KTVCocoaHTTPServer.h deleted file mode 100644 index b0db8f4c4..000000000 --- a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Headers/KTVCocoaHTTPServer.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// KTVCocoaHTTPServer.h -// KTVCocoaHTTPServer -// -// Created by Single on 2017/8/10. -// Copyright © 2017年 Single. All rights reserved. -// - -#import <UIKit/UIKit.h> - -FOUNDATION_EXPORT double KTVCocoaHTTPServerVersionNumber; -FOUNDATION_EXPORT const unsigned char KTVCocoaHTTPServerVersionString[]; - -#import <KTVCocoaHTTPServer/HTTPServer.h> -#import <KTVCocoaHTTPServer/HTTPConnection.h> -#import <KTVCocoaHTTPServer/HTTPMessage.h> -#import <KTVCocoaHTTPServer/HTTPResponse.h> diff --git a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Info.plist b/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Info.plist Binary files differdeleted file mode 100644 index c9f300f8f..000000000 --- a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Info.plist +++ /dev/null diff --git a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/KTVCocoaHTTPServer b/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/KTVCocoaHTTPServer Binary files differdeleted file mode 100755 index f3d79cd67..000000000 --- a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/KTVCocoaHTTPServer +++ /dev/null diff --git a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Modules/module.modulemap b/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Modules/module.modulemap deleted file mode 100644 index 74b487879..000000000 --- a/Libraries external/KTVHTTPCache/KTVCocoaHTTPServer.framework/Modules/module.modulemap +++ /dev/null @@ -1,5 +0,0 @@ -framework module KTVCocoaHTTPServer { - umbrella header "KTVCocoaHTTPServer.h" - export * - module * { export * } -} diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCCommon.h b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCCommon.h deleted file mode 100644 index 05cbcbe4f..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCCommon.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// KTVHCCommon.h -// KTVHTTPCache -// -// Created by Single on 2017/8/17. -// Copyright © 2017年 Single. All rights reserved. -// - -#import <Foundation/Foundation.h> - -#if defined(__cplusplus) -#define KTVHTTPCACHE_EXTERN extern "C" -#else -#define KTVHTTPCACHE_EXTERN extern -#endif diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataCacheItem.h b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataCacheItem.h deleted file mode 100644 index ca9bdfa1e..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataCacheItem.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// KTVHCDataCacheItem.h -// KTVHTTPCache -// -// Created by Single on 2017/8/13. -// Copyright © 2017年 Single. All rights reserved. -// - -#import <Foundation/Foundation.h> - -@class KTVHCDataCacheItemZone; - -@interface KTVHCDataCacheItem : NSObject - -+ (instancetype)new NS_UNAVAILABLE; -- (instancetype)init NS_UNAVAILABLE; - -@property (nonatomic, copy, readonly) NSURL * URL; -@property (nonatomic, assign, readonly) long long totalLength; -@property (nonatomic, assign, readonly) long long cacheLength; -@property (nonatomic, assign, readonly) long long vaildLength; -@property (nonatomic, copy, readonly) NSArray <KTVHCDataCacheItemZone *> * zones; - -@end diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataCacheItemZone.h b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataCacheItemZone.h deleted file mode 100644 index b1275c67e..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataCacheItemZone.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// KTVHCDataCacheItemZone.h -// KTVHTTPCache -// -// Created by Single on 2017/8/13. -// Copyright © 2017年 Single. All rights reserved. -// - -#import <Foundation/Foundation.h> - -@interface KTVHCDataCacheItemZone : NSObject - -+ (instancetype)new NS_UNAVAILABLE; -- (instancetype)init NS_UNAVAILABLE; - -@property (nonatomic, assign, readonly) long long offset; -@property (nonatomic, assign, readonly) long long length; - -@end diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataLoader.h b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataLoader.h deleted file mode 100644 index f234acd9c..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataLoader.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// KTVHCDataLoader.h -// KTVHTTPCache -// -// Created by Single on 2018/6/7. -// Copyright © 2018 Single. All rights reserved. -// - -#import <Foundation/Foundation.h> - -@class KTVHCDataLoader; -@class KTVHCDataRequest; -@class KTVHCDataResponse; - -@protocol KTVHCDataLoaderDelegate <NSObject> - -- (void)loaderDidFinished:(KTVHCDataLoader *)loader; -- (void)loader:(KTVHCDataLoader *)loader didFailed:(NSError *)error; -- (void)loader:(KTVHCDataLoader *)loader didChangeProgress:(double)progress; - -@end - -@interface KTVHCDataLoader : NSObject - -+ (instancetype)new NS_UNAVAILABLE; -- (instancetype)init NS_UNAVAILABLE; - -+ (instancetype)loaderWithRequest:(KTVHCDataRequest *)request; - -@property (nonatomic, weak) id <KTVHCDataLoaderDelegate> delegate; - -@property (nonatomic, strong) id object; - -@property (nonatomic, strong, readonly) KTVHCDataRequest * request; -@property (nonatomic, strong, readonly) KTVHCDataResponse * response; - -@property (nonatomic, strong, readonly) NSError * error; - -@property (nonatomic, assign, readonly) BOOL didClosed; -@property (nonatomic, assign, readonly) BOOL didFinished; - -@property (nonatomic, assign, readonly) double progress; - -- (void)prepare; -- (void)close; - -@end diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataReader.h b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataReader.h deleted file mode 100644 index 6919a74ae..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataReader.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// KTVHCDataReader.h -// KTVHTTPCache -// -// Created by Single on 2017/8/11. -// Copyright © 2017年 Single. All rights reserved. -// - -#import <Foundation/Foundation.h> - -@class KTVHCDataReader; -@class KTVHCDataRequest; -@class KTVHCDataResponse; - -@protocol KTVHCDataReaderDelegate <NSObject> - -- (void)readerDidPrepared:(KTVHCDataReader *)reader; -- (void)readerHasAvailableData:(KTVHCDataReader *)reader; -- (void)reader:(KTVHCDataReader *)reader didFailed:(NSError *)error; - -@end - -@interface KTVHCDataReader : NSObject <NSLocking> - -+ (instancetype)new NS_UNAVAILABLE; -- (instancetype)init NS_UNAVAILABLE; - -+ (instancetype)readerWithRequest:(KTVHCDataRequest *)request; - -@property (nonatomic, weak) id <KTVHCDataReaderDelegate> delegate; - -@property (nonatomic, strong) id object; - -@property (nonatomic, strong, readonly) KTVHCDataRequest * request; -@property (nonatomic, strong, readonly) KTVHCDataResponse * response; - -@property (nonatomic, strong, readonly) NSError * error; - -@property (nonatomic, assign, readonly) BOOL didClosed; -@property (nonatomic, assign, readonly) BOOL didPrepared; -@property (nonatomic, assign, readonly) BOOL didFinished; - -@property (nonatomic, assign, readonly) long long readOffset; - -- (void)prepare; -- (void)close; - -- (NSData *)readDataOfLength:(NSUInteger)length; - -@end diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataRequest.h b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataRequest.h deleted file mode 100644 index 257bffbc3..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataRequest.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// KTVHCDataRequest.h -// KTVHTTPCache -// -// Created by Single on 2017/8/11. -// Copyright © 2017年 Single. All rights reserved. -// - -#import <Foundation/Foundation.h> -#import "KTVHCRange.h" - -@interface KTVHCDataRequest : NSObject - -+ (instancetype)new NS_UNAVAILABLE; -- (instancetype)init NS_UNAVAILABLE; - -- (instancetype)initWithURL:(NSURL *)URL headers:(NSDictionary *)headers; - -@property (nonatomic, copy, readonly) NSURL * URL; -@property (nonatomic, copy, readonly) NSDictionary * headers; -@property (nonatomic, assign, readonly) KTVHCRange range; - -- (KTVHCDataRequest *)requestWithRange:(KTVHCRange)range; -- (KTVHCDataRequest *)requestWithTotalLength:(long long)totalLength; - -@end diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataResponse.h b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataResponse.h deleted file mode 100644 index 78681f235..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCDataResponse.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// KTVHCDataResponse.h -// KTVHTTPCache -// -// Created by Single on 2017/8/24. -// Copyright © 2017年 Single. All rights reserved. -// - -#import <Foundation/Foundation.h> -#import "KTVHCRange.h" - -@interface KTVHCDataResponse : NSObject - -+ (instancetype)new NS_UNAVAILABLE; -- (instancetype)init NS_UNAVAILABLE; - -- (instancetype)initWithURL:(NSURL *)URL headers:(NSDictionary *)headers; - -@property (nonatomic, copy, readonly) NSURL * URL; -@property (nonatomic, copy, readonly) NSDictionary * headers; -@property (nonatomic, copy, readonly) NSDictionary * headersWithoutRangeAndLength; - -@property (nonatomic, copy, readonly) NSString * contentType; -@property (nonatomic, assign, readonly) KTVHCRange range; -@property (nonatomic, assign, readonly) long long totalLength; -@property (nonatomic, assign, readonly) long long currentLength; - -- (KTVHCDataResponse *)responseWithRange:(KTVHCRange)range; - -@end diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCRange.h b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCRange.h deleted file mode 100644 index c282d02b5..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHCRange.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// KTVHCRange.h -// KTVHTTPCache -// -// Created by Single on 2018/5/20. -// Copyright © 2018年 Single. All rights reserved. -// - -#import <Foundation/Foundation.h> - -typedef struct KTVHCRange { - long long start; - long long end; -} KTVHCRange; - -static const long long KTVHCNotFound = LONG_LONG_MAX; - -BOOL KTVHCRangeIsFull(KTVHCRange range); -BOOL KTVHCRangeIsVaild(KTVHCRange range); -BOOL KTVHCRangeIsInvaild(KTVHCRange range); -BOOL KTVHCEqualRanges(KTVHCRange range1, KTVHCRange range2); -long long KTVHCRangeGetLength(KTVHCRange range); -NSString * KTVHCStringFromRange(KTVHCRange range); -NSDictionary * KTVHCRangeFillToRequestHeaders(KTVHCRange range, NSDictionary * headers); -NSDictionary * KTVHCRangeFillToResponseHeaders(KTVHCRange range, NSDictionary * headers, long long totalLength); - -KTVHCRange KTVHCMakeRange(long long start, long long end); -KTVHCRange KTVHCRangeZero(void); -KTVHCRange KTVHCRangeFull(void); -KTVHCRange KTVHCRangeInvaild(void); -KTVHCRange KTVHCRangeWithSeparateValue(NSString * value); -KTVHCRange KTVHCRangeWithRequestHeaderValue(NSString * value); -KTVHCRange KTVHCRangeWithResponseHeaderValue(NSString * value, long long * totalLength); -KTVHCRange KTVHCRangeWithEnsureLength(KTVHCRange range, long long ensureLength); diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHTTPCache.h b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHTTPCache.h deleted file mode 100644 index b3b5bb5e3..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHTTPCache.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// KTVHTTPCache.h -// KTVHTTPCache -// -// Created by Single on 2017/8/10. -// Copyright © 2017年 Single. All rights reserved. -// - -#import <UIKit/UIKit.h> - -FOUNDATION_EXPORT double KTVHTTPCacheVersionNumber; -FOUNDATION_EXPORT const unsigned char KTVHTTPCacheVersionString[]; - -#pragma mark - Interface - -#import <KTVHTTPCache/KTVHTTPCacheImp.h> - -#pragma mark - Data Storage - -#import <KTVHTTPCache/KTVHCDataReader.h> -#import <KTVHTTPCache/KTVHCDataLoader.h> -#import <KTVHTTPCache/KTVHCDataRequest.h> -#import <KTVHTTPCache/KTVHCDataResponse.h> -#import <KTVHTTPCache/KTVHCDataCacheItem.h> -#import <KTVHTTPCache/KTVHCDataCacheItemZone.h> - -#pragma mark - Common - -#import <KTVHTTPCache/KTVHCRange.h> -#import <KTVHTTPCache/KTVHCCommon.h> diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHTTPCacheImp.h b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHTTPCacheImp.h deleted file mode 100644 index 5b1f4cf21..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Headers/KTVHTTPCacheImp.h +++ /dev/null @@ -1,139 +0,0 @@ -// -// KTVHTTPCacheImp.h -// KTVHTTPCache -// -// Created by Single on 2017/8/13. -// Copyright © 2017年 Single. All rights reserved. -// - -#import <Foundation/Foundation.h> - -@class KTVHCDataReader; -@class KTVHCDataLoader; -@class KTVHCDataRequest; -@class KTVHCDataCacheItem; - -@interface KTVHTTPCache : NSObject - -#pragma mark - HTTP Server - -/** - * Start & Stop HTTP Server. - */ -+ (void)proxyStart:(NSError **)error; -+ (void)proxyStop; - -+ (BOOL)proxyIsRunning; - -/** - * Return the URL string for local server. - */ -+ (NSURL *)proxyURLWithOriginalURL:(NSURL *)URL; -+ (NSString *)proxyURLStringWithOriginalURLString:(NSString *)URLString; - -#pragma mark - Data Storage - -/** - * If the content of the URL is finish cached, return the file path for the content. Otherwise return nil. - */ -+ (NSURL *)cacheCompleteFileURLIfExistedWithURL:(NSURL *)URL; -+ (NSString *)cacheCompleteFilePathIfExistedWithURLString:(NSString *)URLString; - -/** - * Data Reader. - */ -+ (KTVHCDataReader *)cacheReaderWithRequest:(KTVHCDataRequest *)request; - -/** - * Data Loader. - */ -+ (KTVHCDataLoader *)cacheLoaderWithRequest:(KTVHCDataRequest *)request; - -/** - * Cache State. - */ -+ (void)cacheSetMaxCacheLength:(long long)maxCacheLength; -+ (long long)cacheMaxCacheLength; -+ (long long)cacheTotalCacheLength; - -/** - * Cache Item. - */ -+ (KTVHCDataCacheItem *)cacheCacheItemWithURL:(NSURL *)URL; -+ (KTVHCDataCacheItem *)cacheCacheItemWithURLString:(NSString *)URLString; -+ (NSArray <KTVHCDataCacheItem *> *)cacheAllCacheItems; - -/** - * Delete Cache. - */ -+ (void)cacheDeleteCacheWithURL:(NSURL *)URL; -+ (void)cacheDeleteCacheWithURLString:(NSString *)URLString; -+ (void)cacheDeleteAllCaches; - -#pragma mark - Token - -/** - * URL Filter. - * - * High frequency call. Make it simple. - */ -+ (void)tokenSetURLFilter:(NSURL * (^)(NSURL * URL))URLFilter; - -#pragma mark - Download - -+ (void)downloadSetTimeoutInterval:(NSTimeInterval)timeoutInterval; -+ (NSTimeInterval)downloadTimeoutInterval; - -/** - * Whitelist Header Fields. - */ -+ (void)downloadSetWhitelistHeaderKeys:(NSArray <NSString *> *)whitelistHeaderKeys; -+ (NSArray <NSString *> *)downloadWhitelistHeaderKeys; - -/** - * Additional Header Fields. - */ -+ (void)downloadSetAdditionalHeaders:(NSDictionary <NSString *, NSString *> *)additionalHeaders; -+ (NSDictionary <NSString *, NSString *> *)downloadAdditionalHeaders; - -/** - * Default values: 'video/x', 'audio/x', 'application/mp4', 'application/octet-stream', 'binary/octet-stream' - */ -+ (void)downloadSetAcceptContentTypes:(NSArray <NSString *> *)acceptContentTypes; -+ (NSArray <NSString *> *)downloadAcceptContentTypes; - -/** - * If the receive response's Content-Type not included in acceptContentTypes, this method will be called. - * The return value of block to decide whether to continue to load resources. Otherwise the HTTP task will be rejected. - */ -+ (void)downloadSetUnsupportContentTypeFilter:(BOOL(^)(NSURL * URL, NSString * contentType))contentTypeFilter; - -#pragma mark - Log - -/** - * Console & Record. - */ -+ (void)logAddLog:(NSString *)log; - -/** - * DEBUG & RELEASE : Default is NO. - */ -+ (void)logSetConsoleLogEnable:(BOOL)consoleLogEnable; -+ (BOOL)logConsoleLogEnable; - -/** - * DEBUG & RELEASE : Default is NO. - */ -+ (void)logSetRecordLogEnable:(BOOL)recordLogEnable; -+ (BOOL)logRecordLogEnable; - -+ (NSString *)logRecordLogFilePath; // nullable -+ (void)logDeleteRecordLog; - -/** - * Error - */ -+ (NSArray <NSError *> *)logAllErrors; -+ (NSError *)logLastError; - -@end diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Info.plist b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Info.plist Binary files differdeleted file mode 100644 index 5bbc38c92..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Info.plist +++ /dev/null diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/KTVHTTPCache b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/KTVHTTPCache Binary files differdeleted file mode 100755 index 14759ee3e..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/KTVHTTPCache +++ /dev/null diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Modules/module.modulemap b/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Modules/module.modulemap deleted file mode 100644 index 85e31e3b9..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.framework/Modules/module.modulemap +++ /dev/null @@ -1,5 +0,0 @@ -framework module KTVHTTPCache { - umbrella header "KTVHTTPCache.h" - export * - module * { export * } -} diff --git a/Libraries external/KTVHTTPCache/KTVHTTPCache.h b/Libraries external/KTVHTTPCache/KTVHTTPCache.h deleted file mode 100644 index b3b5bb5e3..000000000 --- a/Libraries external/KTVHTTPCache/KTVHTTPCache.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// KTVHTTPCache.h -// KTVHTTPCache -// -// Created by Single on 2017/8/10. -// Copyright © 2017年 Single. All rights reserved. -// - -#import <UIKit/UIKit.h> - -FOUNDATION_EXPORT double KTVHTTPCacheVersionNumber; -FOUNDATION_EXPORT const unsigned char KTVHTTPCacheVersionString[]; - -#pragma mark - Interface - -#import <KTVHTTPCache/KTVHTTPCacheImp.h> - -#pragma mark - Data Storage - -#import <KTVHTTPCache/KTVHCDataReader.h> -#import <KTVHTTPCache/KTVHCDataLoader.h> -#import <KTVHTTPCache/KTVHCDataRequest.h> -#import <KTVHTTPCache/KTVHCDataResponse.h> -#import <KTVHTTPCache/KTVHCDataCacheItem.h> -#import <KTVHTTPCache/KTVHCDataCacheItemZone.h> - -#pragma mark - Common - -#import <KTVHTTPCache/KTVHCRange.h> -#import <KTVHTTPCache/KTVHCCommon.h> |