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 "lltransfermanager.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_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
gMessageSystem->mPacketRing.sendPacket(packetp->mSocket,
gMessageSystem->mPacketRing->sendPacket(packetp->mSocket,
(char *)packetp->mBuffer, packetp->mBufferLength,
packetp->mHost);

View File

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

View File

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

View File

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