summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2008-02-28 18:15:01 +0000
committerJosh Bell <josh@lindenlab.com>2008-02-28 18:15:01 +0000
commit2fdd7c35f33d1d98091547b8e96ad9ebf99dee47 (patch)
tree247ba5247139531ac636bb8b9db7ddf3d5ce6203 /indra/llcommon
parent42bc4ba02abebced9fc3e7f91317ae293cbd20dd (diff)
svn merge -r 80357:80990 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-19-1-Server --> release
Merge patches from 1.19.1 Server branch: * QAR-293 Fix for hardcoded TTLs in web dataservices * DEV-10826 fix for busted binary and notation parse if handed an unlimited parse size * Bounce apache2 processes before starting backbone/dataserver/simulator * Changing web-ds TTL in a way that any query that has 0 < ttl <=60 will have ttl = 61. * Partial reversion of multiagent-chat to 1.19.0 to address fast memory leak * Fixed minor, non user facing bug in multiagentchat * set-classified-stats: Rewrote to use new MDB2 query reformatting syntax * Fixed possible bad conversion of vivox data * DEV-550, caching changes to DirClassifieds Query * QAR-240 (DEV-8488) Prevent residents from purging stuff that isn't trash on the backend * More mem leak fixes for multiagent-chat * QAR-274 Fetch inventory descendents over TCP (via HTTP cap) instead of UDP * DEV-10151: Sometimes group IMs appear to be person to person IMs * QAR-321 Changes to crash_reporter * DEV-11004 Speed up people search query using FORCE INDEX (PRIMARY) on the username table if the first-name query fragment is >= 3 chars * DEV-11004 Speed up people search query using FORCE INDEX (PRIMARY). Web service version of this, must use two named queries because we need to change the query based on input string length.
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llsdserialize.cpp14
-rw-r--r--indra/llcommon/llthread.cpp7
-rw-r--r--indra/llcommon/llthread.h10
-rw-r--r--indra/llcommon/llversionserver.h2
4 files changed, 21 insertions, 12 deletions
diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index 02152cfe79..6f4a49180d 100644
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -227,7 +227,8 @@ F64 ll_ntohd(F64 netdouble)
*
* @param istr The stream to read from.
* @param value [out] The string which was found.
- * @param max_bytes The maximum possible length of the string.
+ * @param max_bytes The maximum possible length of the string. Passing in
+ * a negative value will skip this check.
* @return Returns number of bytes read off of the stream. Returns
* PARSE_FAILURE (-1) on failure.
*/
@@ -251,7 +252,8 @@ int deserialize_string_delim(std::istream& istr, std::string& value, char d);
* leading the stream.
* @param value [out] The string which was found.
* @param d The delimiter to use.
- * @param max_bytes The maximum possible length of the string.
+ * @param max_bytes The maximum possible length of the string. Passing in
+ * a negative value will skip this check.
* @return Returns number of bytes read off of the stream. Returns
* PARSE_FAILURE (-1) on failure.
*/
@@ -768,7 +770,7 @@ bool LLSDNotationParser::parseBinary(std::istream& istr, LLSD& data) const
// We probably have a valid raw binary stream. determine
// the size, and read it.
S32 len = strtol(buf + 2, NULL, 0);
- if(len > mMaxBytesLeft) return false;
+ if(mCheckLimits && (len > mMaxBytesLeft)) return false;
std::vector<U8> value;
if(len)
{
@@ -1043,7 +1045,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
U32 size_nbo = 0;
read(istr, (char*)&size_nbo, sizeof(U32)); /*Flawfinder: ignore*/
S32 size = (S32)ntohl(size_nbo);
- if(size > mMaxBytesLeft)
+ if(mCheckLimits && (size > mMaxBytesLeft))
{
parse_count = PARSE_FAILURE;
}
@@ -1179,7 +1181,7 @@ bool LLSDBinaryParser::parseString(
U32 value_nbo = 0;
read(istr, (char*)&value_nbo, sizeof(U32)); /*Flawfinder: ignore*/
S32 size = (S32)ntohl(value_nbo);
- if(size > mMaxBytesLeft) return false;
+ if(mCheckLimits && (size > mMaxBytesLeft)) return false;
std::vector<char> buf;
if(size)
{
@@ -1635,7 +1637,7 @@ int deserialize_string_raw(
// the size, and read it.
// *FIX: This is memory inefficient.
S32 len = strtol(buf + 1, NULL, 0);
- if(len > max_bytes) return LLSDParser::PARSE_FAILURE;
+ if((max_bytes>0)&&(len>max_bytes)) return LLSDParser::PARSE_FAILURE;
std::vector<char> buf;
if(len)
{
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index ea877bda84..02ed0dcfc6 100644
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -31,6 +31,8 @@
#include "linden_common.h"
#include "llapr.h"
+#include "apr-1/apr_portable.h"
+
#include "llthread.h"
#include "lltimer.h"
@@ -225,6 +227,11 @@ void LLThread::setQuitting()
wake();
}
+// static
+U32 LLThread::currentID()
+{
+ return (U32)apr_os_thread_current();
+}
// static
void LLThread::yield()
diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index 8106c08835..a07c64b8fc 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -56,14 +56,14 @@ public:
virtual ~LLThread(); // Warning! You almost NEVER want to destroy a thread unless it's in the STOPPED state.
virtual void shutdown(); // stops the thread
- static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure.
-
-
bool isQuitting() const { return (QUITTING == mStatus); }
bool isStopped() const { return (STOPPED == mStatus); }
- // PAUSE / RESUME functionality. See source code for important usage notes.
+ static U32 currentID(); // Return ID of current thread
+ static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure.
+
public:
+ // PAUSE / RESUME functionality. See source code for important usage notes.
// Called from MAIN THREAD.
void pause();
void unpause();
@@ -127,7 +127,7 @@ protected:
class LLMutex
{
public:
- LLMutex(apr_pool_t *apr_poolp); // Defaults to global pool, could use the thread pool as well.
+ LLMutex(apr_pool_t *apr_poolp); // NULL pool constructs a new pool for the mutex
~LLMutex();
void lock(); // blocks
diff --git a/indra/llcommon/llversionserver.h b/indra/llcommon/llversionserver.h
index b7c525be98..b9aa71b4dc 100644
--- a/indra/llcommon/llversionserver.h
+++ b/indra/llcommon/llversionserver.h
@@ -35,7 +35,7 @@
const S32 LL_VERSION_MAJOR = 1;
const S32 LL_VERSION_MINOR = 19;
const S32 LL_VERSION_PATCH = 1;
-const S32 LL_VERSION_BUILD = 80264;
+const S32 LL_VERSION_BUILD = 80913;
const char * const LL_CHANNEL = "Second Life Server";