This commit is contained in:
Lirusaito
2012-11-14 13:55:48 -05:00
19 changed files with 353 additions and 83 deletions

View File

@@ -9,6 +9,17 @@
<string>settings_rlv.xml</string>
</array>
<key>SGIgnoreSimulatorCameraConstraints</key>
<map>
<key>Comment</key>
<string>Don't let the simulator push your camera around</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>SGAllowRiggedMeshSelection</key>
<map>
<key>Comment</key>

View File

@@ -1844,7 +1844,10 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
local_camera_offset = gAgent.getFrameAgent().rotateToAbsolute( local_camera_offset );
}
if (!mCameraCollidePlane.isExactlyZero() && (!isAgentAvatarValid() || !gAgentAvatarp->isSitting()))
if ( !mCameraCollidePlane.isExactlyZero()
&& !gSavedSettings.getBOOL("SGIgnoreSimulatorCameraConstraints")
&& isAgentAvatarValid()
&& !gAgentAvatarp->isSitting())
{
LLVector3 plane_normal;
plane_normal.setVec(mCameraCollidePlane.mV);

View File

@@ -645,8 +645,8 @@ bool LLAppViewer::init()
AIStateMachine::setMaxCount(gSavedSettings.getU32("StateMachineMaxTime"));
AIHTTPTimeoutPolicy::setDefaultCurlTimeout(
AIHTTPTimeoutPolicy(
{
AIHTTPTimeoutPolicy policy_tmp(
"CurlTimeout* Debug Settings",
gSavedSettings.getU32("CurlTimeoutDNSLookup"),
gSavedSettings.getU32("CurlTimeoutConnect"),
@@ -655,7 +655,9 @@ bool LLAppViewer::init()
gSavedSettings.getU32("CurlTimeoutLowSpeedLimit"),
gSavedSettings.getU32("CurlTimeoutMaxTransaction"),
gSavedSettings.getU32("CurlTimeoutMaxTotalDelay")
));
);
AIHTTPTimeoutPolicy::setDefaultCurlTimeout(policy_tmp);
}
initThreads();
LL_INFOS("InitInfo") << "Threads initialized." << LL_ENDL ;

View File

@@ -53,7 +53,7 @@ static LLFloaterURLEntry* sInstance = NULL;
// Move this to its own file.
// helper class that tries to download a URL from a web site and calls a method
// on the Panel Land Media and to discover the MIME type
class LLMediaTypeResponder : public LLHTTPClient::ResponderIgnoreBody
class LLMediaTypeResponder : public LLHTTPClient::ResponderHeadersOnly
{
public:
LLMediaTypeResponder( const LLHandle<LLFloater> parent ) :
@@ -62,20 +62,20 @@ public:
LLHandle<LLFloater> mParent;
virtual bool needsHeaders(void) const { return true; }
virtual void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
{
std::string media_type;
bool content_type_found = headers.getFirstValue("content-type", media_type);
llassert_always(content_type_found);
std::string::size_type idx1 = media_type.find_first_of(";");
std::string mime_type = media_type.substr(0, idx1);
completeAny(status, mime_type);
}
virtual void error( U32 status, const std::string& reason )
{
if (200 <= status && status < 300)
{
std::string media_type;
if (headers.getFirstValue("content-type", media_type))
{
std::string::size_type idx1 = media_type.find_first_of(";");
std::string mime_type = media_type.substr(0, idx1);
completeAny(status, mime_type);
return;
}
llwarns << "LLMediaTypeResponder::completedHeaders: OK HTTP status (" << status << ") but no Content-Type! Received headers: " << headers << llendl;
}
completeAny(status, "none/none");
}

View File

@@ -168,7 +168,7 @@ std::string gFullName;
// helper class that trys to download a URL from a web site and calls a method
// on parent class indicating if the web server is working or not
class LLIamHereLogin : public LLHTTPClient::ResponderWithCompleted
class LLIamHereLogin : public LLHTTPClient::ResponderHeadersOnly
{
private:
LLIamHereLogin( LLPanelLogin* parent ) :
@@ -188,10 +188,7 @@ class LLIamHereLogin : public LLHTTPClient::ResponderWithCompleted
mParent = parentIn;
};
// We don't actually expect LLSD back, so need to override completedRaw
virtual void completedRaw(U32 status, const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
{
if (mParent)
{
@@ -887,7 +884,7 @@ void LLPanelLogin::refreshLoginPage()
std::string login_page = gHippoGridManager->getConnectedGrid()->getLoginPage();
if (!login_page.empty()) {
LLHTTPClient::head(login_page, gResponsePtr);
LLHTTPClient::head(login_page, gResponsePtr.get());
} else {
sInstance->setSiteIsAlive(false);
}

View File

@@ -1316,9 +1316,8 @@ bool LLTextureFetchWorker::doWork(S32 param)
}
}
}
mRequestedSize = mDesiredSize;
mRequestedSize = mDesiredSize - cur_size;
mRequestedDiscard = mDesiredDiscard;
mRequestedSize -= cur_size;
mRequestedOffset = cur_size;
bool res = false;
@@ -1909,6 +1908,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels,
// *TODO: This shouldn't be happening any more
llwarns << "data_size = " << data_size << " > requested: " << mRequestedSize << llendl;
mHaveAllData = TRUE;
mRequestedOffset = 0;
llassert_always(mDecodeHandle == 0);
mFormattedImage = NULL; // discard any previous data we had
}
@@ -1919,7 +1919,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels,
// so presumably we have all of it
mHaveAllData = TRUE;
}
mRequestedSize = llmin(data_size, mRequestedSize);
mRequestedSize = data_size;
}
else
{

View File

@@ -71,7 +71,7 @@ const int RIGHT_BUTTON = 1;
///////////////////////////////////////////////////////////////////////////////
// Helper class that tries to download a URL from a web site and calls a method
// on the Panel Land Media and to discover the MIME type
class LLMimeDiscoveryResponder : public LLHTTPClient::ResponderIgnoreBody
class LLMimeDiscoveryResponder : public LLHTTPClient::ResponderHeadersOnly
{
LOG_CLASS(LLMimeDiscoveryResponder);
public:
@@ -80,16 +80,21 @@ public:
mInitialized(false)
{}
/*virtual*/ bool needsHeaders(void) const { return true; }
/*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers)
{
std::string media_type;
bool content_type_found = headers.getFirstValue("content-type", media_type);
llassert_always(content_type_found);
std::string::size_type idx1 = media_type.find_first_of(";");
std::string mime_type = media_type.substr(0, idx1);
completeAny(status, mime_type);
if (200 <= status && status < 300)
{
std::string media_type;
if (headers.getFirstValue("content-type", media_type))
{
std::string::size_type idx1 = media_type.find_first_of(";");
std::string mime_type = media_type.substr(0, idx1);
completeAny(status, mime_type);
return;
}
llwarns << "LLMimeDiscoveryResponder::completedHeaders: OK HTTP status (" << status << ") but no Content-Type! Received headers: " << headers << llendl;
}
completeAny(status, "none/none");
}
void completeAny(U32 status, const std::string& mime_type)

View File

@@ -690,6 +690,31 @@ LPTOP_LEVEL_EXCEPTION_FILTER WINAPI MyDummySetUnhandledExceptionFilter(
return gFilterFunc;
}
BOOL PreventSetUnhandledExceptionFilter()
{
HMODULE hKernel32 = LoadLibrary(_T("kernel32.dll"));
if (hKernel32 == NULL)
return FALSE;
void *pOrgEntry = GetProcAddress(hKernel32, "SetUnhandledExceptionFilter");
if(pOrgEntry == NULL)
return FALSE;
unsigned char newJump[ 100 ];
DWORD dwOrgEntryAddr = (DWORD)pOrgEntry;
dwOrgEntryAddr += 5; // add 5 for 5 op-codes for jmp far
void *pNewFunc = &MyDummySetUnhandledExceptionFilter;
DWORD dwNewEntryAddr = (DWORD) pNewFunc;
DWORD dwRelativeAddr = dwNewEntryAddr - dwOrgEntryAddr;
newJump[ 0 ] = 0xE9; // JMP absolute
memcpy(&newJump[ 1 ], &dwRelativeAddr, sizeof(pNewFunc));
SIZE_T bytesWritten;
BOOL bRet = WriteProcessMemory(GetCurrentProcess(),
pOrgEntry, newJump, sizeof(pNewFunc) + 1, &bytesWritten);
return bRet;
}
// static
void LLWinDebug::initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func)
{
@@ -740,6 +765,9 @@ void LLWinDebug::initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func)
LPTOP_LEVEL_EXCEPTION_FILTER prev_filter;
prev_filter = SetUnhandledExceptionFilter(filter_func);
// *REMOVE:Mani
//PreventSetUnhandledExceptionFilter();
if(prev_filter != gFilterFunc)
{
LL_WARNS("AppInit")