Skip to content

Commit ee5a1cb

Browse files
author
jeffreykzli
committed
original content mark
1 parent d5853a5 commit ee5a1cb

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/main/java/com/qcloud/cos/http/DefaultCosHttpClient.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -489,17 +489,13 @@ public <X, Y extends CosServiceRequest> X exeute(CosHttpRequest<Y> request,
489489
while (true) {
490490
try {
491491
checkInterrupted();
492-
/**
493-
* 目前sdk所有的上传请求都会把流包装成ReleasableInputStream
494-
* 所以这里不再需要判断BufferedInputStream的子类了
495-
* */
496-
// if (originalContent instanceof BufferedInputStream
497-
// && originalContent.markSupported()) {
498-
// // Mark everytime for BufferedInputStream, since the marker could have been
499-
// // invalidated
500-
// final int readLimit = clientConfig.getReadLimit();
501-
// originalContent.mark(readLimit);
502-
// }
492+
if (originalContent instanceof BufferedInputStream
493+
&& originalContent.markSupported()) {
494+
// Mark everytime for BufferedInputStream, since the marker could have been
495+
// invalidated
496+
final int readLimit = clientConfig.getReadLimit();
497+
originalContent.mark(readLimit);
498+
}
503499
// 如果是重试的则恢复流
504500
if (retryIndex != 0 && originalContent != null) {
505501
originalContent.reset();

0 commit comments

Comments
 (0)