diff options
-rw-r--r-- | .hgtags | 4 | ||||
-rw-r--r-- | indra/llcorehttp/_httpoprequest.cpp | 9 | ||||
-rw-r--r-- | indra/media_plugins/webkit/windows_volume_catcher.cpp | 52 | ||||
-rw-r--r-- | indra/newview/llfloatertexturefetchdebugger.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/lltexturefetch.cpp | 54 | ||||
-rw-r--r-- | indra/newview/lltexturefetch.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewerkeyboard.cpp | 5 |
7 files changed, 81 insertions, 47 deletions
@@ -402,4 +402,8 @@ af6b711a97073431953b55ee808aaa09900c27e5 DRTVWR-276 8302fefde6c8f4a64bfc7f04929f8bc85f5c6c7b DRTVWR-279 c296133849d1f103c0e2abc41e6599daed00b67b DRTVWR-280 40a2265058abc9fde4914c10185f916435818621 3.4.5-beta1 +5df4802bec93c8d0a509946d826bb4c50c5442ec DRTVWR-281 +7c1c33ba4cfd2d15ca51cc1ac440eca551331a4a DRTVWR-283 +6b9c7dbebef793230d64e1b452577c8b142d4143 3.4.5-beta2 +37947e4f771f001b551581bf7cd0051c3153beed DRTVWR-282 6482cceb91cda68b799f3e6cdc66d33bf123547a DRTVWR-284 diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 7db19b1841..51a8eaf998 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -580,8 +580,13 @@ size_t HttpOpRequest::readCallback(void * data, size_t size, size_t nmemb, void const size_t body_size(op->mReqBody->size()); if (body_size <= op->mCurlBodyPos) { - LL_WARNS("HttpCore") << "Request body position beyond body size. Aborting request." - << LL_ENDL; + if (body_size < op->mCurlBodyPos) + { + // Warn but continue if the read position moves beyond end-of-body + // for some reason. + LL_WARNS("HttpCore") << "Request body position beyond body size. Truncating request body." + << LL_ENDL; + } return 0; } diff --git a/indra/media_plugins/webkit/windows_volume_catcher.cpp b/indra/media_plugins/webkit/windows_volume_catcher.cpp index 5fb84756ee..957704da47 100644 --- a/indra/media_plugins/webkit/windows_volume_catcher.cpp +++ b/indra/media_plugins/webkit/windows_volume_catcher.cpp @@ -48,18 +48,37 @@ private: set_volume_func_t mSetVolumeFunc; set_mute_func_t mSetMuteFunc; + // tests if running on Vista, 7, 8 + once in CTOR + bool isWindowsVistaOrHigher(); + F32 mVolume; F32 mPan; + bool mSystemIsVistaOrHigher; }; + +bool VolumeCatcherImpl::isWindowsVistaOrHigher() +{ + OSVERSIONINFO osvi; + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&osvi); + return osvi.dwMajorVersion >= 6; +} + VolumeCatcherImpl::VolumeCatcherImpl() -: mVolume(1.0f), // default volume is max - mPan(0.f) // default pan is centered +: mVolume(1.0f), // default volume is max + mPan(0.f) // default pan is centered { - HMODULE handle = ::LoadLibrary(L"winmm.dll"); - if(handle) + mSystemIsVistaOrHigher = isWindowsVistaOrHigher(); + + if ( mSystemIsVistaOrHigher ) { - mSetVolumeFunc = (set_volume_func_t)::GetProcAddress(handle, "setPluginVolume"); - mSetMuteFunc = (set_mute_func_t)::GetProcAddress(handle, "setPluginMute"); + HMODULE handle = ::LoadLibrary(L"winmm.dll"); + if(handle) + { + mSetVolumeFunc = (set_volume_func_t)::GetProcAddress(handle, "setPluginVolume"); + mSetMuteFunc = (set_mute_func_t)::GetProcAddress(handle, "setPluginMute"); + } } } @@ -67,18 +86,29 @@ VolumeCatcherImpl::~VolumeCatcherImpl() { } - void VolumeCatcherImpl::setVolume(F32 volume) { mVolume = volume; - if (mSetMuteFunc) + if ( mSystemIsVistaOrHigher ) { - mSetMuteFunc(volume == 0.f); + // set both left/right to same volume + // TODO: use pan value to set independently + DWORD left_channel = (DWORD)(mVolume * 65535.0f); + DWORD right_channel = (DWORD)(mVolume * 65535.0f); + DWORD hw_volume = left_channel << 16 | right_channel; + ::waveOutSetVolume(NULL, hw_volume); } - if (mSetVolumeFunc) + else { - mSetVolumeFunc(mVolume); + if (mSetMuteFunc) + { + mSetMuteFunc(volume == 0.f); + } + if (mSetVolumeFunc) + { + mSetVolumeFunc(mVolume); + } } } diff --git a/indra/newview/llfloatertexturefetchdebugger.cpp b/indra/newview/llfloatertexturefetchdebugger.cpp index 9157389187..9a23d99802 100644 --- a/indra/newview/llfloatertexturefetchdebugger.cpp +++ b/indra/newview/llfloatertexturefetchdebugger.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2012, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 41bfbae86e..7de66b139f 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -3689,13 +3689,14 @@ public: if (status) { - LL_WARNS("Texture") << "Successfully delivered asset metrics to grid." - << LL_ENDL; + LL_DEBUGS("Texture") << "Successfully delivered asset metrics to grid." + << LL_ENDL; } else { - LL_WARNS("Texture") << "Error delivering asset metrics to grid. Reason: " - << status.toString() << LL_ENDL; + LL_WARNS("Texture") << "Error delivering asset metrics to grid. Status: " + << status.toHex() + << ", Reason: " << status.toString() << LL_ENDL; } } }; // end class AssetReportHandler @@ -3895,11 +3896,15 @@ private: LLTextureFetchDebugger::LLTextureFetchDebugger(LLTextureFetch* fetcher, LLTextureCache* cache, LLImageDecodeThread* imagedecodethread) : + LLCore::HttpHandler(), mFetcher(fetcher), mTextureCache(cache), mImageDecodeThread(imagedecodethread), mHttpHeaders(NULL), - mHttpPolicyClass(fetcher->getPolicyClass()) + mHttpPolicyClass(fetcher->getPolicyClass()), + mNbCurlCompleted(0), + mTempIndex(0), + mHistoryListIndex(0) { init(); } @@ -3925,6 +3930,7 @@ void LLTextureFetchDebugger::init() mDecodingTime = -1.f; mHTTPTime = -1.f; mGLCreationTime = -1.f; + mTotalFetchingTime = 0.f; mRefetchVisCacheTime = -1.f; mRefetchVisHTTPTime = -1.f; @@ -3951,6 +3957,9 @@ void LLTextureFetchDebugger::init() mFreezeHistory = FALSE; mStopDebug = FALSE; mClearHistory = FALSE; + mRefetchNonVis = FALSE; + + mNbCurlRequests = 0; if (! mHttpHeaders) { @@ -4024,7 +4033,8 @@ bool LLTextureFetchDebugger::processStartDebug(F32 max_time) S32 pending = 0; pending += LLAppViewer::getTextureCache()->update(1); pending += LLAppViewer::getImageDecodeThread()->update(1); - pending += LLAppViewer::getTextureFetch()->update(1); + // pending += LLAppViewer::getTextureFetch()->update(1); // This causes infinite recursion in some cases + pending += mNbCurlRequests; if(!pending) { break; @@ -4314,7 +4324,6 @@ void LLTextureFetchDebugger::debugHTTP() { mFetchingHistory[i].mCurlState = FetchEntry::CURL_NOT_DONE; mFetchingHistory[i].mCurlReceivedSize = 0; - mFetchingHistory[i].mHTTPFailCount = 0; mFetchingHistory[i].mFormattedImage = NULL; } mNbCurlRequests = 0; @@ -4338,8 +4347,6 @@ S32 LLTextureFetchDebugger::fillCurlQueue() S32 size = mFetchingHistory.size(); for (S32 i = 0 ; i < size ; i++) { - mNbCurlRequests++; - if (mFetchingHistory[i].mCurlState != FetchEntry::CURL_NOT_DONE) { continue; @@ -4365,15 +4372,22 @@ S32 LLTextureFetchDebugger::fillCurlQueue() mFetchingHistory[i].mHttpHandle = handle; mFetchingHistory[i].mCurlState = FetchEntry::CURL_IN_PROGRESS; mNbCurlRequests++; - // Hack - if (mNbCurlRequests == HTTP_REQUESTS_IN_QUEUE_HIGH_WATER) // emulate normal pipeline + if (mNbCurlRequests >= HTTP_REQUESTS_IN_QUEUE_HIGH_WATER) // emulate normal pipeline { break; } } else { - break; + // Failed to queue request, log it and mark it done. + LLCore::HttpStatus status(mFetcher->getHttpRequest().getStatus()); + + LL_WARNS("Texture") << "Couldn't issue HTTP request in debugger for texture " + << mFetchingHistory[i].mID + << ", status: " << status.toHex() + << " reason: " << status.toString() + << LL_ENDL; + mFetchingHistory[i].mCurlState = FetchEntry::CURL_DONE; } } //llinfos << "Fetch Debugger : Having " << mNbCurlRequests << " requests through the curl thread." << llendl; @@ -4727,14 +4741,13 @@ void LLTextureFetchDebugger::callbackHTTP(FetchEntry & fetch, LLCore::HttpRespon LLCore::HttpStatus status(response->getStatus()); mNbCurlRequests--; + mNbCurlCompleted++; + fetch.mCurlState = FetchEntry::CURL_DONE; if (status) { const bool partial(par_status == status); LLCore::BufferArray * ba(response->getBody()); // *Not* holding reference to body - fetch.mCurlState = FetchEntry::CURL_DONE; - mNbCurlCompleted++; - S32 data_size = ba ? ba->size() : 0; fetch.mCurlReceivedSize += data_size; //llinfos << "Fetch Debugger : got results for " << fetch.mID << ", data_size = " << data_size << ", received = " << fetch.mCurlReceivedSize << ", requested = " << fetch.mRequestedSize << ", partial = " << partial << llendl; @@ -4766,17 +4779,6 @@ void LLTextureFetchDebugger::callbackHTTP(FetchEntry & fetch, LLCore::HttpRespon llinfos << "Fetch Debugger : CURL GET FAILED, ID = " << fetch.mID << ", status: " << status.toHex() << " reason: " << status.toString() << llendl; - fetch.mHTTPFailCount++; - if(fetch.mHTTPFailCount < 5) - { - // Fetch will have to be redone - fetch.mCurlState = FetchEntry::CURL_NOT_DONE; - } - else //skip - { - fetch.mCurlState = FetchEntry::CURL_DONE; - mNbCurlCompleted++; - } } } diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 1e58ba35d4..5ea3c14e1a 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -451,7 +451,6 @@ private: LLPointer<LLImageRaw> mRawImage; e_curl_state mCurlState; S32 mCurlReceivedSize; - S32 mHTTPFailCount; LLCore::HttpHandle mHttpHandle; FetchEntry() : @@ -467,7 +466,6 @@ private: mFetchedSize(f_size), mDecodedSize(d_size), mNeedsAux(false), - mHTTPFailCount(0), mHttpHandle(LLCORE_HTTP_HANDLE_INVALID) {} }; diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index f5d3341c66..1aa9fd8a45 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -160,11 +160,6 @@ void agent_push_backward( EKeystate s ) camera_move_backward(s); return; } - else if (gAgentAvatarp->isSitting()) - { - gAgentCamera.changeCameraToThirdPerson(); - return; - } agent_push_forwardbackward(s, -1, LLAgent::DOUBLETAP_BACKWARD); } |