mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-21 17:17:49 +08:00
删除冗余代码
This commit is contained in:
parent
609006d06e
commit
2a8b6d2b84
@ -416,7 +416,6 @@ inline bool HttpSession::Handle_Req_GET(int64_t &content_len) {
|
|||||||
iRead = fread(sendBuf->data(), 1, iReq, pFilePtr.get());
|
iRead = fread(sendBuf->data(), 1, iReq, pFilePtr.get());
|
||||||
}while(-1 == iRead && UV_EINTR == get_uv_error(false));
|
}while(-1 == iRead && UV_EINTR == get_uv_error(false));
|
||||||
//文件剩余字节数
|
//文件剩余字节数
|
||||||
|
|
||||||
*piLeft -= iRead;
|
*piLeft -= iRead;
|
||||||
|
|
||||||
if (iRead < iReq || !*piLeft) {
|
if (iRead < iReq || !*piLeft) {
|
||||||
@ -435,20 +434,15 @@ inline bool HttpSession::Handle_Req_GET(int64_t &content_len) {
|
|||||||
sendBuf->setSize(iRead);
|
sendBuf->setSize(iRead);
|
||||||
int iSent = strongSelf->send(sendBuf);
|
int iSent = strongSelf->send(sendBuf);
|
||||||
if(iSent == -1) {
|
if(iSent == -1) {
|
||||||
|
//套机制销毁
|
||||||
//InfoL << "send error";
|
//InfoL << "send error";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(iSent < iRead) {
|
|
||||||
//数据回滚
|
|
||||||
fseek(pFilePtr.get(), -iRead, SEEK_CUR);
|
|
||||||
*piLeft += iRead;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if(strongSelf->isSocketBusy()){
|
if(strongSelf->isSocketBusy()){
|
||||||
//套接字忙,那么停止继续写
|
//套接字忙,那么停止继续写
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//send success
|
//继续写套接字
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user