Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer
This commit is contained in:
@@ -1262,7 +1262,8 @@ std::string CurlEasyRequest::getLowercaseHostname(void) const
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// BufferedCurlEasyRequest
|
// BufferedCurlEasyRequest
|
||||||
|
|
||||||
static int const HTTP_REDIRECTS_DEFAULT = 10;
|
static int const HTTP_REDIRECTS_DEFAULT = 16; // Singu note: I've seen up to 10 redirects, so setting the limit to 10 is cutting it.
|
||||||
|
// This limit is only here to avoid a redirect loop (infinite redirections).
|
||||||
|
|
||||||
LLChannelDescriptors const BufferedCurlEasyRequest::sChannels;
|
LLChannelDescriptors const BufferedCurlEasyRequest::sChannels;
|
||||||
LLMutex BufferedCurlEasyRequest::sResponderCallbackMutex;
|
LLMutex BufferedCurlEasyRequest::sResponderCallbackMutex;
|
||||||
@@ -1411,8 +1412,8 @@ void BufferedCurlEasyRequest::prepRequest(AICurlEasyRequest_wat& curl_easy_reque
|
|||||||
curl_easy_request_w->setHeaderCallback(&curlHeaderCallback, lockobj);
|
curl_easy_request_w->setHeaderCallback(&curlHeaderCallback, lockobj);
|
||||||
|
|
||||||
bool allow_cookies = headers.hasHeader("Cookie");
|
bool allow_cookies = headers.hasHeader("Cookie");
|
||||||
// Allow up to ten redirects.
|
// Allow up to sixteen redirects.
|
||||||
if (responder->followRedir())
|
if (!responder->pass_redirect_status())
|
||||||
{
|
{
|
||||||
curl_easy_request_w->setopt(CURLOPT_FOLLOWLOCATION, 1);
|
curl_easy_request_w->setopt(CURLOPT_FOLLOWLOCATION, 1);
|
||||||
curl_easy_request_w->setopt(CURLOPT_MAXREDIRS, HTTP_REDIRECTS_DEFAULT);
|
curl_easy_request_w->setopt(CURLOPT_MAXREDIRS, HTTP_REDIRECTS_DEFAULT);
|
||||||
|
|||||||
@@ -2062,7 +2062,7 @@ void BufferedCurlEasyRequest::setStatusAndReason(U32 status, std::string const&
|
|||||||
// Sanity check. If the server replies with a redirect status then we better have that option turned on!
|
// Sanity check. If the server replies with a redirect status then we better have that option turned on!
|
||||||
if ((status >= 300 && status < 400) && mResponder && !mResponder->redirect_status_ok())
|
if ((status >= 300 && status < 400) && mResponder && !mResponder->redirect_status_ok())
|
||||||
{
|
{
|
||||||
llerrs << "Received " << status << " (" << reason << ") for responder \"" << mResponder->getName() << "\" which has no followRedir()!" << llendl;
|
llerrs << "Received " << status << " (" << reason << ") for responder \"" << mResponder->getName() << "\" which does not allow redirection!" << llendl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -221,12 +221,12 @@ public:
|
|||||||
// The default is to keep connections open for possible reuse.
|
// The default is to keep connections open for possible reuse.
|
||||||
virtual bool forbidReuse(void) const { return false; }
|
virtual bool forbidReuse(void) const { return false; }
|
||||||
|
|
||||||
// A derived class should return true if curl should follow redirections.
|
// A derived class should return true if curl should not follow redirections, but instead pass redirection status codes to the responder.
|
||||||
// The default is not to follow redirections.
|
// The default is to follow redirections and not pass them to the responder.
|
||||||
virtual bool followRedir(void) const { return false; }
|
virtual bool pass_redirect_status(void) const { return false; }
|
||||||
|
|
||||||
// If this function returns false then we generate an error when a redirect status (300..399) is received.
|
// If this function returns false then we generate an error when a redirect status (300..399) is received.
|
||||||
virtual bool redirect_status_ok(void) const { return followRedir(); }
|
virtual bool redirect_status_ok(void) const { return true; }
|
||||||
|
|
||||||
// Returns the capability type used by this responder.
|
// Returns the capability type used by this responder.
|
||||||
virtual AICapabilityType capability_type(void) const { return cap_other; }
|
virtual AICapabilityType capability_type(void) const { return cap_other; }
|
||||||
@@ -259,7 +259,6 @@ public:
|
|||||||
class ResponderHeadersOnly : public ResponderBase {
|
class ResponderHeadersOnly : public ResponderBase {
|
||||||
private:
|
private:
|
||||||
/*virtual*/ bool needsHeaders(void) const { return true; }
|
/*virtual*/ bool needsHeaders(void) const { return true; }
|
||||||
/*virtual*/ bool followRedir(void) const { return true; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// ResponderBase event
|
// ResponderBase event
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class LLIamHereVoice : public LLHTTPClient::ResponderWithResult
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return iamHereVoice_timeout; }
|
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return iamHereVoice_timeout; }
|
||||||
/*virtual*/ bool redirect_status_ok(void) const { return true; }
|
/*virtual*/ bool pass_redirect_status(void) const { return true; }
|
||||||
/*virtual*/ char const* getName(void) const { return "LLIamHereVoice"; }
|
/*virtual*/ char const* getName(void) const { return "LLIamHereVoice"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ class LLIamHere : public LLHTTPClient::ResponderWithResult
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return iamHere_timeout; }
|
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return iamHere_timeout; }
|
||||||
/*virtual*/ bool redirect_status_ok(void) const { return true; }
|
/*virtual*/ bool pass_redirect_status(void) const { return true; }
|
||||||
/*virtual*/ char const* getName(void) const { return "LLIamHere"; }
|
/*virtual*/ char const* getName(void) const { return "LLIamHere"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -201,7 +201,6 @@ namespace LLMarketplaceImport
|
|||||||
class LLImportGetResponder : public LLHTTPClient::ResponderWithCompleted
|
class LLImportGetResponder : public LLHTTPClient::ResponderWithCompleted
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/*virtual*/ bool followRedir(void) const { return true; }
|
|
||||||
/*virtual*/ bool needsHeaders(void) const { return true; }
|
/*virtual*/ bool needsHeaders(void) const { return true; }
|
||||||
|
|
||||||
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
|
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
|
||||||
|
|||||||
@@ -2412,7 +2412,11 @@ void LLMeshRepository::notifyLoadedMeshes()
|
|||||||
{
|
{
|
||||||
region_name = gAgent.getRegion()->getName();
|
region_name = gAgent.getRegion()->getName();
|
||||||
|
|
||||||
mGetMeshCapability = gAgent.getRegion()->getCapability("GetMesh");
|
mGetMeshCapability = gAgent.getRegion()->getCapability("GetMesh2");
|
||||||
|
if (mGetMeshCapability.empty())
|
||||||
|
{
|
||||||
|
mGetMeshCapability = gAgent.getRegion()->getCapability("GetMesh");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,6 @@ public:
|
|||||||
|
|
||||||
/*virtual*/ void result(const LLSD &pContent);
|
/*virtual*/ void result(const LLSD &pContent);
|
||||||
/*virtual*/ void error(U32 pStatus, const std::string& pReason);
|
/*virtual*/ void error(U32 pStatus, const std::string& pReason);
|
||||||
/*virtual*/ bool followRedir(void) const { return true; }
|
|
||||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return agentStateResponder_timeout; }
|
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return agentStateResponder_timeout; }
|
||||||
/*virtual*/ char const* getName(void) const { return "AgentStateResponder"; }
|
/*virtual*/ char const* getName(void) const { return "AgentStateResponder"; }
|
||||||
|
|
||||||
|
|||||||
@@ -328,13 +328,12 @@ class HTTPGetResponder : public LLHTTPClient::ResponderWithCompleted
|
|||||||
{
|
{
|
||||||
LOG_CLASS(HTTPGetResponder);
|
LOG_CLASS(HTTPGetResponder);
|
||||||
public:
|
public:
|
||||||
HTTPGetResponder(LLTextureFetch* fetcher, const LLUUID& id, U64 startTime, S32 requestedSize, U32 offset, bool redir)
|
HTTPGetResponder(LLTextureFetch* fetcher, const LLUUID& id, U64 startTime, S32 requestedSize, U32 offset)
|
||||||
: mFetcher(fetcher)
|
: mFetcher(fetcher)
|
||||||
, mID(id)
|
, mID(id)
|
||||||
, mMetricsStartTime(startTime)
|
, mMetricsStartTime(startTime)
|
||||||
, mRequestedSize(requestedSize)
|
, mRequestedSize(requestedSize)
|
||||||
, mRequestedOffset(offset)
|
, mRequestedOffset(offset)
|
||||||
, mFollowRedir(redir)
|
|
||||||
, mReplyOffset(0)
|
, mReplyOffset(0)
|
||||||
, mReplyLength(0)
|
, mReplyLength(0)
|
||||||
, mReplyFullLength(0)
|
, mReplyFullLength(0)
|
||||||
@@ -449,7 +448,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*virtual*/ bool followRedir() const { return mFollowRedir; }
|
|
||||||
/*virtual*/ AICapabilityType capability_type(void) const { return cap_texture; }
|
/*virtual*/ AICapabilityType capability_type(void) const { return cap_texture; }
|
||||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return HTTPGetResponder_timeout; }
|
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return HTTPGetResponder_timeout; }
|
||||||
/*virtual*/ char const* getName(void) const { return "HTTPGetResponder"; }
|
/*virtual*/ char const* getName(void) const { return "HTTPGetResponder"; }
|
||||||
@@ -464,8 +462,6 @@ private:
|
|||||||
U32 mReplyOffset;
|
U32 mReplyOffset;
|
||||||
U32 mReplyLength;
|
U32 mReplyLength;
|
||||||
U32 mReplyFullLength;
|
U32 mReplyFullLength;
|
||||||
|
|
||||||
bool mFollowRedir;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -1423,7 +1419,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
|
|||||||
headers.addHeader("Range", llformat("bytes=%d-%d", mRequestedOffset, mRequestedOffset + mRequestedSize - 1));
|
headers.addHeader("Range", llformat("bytes=%d-%d", mRequestedOffset, mRequestedOffset + mRequestedSize - 1));
|
||||||
}
|
}
|
||||||
LLHTTPClient::request(mUrl, LLHTTPClient::HTTP_GET, NULL,
|
LLHTTPClient::request(mUrl, LLHTTPClient::HTTP_GET, NULL,
|
||||||
new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, mRequestedOffset, true),
|
new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, mRequestedOffset),
|
||||||
headers, approved/*,*/ DEBUG_CURLIO_PARAM(debug_off), keep_alive, no_does_authentication, allow_compressed_reply, NULL, 0, NULL);
|
headers, approved/*,*/ DEBUG_CURLIO_PARAM(debug_off), keep_alive, no_does_authentication, allow_compressed_reply, NULL, 0, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -304,7 +304,6 @@ public:
|
|||||||
LLViewerMediaWebProfileResponder(std::string host) : mHost(host) { }
|
LLViewerMediaWebProfileResponder(std::string host) : mHost(host) { }
|
||||||
~LLViewerMediaWebProfileResponder() { }
|
~LLViewerMediaWebProfileResponder() { }
|
||||||
|
|
||||||
/*virtual*/ bool followRedir(void) const { return true; }
|
|
||||||
/*virtual*/ bool needsHeaders(void) const { return true; }
|
/*virtual*/ bool needsHeaders(void) const { return true; }
|
||||||
|
|
||||||
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
|
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
|
||||||
|
|||||||
@@ -1675,6 +1675,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
|
|||||||
capabilityNames.append("GamingData"); //Used by certain grids.
|
capabilityNames.append("GamingData"); //Used by certain grids.
|
||||||
capabilityNames.append("GetDisplayNames");
|
capabilityNames.append("GetDisplayNames");
|
||||||
capabilityNames.append("GetMesh");
|
capabilityNames.append("GetMesh");
|
||||||
|
capabilityNames.append("GetMesh2"); // Used on SecondLife(tm) sim versions 280647 and higher (13.09.17).
|
||||||
capabilityNames.append("GetObjectCost");
|
capabilityNames.append("GetObjectCost");
|
||||||
capabilityNames.append("GetObjectPhysicsData");
|
capabilityNames.append("GetObjectPhysicsData");
|
||||||
capabilityNames.append("GetTexture");
|
capabilityNames.append("GetTexture");
|
||||||
@@ -2072,7 +2073,7 @@ bool LLViewerRegion::meshRezEnabled() const
|
|||||||
{
|
{
|
||||||
if (getCapability("SimulatorFeatures").empty())
|
if (getCapability("SimulatorFeatures").empty())
|
||||||
{
|
{
|
||||||
return !getCapability("GetMesh").empty();
|
return !getCapability("GetMesh").empty() || !getCapability("GetMesh2").empty();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return webProfileResponders_timeout; }
|
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return webProfileResponders_timeout; }
|
||||||
/*virtual*/ bool followRedir(void) const { return true; }
|
|
||||||
/*virtual*/ char const* getName(void) const { return "LLWebProfileResponders::ConfigResponder"; }
|
/*virtual*/ char const* getName(void) const { return "LLWebProfileResponders::ConfigResponder"; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -157,7 +156,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*virtual*/ bool followRedir(void) const { return true; }
|
|
||||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return webProfileResponders_timeout; }
|
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return webProfileResponders_timeout; }
|
||||||
/*virtual*/ char const* getName(void) const { return "LLWebProfileResponders::PostImageRedirectResponder"; }
|
/*virtual*/ char const* getName(void) const { return "LLWebProfileResponders::PostImageRedirectResponder"; }
|
||||||
|
|
||||||
@@ -181,7 +179,7 @@ public:
|
|||||||
// the just uploaded data, which fails
|
// the just uploaded data, which fails
|
||||||
// (CURLE_SEND_FAIL_REWIND: Send failed since rewinding of the data stream failed).
|
// (CURLE_SEND_FAIL_REWIND: Send failed since rewinding of the data stream failed).
|
||||||
// Handle it manually.
|
// Handle it manually.
|
||||||
if (status == 303)
|
if (status == HTTP_SEE_OTHER)
|
||||||
{
|
{
|
||||||
AIHTTPHeaders headers;
|
AIHTTPHeaders headers;
|
||||||
headers.addHeader("Accept", "*/*");
|
headers.addHeader("Accept", "*/*");
|
||||||
@@ -208,7 +206,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*virtual*/ bool redirect_status_ok(void) const { return true; }
|
/*virtual*/ bool pass_redirect_status(void) const { return true; }
|
||||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return webProfileResponders_timeout; }
|
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return webProfileResponders_timeout; }
|
||||||
/*virtual*/ char const* getName(void) const { return "LLWebProfileResponders::PostImageResponder"; }
|
/*virtual*/ char const* getName(void) const { return "LLWebProfileResponders::PostImageResponder"; }
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user