summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorRobert Knop <prospero@lindenlab.com>2008-12-04 22:36:34 +0000
committerRobert Knop <prospero@lindenlab.com>2008-12-04 22:36:34 +0000
commit189599b6ff0c4e6b81e761fbc990c057189359f2 (patch)
tree1e9e0e91bae9bb1ee53e57ac91cdbbfc9f6dba95 /indra/llmessage
parentfd46865a502036b9e4414e7ec4950faf551b1f14 (diff)
Merging from server/server-1.25 back to trunk.
svn merge -r99446:104838 svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.25 Conflicts resolved by Prospero, except for one scary conflict in SendConfirmationEmail.php which was resolved by jarv.
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llcircuit.cpp33
-rw-r--r--indra/llmessage/llcircuit.h16
-rw-r--r--indra/llmessage/llregionflags.h8
-rw-r--r--indra/llmessage/message.cpp12
-rw-r--r--indra/llmessage/message.h9
5 files changed, 47 insertions, 31 deletions
diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp
index 9ad84d8242..cc05e9bf47 100644
--- a/indra/llmessage/llcircuit.cpp
+++ b/indra/llmessage/llcircuit.cpp
@@ -62,7 +62,6 @@
#include "lltransfermanager.h"
#include "llmodularmath.h"
-const F32 PING_INTERVAL = 5.f; // seconds
const S32 PING_START_BLOCK = 3; // How many pings behind we have to be to consider ourself blocked.
const S32 PING_RELEASE_BLOCK = 2; // How many pings behind we have to be to consider ourself unblocked.
@@ -70,7 +69,8 @@ const F32 TARGET_PERIOD_LENGTH = 5.f; // seconds
const F32 LL_DUPLICATE_SUPPRESSION_TIMEOUT = 60.f; //seconds - this can be long, as time-based cleanup is
// only done when wrapping packetids, now...
-LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id)
+LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,
+ const F32 circuit_heartbeat_interval, const F32 circuit_timeout)
: mHost (host),
mWrapID(0),
mPacketsOutID(0),
@@ -105,7 +105,9 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id)
mPeakBPSOut(0),
mPeriodTime(0.0),
mExistenceTimer(),
- mCurrentResendCount(0)
+ mCurrentResendCount(0),
+ mHeartbeatInterval(circuit_heartbeat_interval),
+ mHeartbeatTimeout(circuit_timeout)
{
// Need to guarantee that this time is up to date, we may be creating a circuit even though we haven't been
// running a message system loop.
@@ -113,9 +115,9 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id)
F32 distribution_offset = ll_frand();
mPingTime = mt_sec;
- mLastPingSendTime = mt_sec + PING_INTERVAL * distribution_offset;
+ mLastPingSendTime = mt_sec + mHeartbeatInterval * distribution_offset;
mLastPingReceivedTime = mt_sec;
- mNextPingSendTime = mLastPingSendTime + 0.95*PING_INTERVAL + ll_frand(0.1f*PING_INTERVAL);
+ mNextPingSendTime = mLastPingSendTime + 0.95*mHeartbeatInterval + ll_frand(0.1f*mHeartbeatInterval);
mPeriodTime = mt_sec;
mTimeoutCallback = NULL;
@@ -429,7 +431,8 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now)
}
-LLCircuit::LLCircuit() : mLastCircuit(NULL)
+LLCircuit::LLCircuit(const F32 circuit_heartbeat_interval, const F32 circuit_timeout) : mLastCircuit(NULL),
+ mHeartbeatInterval(circuit_heartbeat_interval), mHeartbeatTimeout(circuit_timeout)
{
}
@@ -447,7 +450,7 @@ LLCircuitData *LLCircuit::addCircuitData(const LLHost &host, TPACKETID in_id)
{
// This should really validate if one already exists
llinfos << "LLCircuit::addCircuitData for " << host << llendl;
- LLCircuitData *tempp = new LLCircuitData(host, in_id);
+ LLCircuitData *tempp = new LLCircuitData(host, in_id, mHeartbeatInterval, mHeartbeatTimeout);
mCircuitData.insert(circuit_data_map::value_type(host, tempp));
mPingSet.insert(tempp);
@@ -801,7 +804,7 @@ void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys)
// Always remember to remove it from the set before changing the sorting
// key (mNextPingSendTime)
mPingSet.erase(psit);
- cdp->mNextPingSendTime = cur_time + PING_INTERVAL;
+ cdp->mNextPingSendTime = cur_time + mHeartbeatInterval;
mPingSet.insert(cdp);
continue;
}
@@ -819,7 +822,7 @@ void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys)
if (cdp->updateWatchDogTimers(msgsys))
{
// Randomize our pings a bit by doing some up to 5% early or late
- F64 dt = 0.95f*PING_INTERVAL + ll_frand(0.1f*PING_INTERVAL);
+ F64 dt = 0.95f*mHeartbeatInterval + ll_frand(0.1f*mHeartbeatInterval);
// Remove it, and reinsert it with the new next ping time.
// Always remove before changing the sorting key.
@@ -1047,7 +1050,7 @@ BOOL LLCircuitData::checkCircuitTimeout()
F64 time_since_last_ping = LLMessageSystem::getMessageTimeSeconds() - mLastPingReceivedTime;
// Nota Bene: This needs to be turned off if you are debugging multiple simulators
- if (time_since_last_ping > PING_INTERVAL_MAX)
+ if (time_since_last_ping > mHeartbeatTimeout)
{
llwarns << "LLCircuitData::checkCircuitTimeout for " << mHost << " last ping " << time_since_last_ping << " seconds ago." <<llendl;
setAlive(FALSE);
@@ -1063,10 +1066,7 @@ BOOL LLCircuitData::checkCircuitTimeout()
return FALSE;
}
}
- else if (time_since_last_ping > PING_INTERVAL_ALARM)
- {
- //llwarns << "Unresponsive circuit: " << mHost << ": " << time_since_last_ping << " seconds since last ping."<< llendl;
- }
+
return TRUE;
}
@@ -1280,7 +1280,7 @@ void LLCircuitData::pingTimerStop(const U8 ping_id)
delta_ping += 256;
}
- U32 msec = (U32) ((delta_ping*PING_INTERVAL + time) * 1000.f);
+ U32 msec = (U32) ((delta_ping*mHeartbeatInterval + time) * 1000.f);
setPingDelay(msec);
mPingsInTransit = delta_ping;
@@ -1371,7 +1371,8 @@ F32 LLCircuitData::getPingInTransitTime()
if (mPingsInTransit)
{
- time_since_ping_was_sent = (F32)((mPingsInTransit*PING_INTERVAL - 1) + (LLMessageSystem::getMessageTimeSeconds() - mPingTime))*1000.f;
+ time_since_ping_was_sent = (F32)((mPingsInTransit*mHeartbeatInterval - 1)
+ + (LLMessageSystem::getMessageTimeSeconds() - mPingTime))*1000.f;
}
return time_since_ping_was_sent;
diff --git a/indra/llmessage/llcircuit.h b/indra/llmessage/llcircuit.h
index 492313da93..99da6e7aaf 100644
--- a/indra/llmessage/llcircuit.h
+++ b/indra/llmessage/llcircuit.h
@@ -50,10 +50,6 @@
//
// Constants
//
-const F32 PING_INTERVAL_MAX = 100.f;
-const F32 PING_INTERVAL_ALARM = 50.f;
-
-
const F32 LL_AVERAGED_PING_ALPHA = 0.2f; // relaxation constant on ping running average
const F32 LL_AVERAGED_PING_MAX = 2000; // msec
const F32 LL_AVERAGED_PING_MIN = 100; // msec // IW: increased to avoid retransmits when a process is slow
@@ -85,7 +81,8 @@ class LLSD;
class LLCircuitData
{
public:
- LLCircuitData(const LLHost &host, TPACKETID in_id);
+ LLCircuitData(const LLHost &host, TPACKETID in_id,
+ const F32 circuit_heartbeat_interval, const F32 circuit_timeout);
~LLCircuitData();
S32 resendUnackedPackets(const F64 now);
@@ -283,6 +280,9 @@ protected:
S32 mCurrentResendCount; // Number of resent packets since last spam
LLStatRate mOutOfOrderRate; // Rate of out of order packets coming in.
U32 mLastPacketGap; // Gap in sequence number of last packet.
+
+ const F32 mHeartbeatInterval;
+ const F32 mHeartbeatTimeout;
};
@@ -292,7 +292,7 @@ class LLCircuit
{
public:
// CREATORS
- LLCircuit();
+ LLCircuit(const F32 circuit_heartbeat_interval, const F32 circuit_timeout);
~LLCircuit();
// ACCESSORS
@@ -345,5 +345,9 @@ protected:
// optimize the many, many times we call findCircuit. This may be
// set in otherwise const methods, so it is declared mutable.
mutable LLCircuitData* mLastCircuit;
+
+private:
+ const F32 mHeartbeatInterval;
+ const F32 mHeartbeatTimeout;
};
#endif
diff --git a/indra/llmessage/llregionflags.h b/indra/llmessage/llregionflags.h
index 972a184a62..53a1e4ea1a 100644
--- a/indra/llmessage/llregionflags.h
+++ b/indra/llmessage/llregionflags.h
@@ -4,7 +4,7 @@
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
- * Copyright (c) 2002-2007, Linden Research, Inc.
+ * Copyright (c) 2002-2008, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
@@ -60,8 +60,10 @@ const U32 REGION_FLAGS_BLOCK_LAND_RESELL = (1 << 7);
// All content wiped once per night
const U32 REGION_FLAGS_SANDBOX = (1 << 8);
const U32 REGION_FLAGS_NULL_LAYER = (1 << 9);
-const U32 REGION_FLAGS_SKIP_AGENT_ACTION = (1 << 10);
-const U32 REGION_FLAGS_SKIP_UPDATE_INTEREST_LIST= (1 << 11);
+// const U32 REGION_FLAGS_SKIP_AGENT_ACTION = (1 << 10);
+const U32 REGION_FLAGS_HARD_ALLOW_LAND_TRANSFER = (1 << 10); // Region allows land reselling
+// const U32 REGION_FLAGS_SKIP_UPDATE_INTEREST_LIST= (1 << 11);
+const U32 REGION_FLAGS_HARD_ALLOW_POST_CLASSIFIED = (1 << 11); // Region allows posting of classified ads
const U32 REGION_FLAGS_SKIP_COLLISIONS = (1 << 12); // Pin all non agent rigid bodies
const U32 REGION_FLAGS_SKIP_SCRIPTS = (1 << 13);
const U32 REGION_FLAGS_SKIP_PHYSICS = (1 << 14); // Skip all physics
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index 0e2a5cbf7f..7c304bd00b 100644
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -290,7 +290,9 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port,
S32 version_major,
S32 version_minor,
S32 version_patch,
- bool failure_is_fatal)
+ bool failure_is_fatal,
+ const F32 circuit_heartbeat_interval, const F32 circuit_timeout) :
+ mCircuitInfo(circuit_heartbeat_interval, circuit_timeout)
{
init();
@@ -2496,7 +2498,9 @@ bool start_messaging_system(
bool b_dump_prehash_file,
const std::string& secret,
const LLUseCircuitCodeResponder* responder,
- bool failure_is_fatal)
+ bool failure_is_fatal,
+ const F32 circuit_heartbeat_interval,
+ const F32 circuit_timeout)
{
gMessageSystem = new LLMessageSystem(
template_name,
@@ -2504,7 +2508,9 @@ bool start_messaging_system(
version_major,
version_minor,
version_patch,
- failure_is_fatal);
+ failure_is_fatal,
+ circuit_heartbeat_interval,
+ circuit_timeout);
g_shared_secret.assign(secret);
if (!gMessageSystem)
diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h
index 46fa3251de..2f10b149c6 100644
--- a/indra/llmessage/message.h
+++ b/indra/llmessage/message.h
@@ -285,7 +285,8 @@ public:
// Read file and build message templates
LLMessageSystem(const std::string& filename, U32 port, S32 version_major,
S32 version_minor, S32 version_patch,
- bool failure_is_fatal = true);
+ bool failure_is_fatal,
+ const F32 circuit_heartbeat_interval, const F32 circuit_timeout);
~LLMessageSystem();
@@ -780,8 +781,10 @@ bool start_messaging_system(
S32 version_patch,
bool b_dump_prehash_file,
const std::string& secret,
- const LLUseCircuitCodeResponder* responder = NULL,
- bool failure_is_fatal = true);
+ const LLUseCircuitCodeResponder* responder,
+ bool failure_is_fatal,
+ const F32 circuit_heartbeat_interval,
+ const F32 circuit_timeout);
void end_messaging_system();