修复http下载时Transfer-Encoding=chunked提前断开的情况

This commit is contained in:
xiongziliang
2019-02-17 13:35:12 +08:00
parent ef95f195f9
commit 62e6c7cb98
2 changed files with 3 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
/*
/*
* MIT License
*
* Copyright (c) 2016 xiongziliang <771730766@qq.com>
@@ -236,7 +236,7 @@ void HttpClient::onSend() {
}
void HttpClient::onManager() {
if (_aliveTicker.elapsedTime() > 3 * 1000 && _totalBodySize < 0) {
if (_aliveTicker.elapsedTime() > 3 * 1000 && _totalBodySize < 0 && !_chunkedSplitter) {
//如果Content-Length未指定 但接收数据超时
//则认为本次http请求完成
onResponseCompleted_l();