mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 01:45:35 -05:00
make cancelling not call error callback
This commit is contained in:
parent
7ba832c9ee
commit
2540790ccb
1 changed files with 5 additions and 3 deletions
|
@ -357,8 +357,12 @@ SentAsyncWebRequest::Impl::Impl(SentAsyncWebRequest* self, AsyncWebRequest const
|
||||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &code);
|
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &code);
|
||||||
if (res != CURLE_OK) {
|
if (res != CURLE_OK) {
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
|
if (m_cancelled) {
|
||||||
|
return this->doCancel();
|
||||||
|
} else {
|
||||||
return this->error("Fetch failed: " + std::string(curl_easy_strerror(res)), code);
|
return this->error("Fetch failed: " + std::string(curl_easy_strerror(res)), code);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (code >= 400 && code < 600) {
|
if (code >= 400 && code < 600) {
|
||||||
std::string response_str(ret.begin(), ret.end());
|
std::string response_str(ret.begin(), ret.end());
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
|
@ -409,8 +413,6 @@ void SentAsyncWebRequest::Impl::doCancel() {
|
||||||
l.lock();
|
l.lock();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this->error("Request cancelled", -1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SentAsyncWebRequest::Impl::cancel() {
|
void SentAsyncWebRequest::Impl::cancel() {
|
||||||
|
|
Loading…
Reference in a new issue