mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-04-05 19:41:43 +08:00
Move running check to xfer info callback.
This commit is contained in:
parent
2a223f08aa
commit
9aeac8294d
@ -287,10 +287,6 @@ typedef struct {
|
||||
static size_t http_curl_write_callback(char* ptr, size_t size, size_t nmemb, void* userdata) {
|
||||
http_curl_data* curlData = (http_curl_data*) userdata;
|
||||
|
||||
if(curlData->checkRunning != NULL && R_FAILED(curlData->res = curlData->checkRunning(curlData->userData))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t srcPos = 0;
|
||||
size_t available = size * nmemb;
|
||||
while(available > 0) {
|
||||
@ -315,8 +311,12 @@ static size_t http_curl_write_callback(char* ptr, size_t size, size_t nmemb, voi
|
||||
int http_curl_xfer_info_callback(void* clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) {
|
||||
http_curl_data* curlData = (http_curl_data*) clientp;
|
||||
|
||||
if(curlData->checkRunning != NULL && R_FAILED(curlData->res = curlData->checkRunning(curlData->userData))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(curlData->progress != NULL) {
|
||||
curlData->progress(curlData->userData, dltotal, dlnow);
|
||||
curlData->progress(curlData->userData, (u64) dltotal, (u64) dlnow);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user