@@ -603,19 +603,20 @@ type Object struct {
603603// MultiUploadOptions is the option of the multiupload,
604604// ThreadPoolSize default is one
605605type MultiUploadOptions struct {
606- OptIni * InitiateMultipartUploadOptions
607- PartSize int64
608- ThreadPoolSize int
609- CheckPoint bool
610- EnableVerification bool
606+ OptIni * InitiateMultipartUploadOptions
607+ PartSize int64
608+ ThreadPoolSize int
609+ CheckPoint bool
610+ DisableChecksum bool
611611}
612612
613613type MultiDownloadOptions struct {
614- Opt * ObjectGetOptions
615- PartSize int64
616- ThreadPoolSize int
617- CheckPoint bool
618- CheckPointFile string
614+ Opt * ObjectGetOptions
615+ PartSize int64
616+ ThreadPoolSize int
617+ CheckPoint bool
618+ CheckPointFile string
619+ DisableChecksum bool
619620}
620621
621622type MultiDownloadCPInfo struct {
@@ -943,7 +944,7 @@ func (s *ObjectService) Upload(ctx context.Context, name string, filepath string
943944 return nil , nil , err
944945 }
945946 // 校验
946- if s .client .Conf .EnableCRC {
947+ if s .client .Conf .EnableCRC && ! opt . DisableChecksum {
947948 fd , err := os .Open (filepath )
948949 if err != nil {
949950 return nil , nil , err
@@ -972,7 +973,7 @@ func (s *ObjectService) Upload(ctx context.Context, name string, filepath string
972973 Key : name ,
973974 ETag : rsp .Header .Get ("ETag" ),
974975 }
975- if rsp != nil && s .client .Conf .EnableCRC {
976+ if rsp != nil && s .client .Conf .EnableCRC && ! opt . DisableChecksum {
976977 scoscrc := rsp .Header .Get ("x-cos-hash-crc64ecma" )
977978 icoscrc , _ := strconv .ParseUint (scoscrc , 10 , 64 )
978979 if icoscrc != localcrc {
@@ -1105,7 +1106,7 @@ func (s *ObjectService) Upload(ctx context.Context, name string, filepath string
11051106 return v , resp , err
11061107 }
11071108
1108- if resp != nil && s .client .Conf .EnableCRC {
1109+ if resp != nil && s .client .Conf .EnableCRC && ! opt . DisableChecksum {
11091110 scoscrc := resp .Header .Get ("x-cos-hash-crc64ecma" )
11101111 icoscrc , _ := strconv .ParseUint (scoscrc , 10 , 64 )
11111112 if icoscrc != localcrc {
@@ -1225,7 +1226,7 @@ func (s *ObjectService) Download(ctx context.Context, name string, filepath stri
12251226 if err != nil {
12261227 return rsp , err
12271228 }
1228- if coscrc != "" && s .client .Conf .EnableCRC {
1229+ if coscrc != "" && s .client .Conf .EnableCRC && ! opt . DisableChecksum {
12291230 icoscrc , _ := strconv .ParseUint (coscrc , 10 , 64 )
12301231 fd , err := os .Open (filepath )
12311232 if err != nil {
@@ -1344,7 +1345,7 @@ func (s *ObjectService) Download(ctx context.Context, name string, filepath stri
13441345 if opt .CheckPoint {
13451346 os .Remove (cpfile )
13461347 }
1347- if coscrc != "" && s .client .Conf .EnableCRC {
1348+ if coscrc != "" && s .client .Conf .EnableCRC && ! opt . DisableChecksum {
13481349 icoscrc , _ := strconv .ParseUint (coscrc , 10 , 64 )
13491350 fd , err := os .Open (filepath )
13501351 if err != nil {
0 commit comments