Explorar o código

fix #350: if resp.body.size != range_bytes

ithewei %!s(int64=2) %!d(string=hai) anos
pai
achega
da91850b4c
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      examples/wget.cpp

+ 3 - 1
examples/wget.cpp

@@ -104,7 +104,9 @@ static int wget(const char* url, const char* filepath, wget_progress_cb progress
         }
         printd("%s", resp.Dump(true, false).c_str());
         file.write(resp.body.data(), resp.body.size());
-        from = to + 1;
+        // fix: resp.body.size != range_bytes on some server
+        // from = to + 1;
+        from += resp.body.size();
 
         if (progress_cb) {
             progress_cb(from, content_length);