Fixed Downloader class progress callbacks, added HTTP::Parser progress calculation function.
This commit is contained in:
parent
e1150fe871
commit
917ce2d452
3 changed files with 26 additions and 2 deletions
|
@ -183,7 +183,15 @@ namespace HTTP{
|
|||
return true; // Success!
|
||||
}
|
||||
// reset the data timeout
|
||||
reqTime = Util::bootSecs();
|
||||
if (reqTime != Util::bootSecs()){
|
||||
if (progressCallback != 0){
|
||||
if (!progressCallback()){
|
||||
WARN_MSG("Download aborted by callback");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
reqTime = Util::bootSecs();
|
||||
}
|
||||
}
|
||||
if (getSocket()){
|
||||
FAIL_MSG("Timeout while retrieving %s (%zu/%" PRIu32 ")", link.getUrl().c_str(),
|
||||
|
@ -239,7 +247,15 @@ namespace HTTP{
|
|||
return true; // Success!
|
||||
}
|
||||
// reset the data timeout
|
||||
reqTime = Util::bootSecs();
|
||||
if (reqTime != Util::bootSecs()){
|
||||
if (progressCallback != 0){
|
||||
if (!progressCallback()){
|
||||
WARN_MSG("Download aborted by callback");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
reqTime = Util::bootSecs();
|
||||
}
|
||||
}
|
||||
if (getSocket()){
|
||||
FAIL_MSG("Timeout while retrieving %s", link.getUrl().c_str());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue