From 2a8b6d2b84551f15b21414ab6f1c18adcdd05a06 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Thu, 16 May 2019 17:56:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/HttpSession.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Http/HttpSession.cpp b/src/Http/HttpSession.cpp index fa9ad868..3fe4e1b5 100644 --- a/src/Http/HttpSession.cpp +++ b/src/Http/HttpSession.cpp @@ -416,7 +416,6 @@ inline bool HttpSession::Handle_Req_GET(int64_t &content_len) { iRead = fread(sendBuf->data(), 1, iReq, pFilePtr.get()); }while(-1 == iRead && UV_EINTR == get_uv_error(false)); //文件剩余字节数 - *piLeft -= iRead; if (iRead < iReq || !*piLeft) { @@ -435,20 +434,15 @@ inline bool HttpSession::Handle_Req_GET(int64_t &content_len) { sendBuf->setSize(iRead); int iSent = strongSelf->send(sendBuf); if(iSent == -1) { + //套机制销毁 //InfoL << "send error"; return false; } - if(iSent < iRead) { - //数据回滚 - fseek(pFilePtr.get(), -iRead, SEEK_CUR); - *piLeft += iRead; - return true; - } if(strongSelf->isSocketBusy()){ //套接字忙,那么停止继续写 return true; } - //send success + //继续写套接字 } return false; };