OSSNetworkingRequestDelegate.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // OSSNetworkingRequestDelegate.h
  3. // AliyunOSSSDK
  4. //
  5. // Created by huaixu on 2018/1/22.
  6. // Copyright © 2018年 aliyun. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "OSSConstants.h"
  10. #import "OSSTask.h"
  11. @class OSSAllRequestNeededMessage;
  12. @class OSSURLRequestRetryHandler;
  13. @class OSSHttpResponseParser;
  14. /**
  15. The proxy object class for each OSS request.
  16. */
  17. @interface OSSNetworkingRequestDelegate : NSObject
  18. @property (nonatomic, strong) NSMutableArray * interceptors;
  19. @property (nonatomic, strong) NSMutableURLRequest *internalRequest;
  20. @property (nonatomic, assign) OSSOperationType operType;
  21. @property (nonatomic, assign) BOOL isAccessViaProxy;
  22. @property (nonatomic, assign) BOOL isRequestCancelled;
  23. @property (nonatomic, strong) OSSAllRequestNeededMessage *allNeededMessage;
  24. @property (nonatomic, strong) OSSURLRequestRetryHandler *retryHandler;
  25. @property (nonatomic, strong) OSSHttpResponseParser *responseParser;
  26. @property (nonatomic, strong) NSData * uploadingData;
  27. @property (nonatomic, strong) NSURL * uploadingFileURL;
  28. @property (nonatomic, assign) int64_t payloadTotalBytesWritten;
  29. @property (nonatomic, assign) BOOL isBackgroundUploadFileTask;
  30. @property (nonatomic, assign) BOOL isHttpdnsEnable;
  31. @property (nonatomic, assign) BOOL isPathStyleAccessEnable;
  32. @property (nonatomic, assign) BOOL isCustomPathPrefixEnable;
  33. @property (nonatomic, copy) NSArray * cnameExcludeList;
  34. @property (nonatomic, assign) uint32_t currentRetryCount;
  35. @property (nonatomic, strong) NSError * error;
  36. @property (nonatomic, assign) BOOL isHttpRequestNotSuccessResponse;
  37. @property (nonatomic, strong) NSMutableData *httpRequestNotSuccessResponseBody;
  38. @property (atomic, strong) NSURLSessionDataTask *currentSessionTask;
  39. @property (nonatomic, copy) OSSNetworkingUploadProgressBlock uploadProgress;
  40. @property (nonatomic, copy) OSSNetworkingDownloadProgressBlock downloadProgress;
  41. @property (nonatomic, copy) OSSNetworkingRetryBlock retryCallback;
  42. @property (nonatomic, copy) OSSNetworkingCompletionHandlerBlock completionHandler;
  43. @property (nonatomic, copy) OSSNetworkingOnRecieveDataBlock onRecieveData;
  44. /**
  45. * when put object to server,client caculate crc64 code and assigns it to
  46. * this property.
  47. */
  48. @property (nonatomic, copy) NSString *contentCRC;
  49. /** last crc64 code */
  50. @property (nonatomic, copy) NSString *lastCRC;
  51. /**
  52. * determine whether to verify crc64 code
  53. */
  54. @property (nonatomic, assign) BOOL crc64Verifiable;
  55. - (OSSTask *)buildInternalHttpRequest;
  56. - (void)reset;
  57. - (void)cancel;
  58. @end