mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-01-31 18:53:03 +00:00
Make some timeouts a bit more visible in the code. Some should be re-evaluated.
This commit is contained in:
parent
39cf5b5c30
commit
157f262cd2
@ -128,8 +128,10 @@ int HTTPFileLoader::SendHEAD(const Url &url, std::vector<std::string> &responseH
|
||||
return -400;
|
||||
}
|
||||
|
||||
client_.SetDataTimeout(20.0);
|
||||
Connect();
|
||||
double timeout = 20.0;
|
||||
|
||||
client_.SetDataTimeout(timeout);
|
||||
Connect(10.0);
|
||||
if (!connected_) {
|
||||
ERROR_LOG(LOADER, "HTTP request failed, failed to connect: %s port %d (resource: '%s')", url.Host().c_str(), url.Port(), url.Resource().c_str());
|
||||
latestError_ = "Could not connect (refused to connect)";
|
||||
@ -186,7 +188,7 @@ size_t HTTPFileLoader::ReadAt(s64 absolutePos, size_t bytes, void *data, Flags f
|
||||
return 0;
|
||||
}
|
||||
|
||||
Connect();
|
||||
Connect(10.0);
|
||||
if (!connected_) {
|
||||
return 0;
|
||||
}
|
||||
@ -258,10 +260,9 @@ size_t HTTPFileLoader::ReadAt(s64 absolutePos, size_t bytes, void *data, Flags f
|
||||
return readBytes;
|
||||
}
|
||||
|
||||
void HTTPFileLoader::Connect() {
|
||||
void HTTPFileLoader::Connect(double timeout) {
|
||||
if (!connected_) {
|
||||
cancel_ = false;
|
||||
// Latency is important here, so reduce the timeout.
|
||||
connected_ = client_.Connect(3, 10.0, &cancel_);
|
||||
connected_ = client_.Connect(3, timeout, &cancel_);
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ private:
|
||||
void Prepare();
|
||||
int SendHEAD(const Url &url, std::vector<std::string> &responseHeaders);
|
||||
|
||||
void Connect();
|
||||
void Connect(double timeout);
|
||||
|
||||
void Disconnect() {
|
||||
if (connected_) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user