diff --git a/README b/README
index a441bfedf..8d470c1c9 100644
--- a/README
+++ b/README
@@ -15,8 +15,8 @@ Singularity Viewer is a SecondLife(tm) protocol compatible client application.
It can be used to access SecondLife services as well as a number of others such
as those based upon the OpenSim platform.
-Singulariy is maintained by a small group of volunteers who can be contacted
-both, in-world (SingularityViewer group) as well on IRC (#SingularityViewer
+Singularity is maintained by a small group of volunteers who can be contacted
+both, in-world (SingularityViewer group) as well as on IRC (#SingularityViewer
@ FreeNode). Bug requests and features requests can be submitted through our
Issue Tracker (http://code.google.com/p/singularity-viewer/issues/list or from
the viewer menu: Help --> Bug Reporting --> Singularity Issue Tracker...)
diff --git a/indra/cmake/ConfigurePkgConfig.cmake b/indra/cmake/ConfigurePkgConfig.cmake
index 82ee3e7a5..afbc36d63 100644
--- a/indra/cmake/ConfigurePkgConfig.cmake
+++ b/indra/cmake/ConfigurePkgConfig.cmake
@@ -14,7 +14,7 @@ IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "")
else (WORD_SIZE EQUAL 32)
SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib64 /usr/lib)
SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib64 /usr/local/lib)
- SET(PKG_CONFIG_MULTI_GUESS /usr/local/lib/x86_64-linux-gnu)
+ SET(PKG_CONFIG_MULTI_GUESS /usr/lib/x86_64-linux-gnu)
SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu)
endif (WORD_SIZE EQUAL 32)
diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp
index 7de5ba69d..3db9c077d 100644
--- a/indra/llimagej2coj/llimagej2coj.cpp
+++ b/indra/llimagej2coj/llimagej2coj.cpp
@@ -133,6 +133,26 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
parameters.cp_reduce = base.getRawDiscardLevel();
+ if(parameters.cp_reduce == 0 && *(U16*)(base.getData() + base.getDataSize() - 2) != 0xD9FF)
+ {
+ bool failed = true;
+ for(S32 i = base.getDataSize()-1; i > 42; --i)
+ {
+ if(base.getData()[i] != 0x00)
+ {
+ failed = *(U16*)(base.getData()+i-1) != 0xD9FF;
+ break;
+ }
+ }
+ if(failed)
+ {
+ opj_image_destroy(image);
+ base.decodeFailed();
+ return TRUE;
+ }
+ }
+
+
/* decode the code-stream */
/* ---------------------- */
@@ -212,7 +232,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
if(image->numcomps <= first_channel)
{
- llwarns << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << llendl;
+ LL_WARNS("Texture") << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << llendl;
if (image)
{
opj_image_destroy(image);
diff --git a/indra/llmessage/aicurleasyrequeststatemachine.cpp b/indra/llmessage/aicurleasyrequeststatemachine.cpp
index ed2bf820d..0437055f5 100644
--- a/indra/llmessage/aicurleasyrequeststatemachine.cpp
+++ b/indra/llmessage/aicurleasyrequeststatemachine.cpp
@@ -116,6 +116,15 @@ void AICurlEasyRequestStateMachine::multiplex_impl(state_type run_state)
{
set_state(AICurlEasyRequestStateMachine_waitAdded);
idle(); // Wait till AICurlEasyRequestStateMachine::added_to_multi_handle() is called.
+
+ // This is a work around for the case that this request had a bad url, in order to avoid a crash later on.
+ bool empty_url = AICurlEasyRequest_rat(*mCurlEasyRequest)->getLowercaseServicename().empty();
+ if (empty_url)
+ {
+ abort();
+ break;
+ }
+
// Only AFTER going idle, add request to curl thread; this is needed because calls to set_state() are
// ignored when the statemachine is not idle, and theoretically the callbacks could be called
// immediately after this call.
diff --git a/indra/llmessage/aicurlperservice.cpp b/indra/llmessage/aicurlperservice.cpp
index 8a58e2c98..af01e94f0 100644
--- a/indra/llmessage/aicurlperservice.cpp
+++ b/indra/llmessage/aicurlperservice.cpp
@@ -214,7 +214,7 @@ std::string AIPerService::extract_canonical_servicename(std::string const& url)
}
++p;
}
- // Strip of any trailing ":80".
+ // Strip off any trailing ":80".
if (p - 3 == port_colon && p[-1] == '0' && p[-2] == '8')
{
return servicename.substr(0, p - hostname - 3);
diff --git a/indra/llmessage/llhost.cpp b/indra/llmessage/llhost.cpp
index 61a84de8e..9bf94ef3f 100644
--- a/indra/llmessage/llhost.cpp
+++ b/indra/llmessage/llhost.cpp
@@ -59,11 +59,12 @@ LLHost::LLHost(const std::string& ip_and_port)
mIP = ip_string_to_u32(ip_str.c_str());
mPort = atol(port_str.c_str());
}
+ mHostNotFound = 0;
}
std::string LLHost::getString() const
{
- return llformat("%s:%u", u32_to_ip_string(mIP), mPort);
+ return llformat("%s:%hu", u32_to_ip_string(mIP), mPort);
}
@@ -87,16 +88,27 @@ std::string LLHost::getHostName() const
llwarns << "LLHost::getHostName() : Invalid IP address" << llendl;
return std::string();
}
+ if (mHostNotFound)
+ {
+ // We already checked this... avoid freezing the viewer 5 seconds again and again.
+ llwarns << "LLHost::getHostName() : Returning cached HOST_NOT_FOUND." << llendl;
+ return std::string();
+ }
he = gethostbyaddr((char *)&mIP, sizeof(mIP), AF_INET);
if (!he)
{
#if LL_WINDOWS
- llwarns << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: "
- << WSAGetLastError() << llendl;
+ int err = WSAGetLastError();
+ int err_host_not_found = WSAHOST_NOT_FOUND;
#else
- llwarns << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: "
- << h_errno << llendl;
+ int err = h_errno;
+ int err_host_not_found = HOST_NOT_FOUND;
#endif
+ llwarns << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: " << err << llendl;
+ if (err == err_host_not_found)
+ {
+ mHostNotFound = 1;
+ }
return std::string();
}
else
@@ -125,6 +137,7 @@ BOOL LLHost::setHostByName(const std::string& hostname)
if (he)
{
mIP = *(U32 *)he->h_addr_list[0];
+ mHostNotFound = 0;
return TRUE;
}
else
diff --git a/indra/llmessage/llhost.h b/indra/llmessage/llhost.h
index 0cf52a415..8d7f6be63 100644
--- a/indra/llmessage/llhost.h
+++ b/indra/llmessage/llhost.h
@@ -38,7 +38,8 @@ const U32 INVALID_HOST_IP_ADDRESS = 0x0;
class LLHost {
protected:
- U32 mPort;
+ U16 mPort;
+ mutable U16 mHostNotFound; // Singularity addition; caches a failed IP -> hostname lookup.
U32 mIP;
public:
@@ -47,17 +48,20 @@ public:
// CREATORS
LLHost()
: mPort(INVALID_PORT),
+ mHostNotFound(1),
mIP(INVALID_HOST_IP_ADDRESS)
{ } // STL's hash_map expect this T()
LLHost( U32 ipv4_addr, U32 port )
- : mPort( port )
+ : mPort(port),
+ mHostNotFound(0)
{
mIP = ipv4_addr;
}
LLHost( const std::string& ipv4_addr, U32 port )
- : mPort( port )
+ : mPort(port),
+ mHostNotFound(0)
{
mIP = ip_string_to_u32(ipv4_addr.c_str());
}
@@ -68,6 +72,7 @@ public:
U32 port = (U32)(ip_port & (U64)0xFFFFFFFF);
mIP = ip;
mPort = port;
+ mHostNotFound = 0;
}
explicit LLHost(const std::string& ip_and_port);
@@ -76,15 +81,15 @@ public:
{ }
// MANIPULATORS
- void set( U32 ip, U32 port ) { mIP = ip; mPort = port; }
- void set( const std::string& ipstr, U32 port ) { mIP = ip_string_to_u32(ipstr.c_str()); mPort = port; }
- void setAddress( const std::string& ipstr ) { mIP = ip_string_to_u32(ipstr.c_str()); }
- void setAddress( U32 ip ) { mIP = ip; }
+ void set( U32 ip, U32 port ) { mIP = ip; mPort = port; mHostNotFound = 0; }
+ void set( const std::string& ipstr, U32 port ) { mIP = ip_string_to_u32(ipstr.c_str()); mPort = port; mHostNotFound = 0; }
+ void setAddress( const std::string& ipstr ) { mIP = ip_string_to_u32(ipstr.c_str()); mHostNotFound = 0; }
+ void setAddress( U32 ip ) { mIP = ip; mHostNotFound = 0; }
void setPort( U32 port ) { mPort = port; }
BOOL setHostByName(const std::string& hname);
LLHost& operator=(const LLHost &rhs);
- void invalidate() { mIP = INVALID_HOST_IP_ADDRESS; mPort = INVALID_PORT;};
+ void invalidate() { mIP = INVALID_HOST_IP_ADDRESS; mPort = INVALID_PORT; mHostNotFound = 1; }
// READERS
U32 getAddress() const { return mIP; }
diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp
index 271afa5e9..1289085b7 100644
--- a/indra/llvfs/lldir_win32.cpp
+++ b/indra/llvfs/lldir_win32.cpp
@@ -48,8 +48,28 @@ LLDir_Win32::LLDir_Win32()
WCHAR w_str[MAX_PATH];
+ HRESULT (WINAPI* pSHGetKnownFolderPath)(REFKNOWNFOLDERID rfid, DWORD dwFlags, HANDLE hToken, PWSTR *ppszPath) = NULL;
+ HMODULE shell = LoadLibrary(L"shell32");
+ if(shell) //SHGetSpecialFolderPath is deprecated from Vista an onwards. Try to use SHGetKnownFolderPath if it's available
+ {
+ pSHGetKnownFolderPath = (HRESULT (WINAPI *)(REFKNOWNFOLDERID, DWORD, HANDLE, PWSTR *))GetProcAddress(shell, "SHGetKnownFolderPath");
+ }
+
// Application Data is where user settings go
- SHGetSpecialFolderPath(NULL, w_str, CSIDL_APPDATA, TRUE);
+ if(pSHGetKnownFolderPath)
+ {
+ WCHAR* pPath = NULL;
+ if((*pSHGetKnownFolderPath)(FOLDERID_RoamingAppData, 0, NULL, &pPath) == S_OK)
+ wcscpy_s(w_str,pPath);
+ else
+ SHGetSpecialFolderPath(NULL, w_str, CSIDL_APPDATA, TRUE);
+ if(pPath)
+ CoTaskMemFree(pPath);
+ }
+ else //XP doesn't support SHGetKnownFolderPath
+ {
+ SHGetSpecialFolderPath(NULL, w_str, CSIDL_APPDATA, TRUE);
+ }
mOSUserDir = utf16str_to_utf8str(llutf16string(w_str));
@@ -64,17 +84,14 @@ LLDir_Win32::LLDir_Win32()
// We used to store the cache in AppData\Roaming, and the installer
// cleans up that version on upgrade. JC
- if(HMODULE shell = LoadLibrary(L"shell32")) //SHGetSpecialFolderPath is deprecated from Vista an onwards. Try to use SHGetSpecialFolderPath if it's available
+
+ if(pSHGetKnownFolderPath)
{
- HRESULT (WINAPI* pSHGetKnownFolderPath)(REFKNOWNFOLDERID rfid, DWORD dwFlags, HANDLE hToken, PWSTR *ppszPath);
- pSHGetKnownFolderPath = (HRESULT (WINAPI *)(REFKNOWNFOLDERID, DWORD, HANDLE, PWSTR *))GetProcAddress(shell, "SHGetKnownFolderPath");
WCHAR* pPath = NULL;
- if(pSHGetKnownFolderPath && (*pSHGetKnownFolderPath)(FOLDERID_LocalAppData, 0, NULL, &pPath) == S_OK)
+ if((*pSHGetKnownFolderPath)(FOLDERID_LocalAppData, 0, NULL, &pPath) == S_OK)
wcscpy_s(w_str,pPath);
else
SHGetSpecialFolderPath(NULL, w_str, CSIDL_LOCAL_APPDATA, TRUE);
-
- FreeLibrary(shell);
if(pPath)
CoTaskMemFree(pPath);
}
@@ -82,6 +99,10 @@ LLDir_Win32::LLDir_Win32()
{
SHGetSpecialFolderPath(NULL, w_str, CSIDL_LOCAL_APPDATA, TRUE);
}
+
+ if(shell)
+ FreeLibrary(shell);
+
mOSCacheDir = utf16str_to_utf8str(llutf16string(w_str));
if (GetTempPath(MAX_PATH, w_str))
diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml
index 9e9be14bb..0e589e602 100644
--- a/indra/newview/app_settings/low_graphics.xml
+++ b/indra/newview/app_settings/low_graphics.xml
@@ -25,7 +25,7 @@
-
+
diff --git a/indra/newview/app_settings/mid_graphics.xml b/indra/newview/app_settings/mid_graphics.xml
index 4c1ec5494..3e22920b9 100644
--- a/indra/newview/app_settings/mid_graphics.xml
+++ b/indra/newview/app_settings/mid_graphics.xml
@@ -25,7 +25,7 @@
-
+
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 7e7bb4796..297648a40 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -846,6 +846,17 @@ Found in Advanced->Rendering->Info Displays
Value
0
+ SLBShowFPS
+
LogShowHistoryLines
-
+
RenderNoAlpha