summaryrefslogtreecommitdiff
path: root/indra/llmessage/llsdrpcserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/llsdrpcserver.cpp')
-rwxr-xr-x[-rw-r--r--]indra/llmessage/llsdrpcserver.cpp60
1 files changed, 25 insertions, 35 deletions
diff --git a/indra/llmessage/llsdrpcserver.cpp b/indra/llmessage/llsdrpcserver.cpp
index 0c92e7ddde..c3ed19889e 100644..100755
--- a/indra/llmessage/llsdrpcserver.cpp
+++ b/indra/llmessage/llsdrpcserver.cpp
@@ -4,31 +4,25 @@
* @date 2005-10-11
* @brief Implementation of the LLSDRPCServer and related classes.
*
- * $LicenseInfo:firstyear=2005&license=viewergpl$
- *
- * Copyright (c) 2005-2009, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2005&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * 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.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * 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.
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * 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$
*/
@@ -37,7 +31,7 @@
#include "llbuffer.h"
#include "llbufferstream.h"
-#include "llmemtype.h"
+#include "llfasttimer.h"
#include "llpumpio.h"
#include "llsdserialize.h"
#include "llstl.h"
@@ -64,12 +58,10 @@ LLSDRPCServer::LLSDRPCServer() :
mPump(NULL),
mLock(0)
{
- LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
}
LLSDRPCServer::~LLSDRPCServer()
{
- LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
std::for_each(
mMethods.begin(),
mMethods.end(),
@@ -103,6 +95,8 @@ void LLSDRPCServer::clearLock()
}
}
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_SDRPC_SERVER("SDRPC Server");
+
// virtual
LLIOPipe::EStatus LLSDRPCServer::process_impl(
const LLChannelDescriptors& channels,
@@ -111,9 +105,9 @@ LLIOPipe::EStatus LLSDRPCServer::process_impl(
LLSD& context,
LLPumpIO* pump)
{
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_SDRPC_SERVER);
PUMP_DEBUG;
- LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
-// lldebugs << "LLSDRPCServer::process_impl" << llendl;
+// LL_DEBUGS() << "LLSDRPCServer::process_impl" << LL_ENDL;
// Once we have all the data, We need to read the sd on
// the the in channel, and respond on the out channel
if(!eos) return STATUS_BREAK;
@@ -138,10 +132,10 @@ LLIOPipe::EStatus LLSDRPCServer::process_impl(
return STATUS_DONE;
case STATE_DONE:
-// lldebugs << "STATE_DONE" << llendl;
+// LL_DEBUGS() << "STATE_DONE" << LL_ENDL;
break;
case STATE_CALLBACK:
-// lldebugs << "STATE_CALLBACK" << llendl;
+// LL_DEBUGS() << "STATE_CALLBACK" << LL_ENDL;
PUMP_DEBUG;
method_name = mRequest[LLSDRPC_METHOD_SD_NAME].asString();
if(!method_name.empty() && mRequest.has(LLSDRPC_PARAMETER_SD_NAME))
@@ -175,7 +169,7 @@ LLIOPipe::EStatus LLSDRPCServer::process_impl(
mState = STATE_DONE;
break;
case STATE_NONE:
-// lldebugs << "STATE_NONE" << llendl;
+// LL_DEBUGS() << "STATE_NONE" << LL_ENDL;
default:
{
// First time we got here - process the SD request, and call
@@ -256,7 +250,6 @@ ESDRPCSStatus LLSDRPCServer::callMethod(
const LLChannelDescriptors& channels,
LLBufferArray* response)
{
- LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
// Try to find the method in the method table.
ESDRPCSStatus rv = ESDRPCS_DONE;
method_map_t::iterator it = mMethods.find(method);
@@ -295,7 +288,6 @@ ESDRPCSStatus LLSDRPCServer::callbackMethod(
const LLChannelDescriptors& channels,
LLBufferArray* response)
{
- LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
// Try to find the method in the callback method table.
ESDRPCSStatus rv = ESDRPCS_DONE;
method_map_t::iterator it = mCallbackMethods.find(method);
@@ -323,10 +315,9 @@ void LLSDRPCServer::buildFault(
S32 code,
const std::string& msg)
{
- LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
LLBufferStream ostr(channels, data);
ostr << FAULT_PART_1 << code << FAULT_PART_2 << msg << FAULT_PART_3;
- llinfos << "LLSDRPCServer::buildFault: " << code << ", " << msg << llendl;
+ LL_INFOS() << "LLSDRPCServer::buildFault: " << code << ", " << msg << LL_ENDL;
}
// static
@@ -335,7 +326,6 @@ void LLSDRPCServer::buildResponse(
LLBufferArray* data,
const LLSD& response)
{
- LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER);
LLBufferStream ostr(channels, data);
ostr << RESPONSE_PART_1;
LLSDSerialize::toNotation(response, ostr);
@@ -344,6 +334,6 @@ void LLSDRPCServer::buildResponse(
std::ostringstream debug_ostr;
debug_ostr << "LLSDRPCServer::buildResponse: ";
LLSDSerialize::toNotation(response, debug_ostr);
- llinfos << debug_ostr.str() << llendl;
+ LL_INFOS() << debug_ostr.str() << LL_ENDL;
#endif
}