Add improved timeout handling for HTTP transactions.

Introduces AIHTTPTimeoutPolicy objects which do not just
specify a single "timeout" in seconds, but a plethora of
timings related to the life cycle of the average HTTP
transaction.

This knowledge is that moved to the Responder being
used instead of floating constants hardcoded in the
callers of http requests. This assumes that the same
timeout policy is wanted for each transaction that
uses the same Responder, which can be enforced is needed.

I added a AIHTTPTimeoutPolicy for EVERY responder,
only to make it easier later to tune timeout values
and/or to get feedback about which responder runs
into HTTP errors in debug output (especially time outs),
so that they can be tuned later. If we already understood
exactly what we were doing then most responders could
have been left alone and just return the default timeout
policy: by far most timeout policies are just a copy
of the default policy, currently.

This commit is not finished... It's a work in progress
(viewer runs fine with it though).
This commit is contained in:
Aleric Inglewood
2012-10-05 15:53:29 +02:00
parent 2766f17cb9
commit 3f1fb9a66e
67 changed files with 1654 additions and 198 deletions

View File

@@ -52,6 +52,10 @@
#include "llviewerwindow.h"
#include "llviewerregion.h"
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy startGroupVoteResponder_timeout;
extern AIHTTPTimeoutPolicy groupProposalBallotResponder_timeout;
class LLPanelGroupVoting::impl
{
public:
@@ -705,6 +709,10 @@ public:
LLPanelGroupVoting::handleFailure(mGroupID);
}
//Return our timeout policy.
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return startGroupVoteResponder_timeout; }
private:
LLUUID mGroupID;
};
@@ -735,6 +743,10 @@ public:
LLPanelGroupVoting::handleFailure(mGroupID);
}
//Return out timeout policy.
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return groupProposalBallotResponder_timeout; }
private:
LLUUID mGroupID;
};
@@ -781,8 +793,7 @@ void LLPanelGroupVoting::impl::sendStartGroupProposal()
LLHTTPClient::post4(
url,
body,
new LLStartGroupVoteResponder(mGroupID),
300);
new LLStartGroupVoteResponder(mGroupID));
}
else
{ //DEPRECATED!!!!!!! This is a fallback just in case our backend cap is not there. Delete this block ASAP!
@@ -828,8 +839,7 @@ void LLPanelGroupVoting::impl::sendGroupProposalBallot(const std::string& vote)
LLHTTPClient::post4(
url,
body,
new LLGroupProposalBallotResponder(mGroupID),
300);
new LLGroupProposalBallotResponder(mGroupID));
}
else
{ //DEPRECATED!!!!!!! This is a fallback just in case our backend cap is not there. Delete this block ASAP!