diff --git a/lib/urireader.cpp b/lib/urireader.cpp index 78658c46..ddf60011 100644 --- a/lib/urireader.cpp +++ b/lib/urireader.cpp @@ -420,7 +420,7 @@ namespace HTTP{ if (allData.size() && bufPos < allData.size()){return false;} return true; } - if ((totalSize > 0 && curPos >= totalSize) || downer.completed() || (!totalSize && !downer.getSocket())){ + if ((totalSize != std::string::npos && curPos >= totalSize) || downer.completed() || (totalSize == std::string::npos && !downer.getSocket())){ if (allData.size() && bufPos < allData.size()){return false;} return true; }