抽象整理HttpBody类,fread模式下使用循环池提升内存性能

This commit is contained in:
xiongziliang
2019-10-27 02:04:51 +08:00
parent 144fb20339
commit 6023885e93
8 changed files with 387 additions and 316 deletions

View File

@@ -242,8 +242,9 @@ void HttpClient::onRecvContent(const char *data, uint64_t len) {
void HttpClient::onFlush() {
_aliveTicker.resetTime();
GET_CONFIG(uint32_t,sendBufSize,Http::kSendBufSize);
while (_body && _body->remainSize() && !isSocketBusy()) {
auto buffer = _body->readData();
auto buffer = _body->readData(sendBufSize);
if (!buffer) {
//数据发送结束或读取数据异常
break;