@@ -118,29 +118,6 @@ func (pcs *BaiduPCS) RapidUpload(targetPath, contentMD5, sliceMD5, crc32 string,
118
118
}()
119
119
120
120
return pcs .rapidUploadV2 (targetPath , strings .ToLower (contentMD5 ), length )
121
-
122
- //// 尝试全大写
123
- //pcsError = pcs.rapidUpload(targetPath, strings.ToUpper(contentMD5), strings.ToUpper(sliceMD5), crc32, length)
124
- //if pcsError == nil || pcsError.GetRemoteErrCode() != 31079 {
125
- // return
126
- //}
127
- //
128
- //// 尝试全小写
129
- //pcsError = pcs.rapidUpload(targetPath, strings.ToLower(contentMD5), strings.ToLower(sliceMD5), crc32, length)
130
- //if pcsError == nil || pcsError.GetRemoteErrCode() != 31079 {
131
- // return
132
- //}
133
- //
134
- //// 尝试随机大小写
135
- //pcsError = pcs.rapidUpload(targetPath, randomifyMD5(contentMD5), randomifyMD5(sliceMD5), crc32, length)
136
- //if pcsError == nil || pcsError.GetRemoteErrCode() != 31079 {
137
- // return
138
- //}
139
- //
140
- //return
141
-
142
- //// 尝试 xpan 接口
143
- //return pcs.rapidUploadV2(targetPath, strings.ToLower(contentMD5), length)
144
121
}
145
122
146
123
func (pcs * BaiduPCS ) rapidUpload (targetPath , contentMD5 , sliceMD5 , crc32 string , length int64 ) (pcsError pcserror.Error ) {
@@ -159,30 +136,6 @@ func (pcs *BaiduPCS) rapidUploadV2(targetPath, contentMD5 string, length int64)
159
136
}
160
137
defer dataReadCloser .Close ()
161
138
return pcserror .DecodeXPanJSONError (OperationRapidUpload , dataReadCloser )
162
-
163
- //errInfo := pcserror.NewPanErrorInfo(OperationRapidUpload)
164
- //jsonData := uploadCreateJSON{
165
- // PanErrorInfo: errInfo,
166
- //}
167
- //pcsError = pcserror.HandleJSONParse(OperationRapidUpload, dataReadCloser, &jsonData)
168
- //if pcsError != nil {
169
- // return
170
- //}
171
- //fmt.Println(jsonData)
172
- //switch jsonData.ErrNo {
173
- //case 0:
174
- // return
175
- //case 2:
176
- // errInfo.SetRemoteError()
177
- // errInfo.Err = ErrUploadMD5Unknown
178
- // return errInfo
179
- //case -8:
180
- // return nil
181
- //default:
182
- // errInfo.ErrType = pcserror.ErrTypeOthers
183
- // errInfo.Err = fmt.Errorf("errno=%d", jsonData.ErrNo)
184
- // return errInfo
185
- //}
186
139
}
187
140
188
141
// RapidUploadNoCheckDir 秒传文件, 不进行目录检查, 会覆盖掉同名的目录!
0 commit comments