diff options
author | Josh Bell <josh@lindenlab.com> | 2008-06-06 22:52:02 +0000 |
---|---|---|
committer | Josh Bell <josh@lindenlab.com> | 2008-06-06 22:52:02 +0000 |
commit | 810a0b3dcee41ec657c94ccb26003b9b4e20e141 (patch) | |
tree | 5b06ec8662957b3218fde311983acd9ac5043c75 /indra/llcommon | |
parent | ad332810078a0bbb8fa08fcbfdf3d756de6914f6 (diff) |
svn merge -r 88872:89137 svn+ssh://svn.lindenlab.com/svn/linden/qa/qar-652 --> release
Effectively:
svn merge -r 87048:88773 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-22-Server
* Plus some gcc4.x fixes
In detail:
* Bump version numbers to 1.22.0 Server
* Updated files for enabled conductor.
* Added tarball pulling during deploy for central servers.
* DEV-15160 Logins not remembering start location on beta grid
* DEV-15167 Random failure with set-classified-stats
* DEV-15193 Viewer Passing Through Unsanitized Strings to DB when creating classifieds.
* Add --location to the curl invocation in fetch_agni_ws_snapshot
* QAR-609 Some Havok4 bug fixes
* QAR-460 Automatic XUI selection & Kick-ass Linux Fonts MergeMe
* DEV-14704 1.21.1.86182 revealing hidden groups in profile
* DEV-14641 Change automated Subject Line messages for IM-to-Email to avoid SPAM association
* DEV-15387 Write unit test for LLStringFn::strip_invalid_xml().
* Changed getpass.getuser() to os.getuid() as getuser() was returning the saved-UID of the process (root user, which kic
ks off parabuild as parabuild u
ser). We want os.getuid() as it correctly returns the parabuild user's uid. / Stupid mistake using os.getuid().. .fixed
by using the pwd module to return the unix username given the userid from os.getuid()
* QAR-623 More single ref attachment awesomeness testing
* Committed temporary fix for running dwell and query-cache on deneb.lindenlab.com, since it's in the DFW colo with the
current asset cluster.
* DEV-15783 Groups not shown in search wont appear in your profile while using webservice
* QAR-642 Even more single ref attachment awesomeness testing
From Branch_1-21-Server (which didn't go directly into release)
* addinng the phputf8 library found from http://phputf8.sourceforge.net/ and liscensed LGPL. For DEV-15202
* Checking in a fix for settle balance portion proc - the event query was moved.
* fix for DEV-15202 - replace non-utf8 with REPLACEMENT CHAR. See jira for more info.
* Checking return value from /proc/vault/charge, must get back a string.
* removed code used for the browser hud AB test.
* Changed TTL from stupid default of 1234 to 5
* DEV-15788 Fixing crashloganalyzer.py cleanup of unparseable crash reports.
* DEV-15737 offline scripted IMs not working inprocess_im_using_ws
Merge conflict resolutions/fixes include:
* Addition of indra/test/llstring_tut.cpp to indra/test/test.vcproj migrated to CMakeLists.txt
* Changes to BuildParams, scripts/automated_build_scripts/* reviewed w/ cg
* Changes to deploy scripts (scripts/farm, install_indra.py, farm_deploy) based on the 1.22 changes except for mkpersist
dir addition (retained from release)
* Changes to scripts/crash_report/crashloganalyzer.py retained from 1.22, per Mani
* scripts/generate_indra_xml.py, etc/services-station.dtd, indra/newsim/llagentinfo.cpp analyzed carefully by josh
* indra/llcommon/llstring.h required fix for client build ("" --> std::basic_string<T>()) in LLStringBase<T> initializer
* indra/llphysics/abstract/llphysicsshape.h #include syntax changed from <llmath/llvolume.h> to "llvolume.h"
Psst, don't tell anyone, but the dataserver-is-deprecated
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/indra_constants.h | 12 | ||||
-rw-r--r-- | indra/llcommon/llapp.cpp | 1 | ||||
-rw-r--r-- | indra/llcommon/llframetimer.cpp | 1 | ||||
-rw-r--r-- | indra/llcommon/llframetimer.h | 8 | ||||
-rw-r--r-- | indra/llcommon/llkeythrottle.h | 83 | ||||
-rw-r--r-- | indra/llcommon/llstring.cpp | 26 | ||||
-rw-r--r-- | indra/llcommon/llstring.h | 21 | ||||
-rw-r--r-- | indra/llcommon/llversionserver.h | 6 |
8 files changed, 117 insertions, 41 deletions
diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index a0b1293639..5697fb9f41 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -38,7 +38,11 @@ // At 45 Hz collisions seem stable and objects seem // to settle down at a reasonable rate. // JC 3/18/2003 -const F32 PHYSICS_TIMESTEP = 1.f / 45.f; + +// const F32 PHYSICS_TIMESTEP = 1.f / 45.f; +// This must be a #define due to anal retentive restrictions on const expressions +// CG 2008-06-05 +#define PHYSICS_TIMESTEP (1.f / 45.f) const F32 COLLISION_TOLERANCE = 0.1f; const F32 HALF_COLLISION_TOLERANCE = COLLISION_TOLERANCE * 0.5f; @@ -50,9 +54,9 @@ const U32 DAYS_PER_LINDEN_YEAR = 11; const U32 SEC_PER_LINDEN_DAY = HOURS_PER_LINDEN_DAY * 60 * 60; const U32 SEC_PER_LINDEN_YEAR = DAYS_PER_LINDEN_YEAR * SEC_PER_LINDEN_DAY; -const F32 REGION_WIDTH_METERS = 256.f; -const S32 REGION_WIDTH_UNITS = 256; -const U32 REGION_WIDTH_U32 = 256; +static const F32 REGION_WIDTH_METERS = 256.f; +static const S32 REGION_WIDTH_UNITS = 256; +static const U32 REGION_WIDTH_U32 = 256; const F32 REGION_HEIGHT_METERS = 4096.f; diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 2c7c7e38a4..8826251617 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -224,6 +224,7 @@ LLSD LLApp::getOptionData(OptionPriority level) void LLApp::stepFrame() { LLFrameTimer::updateFrameTime(); + LLFrameTimer::updateFrameCount(); LLEventTimer::updateClass(); mRunner.run(); } diff --git a/indra/llcommon/llframetimer.cpp b/indra/llcommon/llframetimer.cpp index b74151bc2a..a61c5bda81 100644 --- a/indra/llcommon/llframetimer.cpp +++ b/indra/llcommon/llframetimer.cpp @@ -53,7 +53,6 @@ void LLFrameTimer::updateFrameTime() sTotalTime = total_time; sTotalSeconds = U64_to_F64(sTotalTime) * USEC_TO_SEC_F64; sFrameTime = U64_to_F64(sTotalTime - sStartTotalTime) * USEC_TO_SEC_F64; - sFrameCount++; } void LLFrameTimer::start() diff --git a/indra/llcommon/llframetimer.h b/indra/llcommon/llframetimer.h index 2998560ab9..7ef92f64e4 100644 --- a/indra/llcommon/llframetimer.h +++ b/indra/llcommon/llframetimer.h @@ -67,10 +67,14 @@ public: return sTotalSeconds; } - // Call this method once per frame to update the current frame time. + // Call this method once per frame to update the current frame time. This is actually called + // at some other times as well static void updateFrameTime(); - static S32 getFrameCount() { return sFrameCount; } + // Call this method once, and only once, per frame to update the current frame count. + static void updateFrameCount() { sFrameCount++; } + + static U32 getFrameCount() { return sFrameCount; } static F32 getFrameDeltaTimeF32(); diff --git a/indra/llcommon/llkeythrottle.h b/indra/llcommon/llkeythrottle.h index d831eadd59..61a43b2dad 100644 --- a/indra/llcommon/llkeythrottle.h +++ b/indra/llcommon/llkeythrottle.h @@ -68,20 +68,24 @@ protected: U32 countLimit; // maximum number of keys allowed per interval - U64 interval_usec; - // each map covers this time period - U64 start_usec; + U64 intervalLength; // each map covers this time period (usec or frame number) + U64 startTime; // start of the time period (usec or frame number) + // currMap started counting at this time // prevMap covers the previous interval LLKeyThrottleImpl() : prevMap(0), currMap(0), - countLimit(0), interval_usec(0), - start_usec(0) { }; + countLimit(0), intervalLength(1), + startTime(0) { }; static U64 getTime() { return LLFrameTimer::getTotalTime(); } + static U64 getFrame() // Return the current frame number + { + return (U64) LLFrameTimer::getFrameCount(); + } }; @@ -89,17 +93,10 @@ template< class T > class LLKeyThrottle { public: - LLKeyThrottle(U32 limit, F32 interval) + LLKeyThrottle(U32 limit, F32 interval, BOOL realtime = TRUE) // realtime = FALSE for frame-based throttle, TRUE for usec real-time throttle : m(* new LLKeyThrottleImpl<T>) { - // limit is the maximum number of keys - // allowed per interval (in seconds) - m.countLimit = limit; - m.interval_usec = (U64)(interval * USEC_PER_SEC); - m.start_usec = LLKeyThrottleImpl<T>::getTime(); - - m.prevMap = new typename LLKeyThrottleImpl<T>::EntryMap; - m.currMap = new typename LLKeyThrottleImpl<T>::EntryMap; + setParameters( limit, interval, realtime ); } ~LLKeyThrottle() @@ -118,18 +115,26 @@ public: // call each time the key wants use State noteAction(const T& id, S32 weight = 1) { - U64 now = LLKeyThrottleImpl<T>::getTime(); + U64 now = 0; + if ( mIsRealtime ) + { + now = LLKeyThrottleImpl<T>::getTime(); + } + else + { + now = LLKeyThrottleImpl<T>::getFrame(); + } - if (now >= (m.start_usec + m.interval_usec)) + if (now >= (m.startTime + m.intervalLength)) { - if (now < (m.start_usec + 2 * m.interval_usec)) + if (now < (m.startTime + 2 * m.intervalLength)) { // prune old data delete m.prevMap; m.prevMap = m.currMap; m.currMap = new typename LLKeyThrottleImpl<T>::EntryMap; - m.start_usec += m.interval_usec; + m.startTime += m.intervalLength; } else { @@ -139,7 +144,7 @@ public: m.prevMap = new typename LLKeyThrottleImpl<T>::EntryMap; m.currMap = new typename LLKeyThrottleImpl<T>::EntryMap; - m.start_usec = now; + m.startTime = now; } } @@ -166,7 +171,7 @@ public: // (now) time. // compute current, windowed rate - F64 timeInCurrent = ((F64)(now - m.start_usec) / m.interval_usec); + F64 timeInCurrent = ((F64)(now - m.startTime) / m.intervalLength); F64 averageCount = curr.count + prevCount * (1.0 - timeInCurrent); curr.blocked |= averageCount > m.countLimit; @@ -224,8 +229,46 @@ public: return FALSE; } + // Get the throttling parameters + void getParameters( U32 & out_limit, F32 & out_interval, BOOL & out_realtime ) + { + out_limit = m.countLimit; + out_interval = m.intervalLength; + out_realtime = mIsRealtime; + } + + // Set the throttling behavior + void setParameters( U32 limit, F32 interval, BOOL realtime ) + { + // limit is the maximum number of keys + // allowed per interval (in seconds or frames) + mIsRealtime = realtime; + m.countLimit = limit; + if ( mIsRealtime ) + { + m.intervalLength = (U64)(interval * USEC_PER_SEC); + m.startTime = LLKeyThrottleImpl<T>::getTime(); + } + else + { + m.intervalLength = (U64)interval; + m.startTime = LLKeyThrottleImpl<T>::getFrame(); + } + + if ( m.intervalLength == 0 ) + { // Don't allow zero intervals + m.intervalLength = 1; + } + + delete m.prevMap; + m.prevMap = new typename LLKeyThrottleImpl<T>::EntryMap; + delete m.currMap; + m.currMap = new typename LLKeyThrottleImpl<T>::EntryMap; + } + protected: LLKeyThrottleImpl<T>& m; + BOOL mIsRealtime; // TRUE to be time based (default), FALSE for frame based }; #endif diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 7a2d42dfaa..3a8756a31f 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -929,6 +929,32 @@ namespace LLStringFn } } } + + // https://wiki.lindenlab.com/wiki/Unicode_Guidelines has details on + // allowable code points for XML. Specifically, they are: + // 0x09, 0x0a, 0x0d, and 0x20 on up. JC + std::string strip_invalid_xml(const std::string& input) + { + std::string output; + output.reserve( input.size() ); + std::string::const_iterator it = input.begin(); + while (it != input.end()) + { + // Must compare as unsigned for >= + // Test most likely match first + const unsigned char c = (unsigned char)*it; + if ( c >= (unsigned char)0x20 // SPACE + || c == (unsigned char)0x09 // TAB + || c == (unsigned char)0x0a // LINE_FEED + || c == (unsigned char)0x0d ) // CARRIAGE_RETURN + { + output.push_back(c); + } + ++it; + } + return output; + } + } diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 8a1e1fe8cb..18cfe4b64c 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -545,6 +545,13 @@ namespace LLStringFn */ void replace_nonprintable_and_pipe(std::basic_string<llwchar>& str, llwchar replacement); + + /** + * @brief Remove all characters that are not allowed in XML 1.0. + * Returns a copy of the string with those characters removed. + * Works with US ASCII and UTF-8 encoded strings. JC + */ + std::string strip_invalid_xml(const std::string& input); } //////////////////////////////////////////////////////////// @@ -739,17 +746,9 @@ LLStringBase<T>::LLStringBase(const T* s, size_type n ) : std::basic_string<T>() // Init from a substring template<class T> -LLStringBase<T>::LLStringBase(const T* s, size_type pos, size_type n ) : std::basic_string<T>() -{ - if( s ) - { - assign(s + pos, n); - } - else - { - assign(LLStringBase<T>::null); - } -} +LLStringBase<T>::LLStringBase(const T* s, size_type pos, size_type n ) +: std::basic_string<T>( (s ? s : std::basic_string<T>() ), pos, n ) +{ } //static template<class T> diff --git a/indra/llcommon/llversionserver.h b/indra/llcommon/llversionserver.h index 291f6d6347..97472ea208 100644 --- a/indra/llcommon/llversionserver.h +++ b/indra/llcommon/llversionserver.h @@ -33,9 +33,9 @@ #define LL_LLVERSIONSERVER_H const S32 LL_VERSION_MAJOR = 1; -const S32 LL_VERSION_MINOR = 21; -const S32 LL_VERSION_PATCH = 1; -const S32 LL_VERSION_BUILD = 86526; +const S32 LL_VERSION_MINOR = 22; +const S32 LL_VERSION_PATCH = 2; +const S32 LL_VERSION_BUILD = 87048; const char * const LL_CHANNEL = "Second Life Server"; |