Merge remote-tracking branch 'shyotl/breakforce' into breakforce

This commit is contained in:
Aleric Inglewood
2012-08-10 05:56:28 +02:00
9 changed files with 40 additions and 28 deletions

View File

@@ -56,6 +56,7 @@
#include "llstl.h" #include "llstl.h"
#include "lltransfermanager.h" #include "lltransfermanager.h"
#include "llmodularmath.h" #include "llmodularmath.h"
#include "llpacketring.h"
const S32 PING_START_BLOCK = 3; // How many pings behind we have to be to consider ourself blocked. 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. const S32 PING_RELEASE_BLOCK = 2; // How many pings behind we have to be to consider ourself unblocked.
@@ -346,7 +347,7 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now)
packetp->mBuffer[0] |= LL_RESENT_FLAG; // tag packet id as being a resend packetp->mBuffer[0] |= LL_RESENT_FLAG; // tag packet id as being a resend
gMessageSystem->mPacketRing.sendPacket(packetp->mSocket, gMessageSystem->mPacketRing->sendPacket(packetp->mSocket,
(char *)packetp->mBuffer, packetp->mBufferLength, (char *)packetp->mBuffer, packetp->mBufferLength,
packetp->mHost); packetp->mHost);

View File

@@ -32,7 +32,7 @@
#include "llhost.h" #include "llhost.h"
#include "llpacketbuffer.h" #include "llpacketbuffer.h"
#include "llproxy.h" //#include "llproxy.h"
#include "llthrottle.h" #include "llthrottle.h"
#include "net.h" #include "net.h"

View File

