洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.5 KiB

9 months ago
  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