| 202 | } |
| 203 | |
| 204 | bool progressCallback( cpr::cpr_off_t downloadTotal, cpr::cpr_off_t downloadNow, cpr::cpr_off_t uploadTotal, cpr::cpr_off_t uploadNow, intptr_t userdata ) |
| 205 | { |
| 206 | const auto ctxId = (int)userdata; |
| 207 | auto& ctx = sRequestContextMap.at( ctxId ); |
| 208 | if ( downloadNow < downloadTotal ) |
| 209 | if ( !MR::reportProgress( ctx->downloadCallback, (float)downloadNow / (float)downloadTotal ) ) |
| 210 | return false; |
| 211 | if ( uploadNow < uploadTotal ) |
| 212 | if ( !MR::reportProgress( ctx->uploadCallback, (float)uploadNow / (float)uploadTotal ) ) |
| 213 | return false; |
| 214 | return true; |
| 215 | } |
| 216 | |
| 217 | } |
| 218 | #endif |
no test coverage detected