修复http文件服务器相关bug

This commit is contained in:
xiongziliang 2021-05-22 09:13:00 +08:00
parent 5b57b9d6ae
commit 08d4edddb0

View File

@ -577,7 +577,7 @@ void HttpResponseInvokerImp::responseFile(const StrCaseMap &requestHeader,
//分节下载 //分节下载
code = 206; code = 206;
iRangeStart = atoll(FindField(strRange.data(), "bytes=", "-").data()); iRangeStart = atoll(FindField(strRange.data(), "bytes=", "-").data());
iRangeEnd = atoll(FindField(strRange.data(), "-", "\r\n").data()); iRangeEnd = atoll(FindField(strRange.data(), "-", nullptr).data());
if (iRangeEnd == 0) { if (iRangeEnd == 0) {
iRangeEnd = fileSize - 1; iRangeEnd = fileSize - 1;
} }