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:
@@ -52,6 +52,8 @@
|
||||
#include "llvfile.h"
|
||||
#include "message.h"
|
||||
|
||||
class AIHTTPTimeoutPolicy;
|
||||
extern AIHTTPTimeoutPolicy iamHereVoice_timeout;
|
||||
|
||||
FloaterVoiceLicense::FloaterVoiceLicense(const LLSD& key)
|
||||
: LLModalDialog( std::string(" "), 100, 100 ),
|
||||
@@ -73,7 +75,6 @@ class LLIamHereVoice : public LLHTTPClient::Responder
|
||||
FloaterVoiceLicense* mParent;
|
||||
|
||||
public:
|
||||
|
||||
static boost::intrusive_ptr< LLIamHereVoice > build( FloaterVoiceLicense* parent )
|
||||
{
|
||||
return boost::intrusive_ptr< LLIamHereVoice >( new LLIamHereVoice( parent ) );
|
||||
@@ -101,6 +102,8 @@ class LLIamHereVoice : public LLHTTPClient::Responder
|
||||
mParent->setSiteIsAlive( alive );
|
||||
}
|
||||
};
|
||||
|
||||
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return iamHereVoice_timeout; }
|
||||
};
|
||||
|
||||
// this is global and not a class member to keep crud out of the header file
|
||||
|
||||
Reference in New Issue
Block a user