diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt
index aac669137..f084200f6 100644
--- a/indra/llmessage/CMakeLists.txt
+++ b/indra/llmessage/CMakeLists.txt
@@ -49,6 +49,7 @@ set(llmessage_SOURCE_FILES
llmail.cpp
llmessagebuilder.cpp
llmessageconfig.cpp
+ llmessagelog.cpp
llmessagereader.cpp
llmessagetemplate.cpp
llmessagetemplateparser.cpp
@@ -62,14 +63,11 @@ set(llmessage_SOURCE_FILES
llpartdata.cpp
llproxy.cpp
llpumpio.cpp
- llregionpresenceverifier.cpp
llsdappservices.cpp
llsdhttpserver.cpp
llsdmessage.cpp
llsdmessagebuilder.cpp
llsdmessagereader.cpp
- llservicebuilder.cpp
- llservice.cpp
llstoredmessage.cpp
lltemplatemessagebuilder.cpp
lltemplatemessagedispatcher.cpp
@@ -94,7 +92,6 @@ set(llmessage_SOURCE_FILES
message_prehash.cpp
message_string_table.cpp
net.cpp
- partsyspacket.cpp
patch_code.cpp
patch_dct.cpp
patch_idct.cpp
@@ -145,6 +142,7 @@ set(llmessage_HEADER_FILES
llmail.h
llmessagebuilder.h
llmessageconfig.h
+ llmessagelog.h
llmessagereader.h
llmessagetemplate.h
llmessagetemplateparser.h
@@ -162,14 +160,11 @@ set(llmessage_HEADER_FILES
llqueryflags.h
llregionflags.h
llregionhandle.h
- llregionpresenceverifier.h
llsdappservices.h
llsdhttpserver.h
llsdmessage.h
llsdmessagebuilder.h
llsdmessagereader.h
- llservice.h
- llservicebuilder.h
llstoredmessage.h
lltaskname.h
llteleportflags.h
@@ -197,7 +192,6 @@ set(llmessage_HEADER_FILES
message.h
message_prehash.h
net.h
- partsyspacket.h
patch_code.h
patch_dct.h
sound_ids.h
@@ -232,7 +226,6 @@ if (LL_TESTS)
llnamevalue.cpp
lltrustedmessageservice.cpp
lltemplatemessagedispatcher.cpp
- llregionpresenceverifier.cpp
)
LL_ADD_PROJECT_UNIT_TESTS(llmessage "${llmessage_TEST_SOURCE_FILES}")
diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp
index 56249db41..2ae76ab5e 100644
--- a/indra/llmessage/llcircuit.cpp
+++ b/indra/llmessage/llcircuit.cpp
@@ -1229,6 +1229,17 @@ void LLCircuit::getCircuitRange(
first = mCircuitData.upper_bound(key);
}
+//
+std::vector LLCircuit::getCircuitDataList()
+{
+ std::vector list;
+ circuit_data_map::iterator end = mCircuitData.end();
+ for(circuit_data_map::iterator iter = mCircuitData.begin(); iter != end; ++iter)
+ list.push_back((*iter).second);
+ return list;
+}
+//
+
TPACKETID LLCircuitData::nextPacketOutID()
{
mPacketsOut++;
diff --git a/indra/llmessage/llcircuit.h b/indra/llmessage/llcircuit.h
index d1c400c6a..cd7576efa 100644
--- a/indra/llmessage/llcircuit.h
+++ b/indra/llmessage/llcircuit.h
@@ -328,6 +328,10 @@ public:
circuit_data_map::iterator& first,
circuit_data_map::iterator& end);
+ //
+ std::vector getCircuitDataList();
+ //
+
// Lists that optimize how many circuits we need to traverse a frame
// HACK - this should become protected eventually, but stupid !@$@# message system/circuit classes are jumbling things up.
circuit_data_map mUnackedCircuitMap; // Map of circuits with unacked data
diff --git a/indra/llmessage/lldatapacker.h b/indra/llmessage/lldatapacker.h
index b0a638c16..2b6e57484 100644
--- a/indra/llmessage/lldatapacker.h
+++ b/indra/llmessage/lldatapacker.h
@@ -173,10 +173,12 @@ public:
void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = FALSE; }
void assignBuffer(U8 *bufferp, S32 size)
{
- if(mBufferp && mBufferp != bufferp)
+ //No no no no no! This breaks the paradigm of callers handling buffer allocation/deallocation
+ //Also, buffers can be on stack! Calling delete[] on such a buffer would be VERY bad.
+ /*if(mBufferp && mBufferp != bufferp)
{
freeBuffer() ;
- }
+ }*/
mBufferp = bufferp;
mCurBufferp = bufferp;
mBufferSize = size;
diff --git a/indra/llmessage/llpacketring.cpp b/indra/llmessage/llpacketring.cpp
index fc6e9c519..d52a9435c 100644
--- a/indra/llmessage/llpacketring.cpp
+++ b/indra/llmessage/llpacketring.cpp
@@ -44,6 +44,10 @@
#include "timing.h"
#include "u64.h"
+//
+#include "llmessagelog.h"
+//
+
///////////////////////////////////////////////////////////
LLPacketRing::LLPacketRing () :
mUseInThrottle(FALSE),
@@ -272,7 +276,11 @@ S32 LLPacketRing::receivePacket (S32 socket, char *datap)
}
BOOL LLPacketRing::sendPacket(int h_socket, char * send_buffer, S32 buf_size, LLHost host)
-{
+{
+ //
+ LLMessageLog::log(LLHost(16777343, gMessageSystem->getListenPort()), host, (U8*)send_buffer, buf_size);
+ //
+
BOOL status = TRUE;
if (!mUseOutThrottle)
{
diff --git a/indra/llmessage/llregionpresenceverifier.cpp b/indra/llmessage/llregionpresenceverifier.cpp
deleted file mode 100644
index 01d78ed3e..000000000
--- a/indra/llmessage/llregionpresenceverifier.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * @file llregionpresenceverifier.cpp
- * @brief
- *
- * $LicenseInfo:firstyear=2008&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include "llregionpresenceverifier.h"
-#include "llhttpclientinterface.h"
-#include
-#include "net.h"
-#include "message.h"
-
-//namespace boost
-//{
- void intrusive_ptr_add_ref(LLRegionPresenceVerifier::Response* p)
- {
- ++p->mReferenceCount;
- }
-
- void intrusive_ptr_release(LLRegionPresenceVerifier::Response* p)
- {
- if(p && 0 == --p->mReferenceCount)
- {
- delete p;
- }
- }
-//};
-
-LLRegionPresenceVerifier::Response::~Response()
-{
-}
-
-LLRegionPresenceVerifier::RegionResponder::RegionResponder(const std::string&
- uri,
- ResponsePtr data,
- S32 retry_count) :
- mUri(uri),
- mSharedData(data),
- mRetryCount(retry_count)
-{
-}
-
-//virtual
-LLRegionPresenceVerifier::RegionResponder::~RegionResponder()
-{
-}
-
-void LLRegionPresenceVerifier::RegionResponder::result(const LLSD& content)
-{
- std::string host = content["private_host"].asString();
- U32 port = content["private_port"].asInteger();
- LLHost destination(host, port);
- LLUUID id = content["region_id"];
-
- lldebugs << "Verifying " << destination.getString() << " is region " << id << llendl;
-
- std::stringstream uri;
- uri << "http://" << destination.getString() << "/state/basic/";
- mSharedData->getHttpClient().get(
- uri.str(),
- new VerifiedDestinationResponder(mUri, mSharedData, content, mRetryCount));
-}
-
-void LLRegionPresenceVerifier::RegionResponder::error(U32 status,
- const std::string& reason)
-{
- // TODO: babbage: distinguish between region presence service and
- // region verification errors?
- mSharedData->onRegionVerificationFailed();
-}
-
-LLRegionPresenceVerifier::VerifiedDestinationResponder::VerifiedDestinationResponder(const std::string& uri, ResponsePtr data, const LLSD& content,
- S32 retry_count):
- mUri(uri),
- mSharedData(data),
- mContent(content),
- mRetryCount(retry_count)
-{
-}
-
-//virtual
-LLRegionPresenceVerifier::VerifiedDestinationResponder::~VerifiedDestinationResponder()
-{
-}
-
-void LLRegionPresenceVerifier::VerifiedDestinationResponder::result(const LLSD& content)
-{
- LLUUID actual_region_id = content["region_id"];
- LLUUID expected_region_id = mContent["region_id"];
-
- lldebugs << "Actual region: " << content << llendl;
- lldebugs << "Expected region: " << mContent << llendl;
-
- if (mSharedData->checkValidity(content) &&
- (actual_region_id == expected_region_id))
- {
- mSharedData->onRegionVerified(mContent);
- }
- else if (mRetryCount > 0)
- {
- retry();
- }
- else
- {
- llwarns << "Simulator verification failed. Region: " << mUri << llendl;
- mSharedData->onRegionVerificationFailed();
- }
-}
-
-void LLRegionPresenceVerifier::VerifiedDestinationResponder::retry()
-{
- LLSD headers;
- headers["Cache-Control"] = "no-cache, max-age=0";
- llinfos << "Requesting region information, get uncached for region "
- << mUri << llendl;
- --mRetryCount;
- mSharedData->getHttpClient().get(mUri, new RegionResponder(mUri, mSharedData, mRetryCount), headers);
-}
-
-void LLRegionPresenceVerifier::VerifiedDestinationResponder::error(U32 status, const std::string& reason)
-{
- if(mRetryCount > 0)
- {
- retry();
- }
- else
- {
- llwarns << "Failed to contact simulator for verification. Region: " << mUri << llendl;
- mSharedData->onRegionVerificationFailed();
- }
-}
diff --git a/indra/llmessage/llregionpresenceverifier.h b/indra/llmessage/llregionpresenceverifier.h
deleted file mode 100644
index 9b45e78b5..000000000
--- a/indra/llmessage/llregionpresenceverifier.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * @file llregionpresenceverifier.cpp
- * @brief
- *
- * $LicenseInfo:firstyear=2008&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-/* Macro Definitions */
-#ifndef LL_LLREGIONPRESENCEVERIFIER_H
-#define LL_LLREGIONPRESENCEVERIFIER_H
-
-#include "llhttpclient.h"
-#include
-#include "llsd.h"
-#include
-
-class LLHTTPClientInterface;
-
-class LLRegionPresenceVerifier
-{
-public:
- class Response
- {
- public:
- virtual ~Response() = 0;
-
- virtual bool checkValidity(const LLSD& content) const = 0;
- virtual void onRegionVerified(const LLSD& region_details) = 0;
- virtual void onRegionVerificationFailed() = 0;
-
- virtual LLHTTPClientInterface& getHttpClient() = 0;
-
- public: /* but not really -- don't touch this */
- U32 mReferenceCount;
- };
-
- typedef boost::intrusive_ptr ResponsePtr;
-
- class RegionResponder : public LLHTTPClient::Responder
- {
- public:
- RegionResponder(const std::string& uri, ResponsePtr data,
- S32 retry_count);
- virtual ~RegionResponder();
- virtual void result(const LLSD& content);
- virtual void error(U32 status, const std::string& reason);
-
- private:
- ResponsePtr mSharedData;
- std::string mUri;
- S32 mRetryCount;
- };
-
- class VerifiedDestinationResponder : public LLHTTPClient::Responder
- {
- public:
- VerifiedDestinationResponder(const std::string& uri, ResponsePtr data,
- const LLSD& content, S32 retry_count);
- virtual ~VerifiedDestinationResponder();
- virtual void result(const LLSD& content);
-
- virtual void error(U32 status, const std::string& reason);
-
- private:
- void retry();
- ResponsePtr mSharedData;
- LLSD mContent;
- std::string mUri;
- S32 mRetryCount;
- };
-};
-
-//namespace boost
-//{
- void intrusive_ptr_add_ref(LLRegionPresenceVerifier::Response* p);
- void intrusive_ptr_release(LLRegionPresenceVerifier::Response* p);
-//};
-
-#endif //LL_LLREGIONPRESENCEVERIFIER_H
diff --git a/indra/llmessage/llservice.cpp b/indra/llmessage/llservice.cpp
deleted file mode 100644
index dbec92c22..000000000
--- a/indra/llmessage/llservice.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * @file llservice.cpp
- * @author Phoenix
- * @date 2005-04-20
- *
- * $LicenseInfo:firstyear=2005&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-#include "llservice.h"
-
-LLService::creators_t LLService::sCreatorFunctors;
-
-LLService::LLService()
-{
-}
-
-LLService::~LLService()
-{
-}
-
-// static
-bool LLService::registerCreator(const std::string& name, creator_t fn)
-{
- llinfos << "LLService::registerCreator(" << name << ")" << llendl;
- if(name.empty())
- {
- return false;
- }
-
- creators_t::value_type vt(name, fn);
- std::pair rv = sCreatorFunctors.insert(vt);
- return rv.second;
-
- // alternately...
- //std::string name_str(name);
- //sCreatorFunctors[name_str] = fn;
-}
-
-// static
-LLIOPipe* LLService::activate(
- const std::string& name,
- LLPumpIO::chain_t& chain,
- LLSD context)
-{
- if(name.empty())
- {
- llinfos << "LLService::activate - no service specified." << llendl;
- return NULL;
- }
- creators_t::iterator it = sCreatorFunctors.find(name);
- LLIOPipe* rv = NULL;
- if(it != sCreatorFunctors.end())
- {
- if((*it).second->build(chain, context))
- {
- rv = chain[0].get();
- }
- else
- {
- // empty out the chain, because failed service creation
- // should just discard this stuff.
- llwarns << "LLService::activate - unable to build chain: " << name
- << llendl;
- chain.clear();
- }
- }
- else
- {
- llwarns << "LLService::activate - unable find factory: " << name
- << llendl;
- }
- return rv;
-}
-
-// static
-bool LLService::discard(const std::string& name)
-{
- if(name.empty())
- {
- return false;
- }
- creators_t::iterator it = sCreatorFunctors.find(name);
- if(it != sCreatorFunctors.end())
- {
- //(*it).second->discard();
- sCreatorFunctors.erase(it);
- return true;
- }
- return false;
-}
-
diff --git a/indra/llmessage/llservice.h b/indra/llmessage/llservice.h
deleted file mode 100644
index 9c09aeb44..000000000
--- a/indra/llmessage/llservice.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/**
- * @file llservice.h
- * @author Phoenix
- * @date 2004-11-21
- * @brief Declaration file for LLService and related classes.
- *
- * $LicenseInfo:firstyear=2004&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLSERVICE_H
-#define LL_LLSERVICE_H
-
-#include
-#include