@@ -81,6 +81,7 @@
#include "v4math.h" #include "v4math.h"
#include "lltransfertargetvfile.h" #include "lltransfertargetvfile.h"
#include "llmemtype.h" #include "llmemtype.h"
#include "llpacketring.h"
// Constants // Constants
//const char* MESSAGE_LOG_FILENAME = "message.log"; //const char* MESSAGE_LOG_FILENAME = "message.log";
@@ -245,7 +246,8 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port,
bool failure_is_fatal, bool failure_is_fatal,
const F32 circuit_heartbeat_interval, const F32 circuit_timeout) : const F32 circuit_heartbeat_interval, const F32 circuit_timeout) :
mCircuitInfo(circuit_heartbeat_interval, circuit_timeout), mCircuitInfo(circuit_heartbeat_interval, circuit_timeout),
mLastMessageFromTrustedMessageService(false) mLastMessageFromTrustedMessageService(false),
mPacketRing(new LLPacketRing)
{ {
init(); init();
@@ -383,6 +385,9 @@ LLMessageSystem::~LLMessageSystem()
delete mPollInfop; delete mPollInfop;
mPollInfop = NULL; mPollInfop = NULL;
delete mPacketRing;
mPacketRing = NULL;
mIncomingCompressedSize = 0; mIncomingCompressedSize = 0;
mCurrentRecvPacketID = 0; mCurrentRecvPacketID = 0;
} }
@@ -548,13 +553,13 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
U8* buffer = mTrueReceiveBuffer; U8* buffer = mTrueReceiveBuffer;
mTrueReceiveSize = mPacketRing.receivePacket(mSocket, (char *)mTrueReceiveBuffer); mTrueReceiveSize = mPacketRing->receivePacket(mSocket, (char *)mTrueReceiveBuffer);
// If you want to dump all received packets into SecondLife.log, uncomment this // If you want to dump all received packets into SecondLife.log, uncomment this
//dumpPacketToLog(); //dumpPacketToLog();
receive_size = mTrueReceiveSize; receive_size = mTrueReceiveSize;
mLastSender = mPacketRing.getLastSender(); mLastSender = mPacketRing->getLastSender();
mLastReceivingIF = mPacketRing.getLastReceivingInterface(); mLastReceivingIF = mPacketRing->getLastReceivingInterface();
if (receive_size < (S32) LL_MINIMUM_VALID_PACKET_SIZE) if (receive_size < (S32) LL_MINIMUM_VALID_PACKET_SIZE)
{ {
@@ -1129,7 +1134,7 @@ S32 LLMessageSystem::flushReliable(const LLHost &host)
return send_bytes; return send_bytes;
} }
LLHTTPClient::ResponderPtr LLMessageSystem::createResponder(const std::string& name) LLFnPtrResponder* LLMessageSystem::createResponder(const std::string& name)
{ {
if(mSendReliable) if(mSendReliable)
{ {
@@ -1328,7 +1333,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
} }
BOOL success; BOOL success;
success = mPacketRing.sendPacket(mSocket, (char *)buf_ptr, buffer_length, host); success = mPacketRing->sendPacket(mSocket, (char *)buf_ptr, buffer_length, host);
if (!success) if (!success)
{ {
@@ -3361,7 +3366,7 @@ void LLMessageSystem::establishBidirectionalTrust(const LLHost &host, S64 frame_
void LLMessageSystem::dumpPacketToLog() void LLMessageSystem::dumpPacketToLog()
{ {
LL_WARNS("Messaging") << "Packet Dump from:" << mPacketRing.getLastSender() << llendl; LL_WARNS("Messaging") << "Packet Dump from:" << mPacketRing->getLastSender() << llendl;
LL_WARNS("Messaging") << "Packet Size:" << mTrueReceiveSize << llendl; LL_WARNS("Messaging") << "Packet Size:" << mTrueReceiveSize << llendl;
char line_buffer[256]; /* Flawfinder: ignore */ char line_buffer[256]; /* Flawfinder: ignore */
S32 i; S32 i;

View File

@@ -48,9 +48,9 @@
#include "string_table.h" #include "string_table.h"
#include "llcircuit.h" #include "llcircuit.h"
#include "lltimer.h" #include "lltimer.h"
#include "llpacketring.h" //#include "llpacketring.h"
#include "llhost.h" #include "llhost.h"
#include "llhttpclient.h" //#include "llhttpclient.h"
#include "llhttpnode.h" #include "llhttpnode.h"
#include "llpacketack.h" #include "llpacketack.h"
#include "llsingleton.h" #include "llsingleton.h"
@@ -61,6 +61,12 @@
#include "llstoredmessage.h" #include "llstoredmessage.h"
class LLPacketRing;
namespace
{
class LLFnPtrResponder;
}
const U32 MESSAGE_MAX_STRINGS_LENGTH = 64; const U32 MESSAGE_MAX_STRINGS_LENGTH = 64;
const U32 MESSAGE_NUMBER_OF_HASH_BUCKETS = 8192; const U32 MESSAGE_NUMBER_OF_HASH_BUCKETS = 8192;
@@ -213,7 +219,7 @@ class LLMessageSystem : public LLMessageSenderInterface
LLHost mUntrustedInterface; LLHost mUntrustedInterface;
public: public:
LLPacketRing mPacketRing; LLPacketRing* mPacketRing;
LLReliablePacketParams mReliablePacketParams; LLReliablePacketParams mReliablePacketParams;
// Set this flag to TRUE when you want *very* verbose logs. // Set this flag to TRUE when you want *very* verbose logs.
@@ -494,7 +500,7 @@ public:
void (*callback)(void **,S32), void (*callback)(void **,S32),
void ** callback_data); void ** callback_data);
LLHTTPClient::ResponderPtr createResponder(const std::string& name); LLFnPtrResponder* createResponder(const std::string& name);
S32 sendMessage(const LLHost &host); S32 sendMessage(const LLHost &host);
S32 sendMessage(const U32 circuit); S32 sendMessage(const U32 circuit);
private: private:

View File

@@ -627,21 +627,21 @@ bool idle_startup()
F32 dropPercent = gSavedSettings.getF32("PacketDropPercentage"); F32 dropPercent = gSavedSettings.getF32("PacketDropPercentage");
msg->mPacketRing.setDropPercentage(dropPercent); msg->mPacketRing->setDropPercentage(dropPercent);
F32 inBandwidth = gSavedSettings.getF32("InBandwidth"); F32 inBandwidth = gSavedSettings.getF32("InBandwidth");
F32 outBandwidth = gSavedSettings.getF32("OutBandwidth"); F32 outBandwidth = gSavedSettings.getF32("OutBandwidth");
if (inBandwidth != 0.f) if (inBandwidth != 0.f)
{ {
LL_DEBUGS("AppInit") << "Setting packetring incoming bandwidth to " << inBandwidth << LL_ENDL; LL_DEBUGS("AppInit") << "Setting packetring incoming bandwidth to " << inBandwidth << LL_ENDL;
msg->mPacketRing.setUseInThrottle(TRUE); msg->mPacketRing->setUseInThrottle(TRUE);
msg->mPacketRing.setInBandwidth(inBandwidth); msg->mPacketRing->setInBandwidth(inBandwidth);
} }
if (outBandwidth != 0.f) if (outBandwidth != 0.f)
{ {
LL_DEBUGS("AppInit") << "Setting packetring outgoing bandwidth to " << outBandwidth << LL_ENDL; LL_DEBUGS("AppInit") << "Setting packetring outgoing bandwidth to " << outBandwidth << LL_ENDL;
msg->mPacketRing.setUseOutThrottle(TRUE); msg->mPacketRing->setUseOutThrottle(TRUE);
msg->mPacketRing.setOutBandwidth(outBandwidth); msg->mPacketRing->setOutBandwidth(outBandwidth);
} }
} }

View File

@@ -4035,7 +4035,7 @@ void print_packets_lost(void*)
void drop_packet(void*) void drop_packet(void*)
{ {
gMessageSystem->mPacketRing.dropPackets(1); gMessageSystem->mPacketRing->dropPackets(1);
} }

View File

@@ -169,7 +169,7 @@
#include "llnamevalue.h" #include "llnamevalue.h"
#include "llpacketack.h" #include "llpacketack.h"
#include "llpacketbuffer.h" #include "llpacketbuffer.h"
#include "llpacketring.h" //#include "llpacketring.h"
#include "llpartdata.h" #include "llpartdata.h"
//#include "llqueryflags.h" //#include "llqueryflags.h"
//#include "llregionflags.h" //#include "llregionflags.h"

View File

@@ -779,8 +779,8 @@ void LLWorld::updateNetStats()
S32 packets_out = gMessageSystem->mPacketsOut - mLastPacketsOut; S32 packets_out = gMessageSystem->mPacketsOut - mLastPacketsOut;
S32 packets_lost = gMessageSystem->mDroppedPackets - mLastPacketsLost; S32 packets_lost = gMessageSystem->mDroppedPackets - mLastPacketsLost;
S32 actual_in_bits = gMessageSystem->mPacketRing.getAndResetActualInBits(); S32 actual_in_bits = gMessageSystem->mPacketRing->getAndResetActualInBits();
S32 actual_out_bits = gMessageSystem->mPacketRing.getAndResetActualOutBits(); S32 actual_out_bits = gMessageSystem->mPacketRing->getAndResetActualOutBits();
LLViewerStats::getInstance()->mActualInKBitStat.addValue(actual_in_bits/1024.f); LLViewerStats::getInstance()->mActualInKBitStat.addValue(actual_in_bits/1024.f);
LLViewerStats::getInstance()->mActualOutKBitStat.addValue(actual_out_bits/1024.f); LLViewerStats::getInstance()->mActualOutKBitStat.addValue(actual_out_bits/1024.f);
LLViewerStats::getInstance()->mKBitStat.addValue(bits/1024.f); LLViewerStats::getInstance()->mKBitStat.addValue(bits/1024.f);

View File

@@ -201,8 +201,8 @@ void ScriptCounter::serializeSelection(bool delScript)
F32 throttle = gSavedSettings.getF32("OutBandwidth"); F32 throttle = gSavedSettings.getF32("OutBandwidth");
if((throttle == 0.f) || (throttle > 128000.f)) if((throttle == 0.f) || (throttle > 128000.f))
{ {
gMessageSystem->mPacketRing.setOutBandwidth(128000); gMessageSystem->mPacketRing->setOutBandwidth(128000);
gMessageSystem->mPacketRing.setUseOutThrottle(TRUE); gMessageSystem->mPacketRing->setUseOutThrottle(TRUE);
} }
showResult(llformat("Counting scripts, please wait...")); showResult(llformat("Counting scripts, please wait..."));
if((objectCount == 1) && !(foo->isAvatar())) if((objectCount == 1) && !(foo->isAvatar()))
@@ -340,13 +340,13 @@ void ScriptCounter::completechk()
F32 throttle = gSavedSettings.getF32("OutBandwidth"); F32 throttle = gSavedSettings.getF32("OutBandwidth");
if(throttle != 0.f) if(throttle != 0.f)
{ {
gMessageSystem->mPacketRing.setOutBandwidth(throttle); gMessageSystem->mPacketRing->setOutBandwidth(throttle);
gMessageSystem->mPacketRing.setUseOutThrottle(TRUE); gMessageSystem->mPacketRing->setUseOutThrottle(TRUE);
} }
else else
{ {
gMessageSystem->mPacketRing.setOutBandwidth(0.0); gMessageSystem->mPacketRing->setOutBandwidth(0.0);
gMessageSystem->mPacketRing.setUseOutThrottle(FALSE); gMessageSystem->mPacketRing->setUseOutThrottle(FALSE);
} }
llinfos << "Sending readout to chat..." << llendl; llinfos << "Sending readout to chat..." << llendl;
showResult(user_msg); showResult(user_msg);