mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-07-05 00:17:11 +02:00
Update WIP discord and some vendors.
CPR has features disabled and PCRE is fully disabled until updated to new code.
This commit is contained in:
14
vendor/CPR/cpr/callback.cpp
vendored
Normal file
14
vendor/CPR/cpr/callback.cpp
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
#include <cpr/callback.h>
|
||||
#include <curl/curl.h>
|
||||
#include <functional>
|
||||
|
||||
namespace cpr {
|
||||
|
||||
void CancellationCallback::SetProgressCallback(ProgressCallback& u_cb) {
|
||||
user_cb.emplace(std::reference_wrapper{u_cb});
|
||||
}
|
||||
bool CancellationCallback::operator()(cpr_pf_arg_t dltotal, cpr_pf_arg_t dlnow, cpr_pf_arg_t ultotal, cpr_pf_arg_t ulnow) const {
|
||||
const bool cont_operation{!cancellation_state->load()};
|
||||
return user_cb ? (cont_operation && (*user_cb)(dltotal, dlnow, ultotal, ulnow)) : cont_operation;
|
||||
}
|
||||
} // namespace cpr
|
Reference in New Issue
Block a user