summaryrefslogtreecommitdiff
path: root/indra/llmessage/llfiltersd2xmlrpc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/llfiltersd2xmlrpc.cpp')
-rwxr-xr-xindra/llmessage/llfiltersd2xmlrpc.cpp93
1 files changed, 47 insertions, 46 deletions
diff --git a/indra/llmessage/llfiltersd2xmlrpc.cpp b/indra/llmessage/llfiltersd2xmlrpc.cpp
index e0ca056a5f..d3e195789b 100755
--- a/indra/llmessage/llfiltersd2xmlrpc.cpp
+++ b/indra/llmessage/llfiltersd2xmlrpc.cpp
@@ -80,6 +80,7 @@
#include "llbuffer.h"
#include "llbufferstream.h"
+#include "llfasttimer.h"
#include "llmemorystream.h"
#include "llsd.h"
#include "llsdserialize.h"
@@ -163,12 +164,12 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
case LLSD::TypeMap:
{
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(map) BEGIN" << llendl;
+ LL_INFOS() << "streamOut(map) BEGIN" << LL_ENDL;
#endif
ostr << "<struct>";
if(ostr.fail())
{
- llinfos << "STREAM FAILURE writing struct" << llendl;
+ LL_INFOS() << "STREAM FAILURE writing struct" << LL_ENDL;
}
LLSD::map_const_iterator it = sd.beginMap();
LLSD::map_const_iterator end = sd.endMap();
@@ -179,21 +180,21 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
streamOut(ostr, (*it).second);
if(ostr.fail())
{
- llinfos << "STREAM FAILURE writing '" << (*it).first
- << "' with sd type " << (*it).second.type() << llendl;
+ LL_INFOS() << "STREAM FAILURE writing '" << (*it).first
+ << "' with sd type " << (*it).second.type() << LL_ENDL;
}
ostr << "</member>";
}
ostr << "</struct>";
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(map) END" << llendl;
+ LL_INFOS() << "streamOut(map) END" << LL_ENDL;
#endif
break;
}
case LLSD::TypeArray:
{
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(array) BEGIN" << llendl;
+ LL_INFOS() << "streamOut(array) BEGIN" << LL_ENDL;
#endif
ostr << "<array><data>";
LLSD::array_const_iterator it = sd.beginArray();
@@ -203,12 +204,12 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
streamOut(ostr, *it);
if(ostr.fail())
{
- llinfos << "STREAM FAILURE writing array element sd type "
- << (*it).type() << llendl;
+ LL_INFOS() << "STREAM FAILURE writing array element sd type "
+ << (*it).type() << LL_ENDL;
}
}
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(array) END" << llendl;
+ LL_INFOS() << "streamOut(array) END" << LL_ENDL;
#endif
ostr << "</data></array>";
break;
@@ -217,31 +218,31 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
// treat undefined as a bool with a false value.
case LLSD::TypeBoolean:
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(bool)" << llendl;
+ LL_INFOS() << "streamOut(bool)" << LL_ENDL;
#endif
ostr << "<boolean>" << (sd.asBoolean() ? "1" : "0") << "</boolean>";
break;
case LLSD::TypeInteger:
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(int)" << llendl;
+ LL_INFOS() << "streamOut(int)" << LL_ENDL;
#endif
ostr << "<i4>" << sd.asInteger() << "</i4>";
break;
case LLSD::TypeReal:
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(real)" << llendl;
+ LL_INFOS() << "streamOut(real)" << LL_ENDL;
#endif
ostr << "<double>" << sd.asReal() << "</double>";
break;
case LLSD::TypeString:
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(string)" << llendl;
+ LL_INFOS() << "streamOut(string)" << LL_ENDL;
#endif
ostr << "<string>" << xml_escape_string(sd.asString()) << "</string>";
break;
case LLSD::TypeUUID:
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(uuid)" << llendl;
+ LL_INFOS() << "streamOut(uuid)" << LL_ENDL;
#endif
// serialize it as a string
ostr << "<string>" << sd.asString() << "</string>";
@@ -249,7 +250,7 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
case LLSD::TypeURI:
{
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(uri)" << llendl;
+ LL_INFOS() << "streamOut(uri)" << LL_ENDL;
#endif
// serialize it as a string
ostr << "<string>" << xml_escape_string(sd.asString()) << "</string>";
@@ -258,7 +259,7 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
case LLSD::TypeBinary:
{
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(binary)" << llendl;
+ LL_INFOS() << "streamOut(binary)" << LL_ENDL;
#endif
// this is pretty inefficient, but we'll deal with that
// problem when it becomes one.
@@ -281,15 +282,15 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
}
case LLSD::TypeDate:
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(date)" << llendl;
+ LL_INFOS() << "streamOut(date)" << LL_ENDL;
#endif
// no need to escape this since it will be alpha-numeric.
ostr << "<dateTime.iso8601>" << sd.asString() << "</dateTime.iso8601>";
break;
default:
// unhandled type
- llwarns << "Unhandled structured data type: " << sd.type()
- << llendl;
+ LL_WARNS() << "Unhandled structured data type: " << sd.type()
+ << LL_ENDL;
break;
}
ostr << "</value>";
@@ -308,7 +309,7 @@ LLFilterSD2XMLRPCResponse::~LLFilterSD2XMLRPCResponse()
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_SD2XMLRPC_RESPONSE("SD2XMLRPC Response");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_SD2XMLRPC_RESPONSE("SD2XMLRPC Response");
// virtual
LLIOPipe::EStatus LLFilterSD2XMLRPCResponse::process_impl(
const LLChannelDescriptors& channels,
@@ -317,7 +318,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCResponse::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_SD2XMLRPC_RESPONSE);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_SD2XMLRPC_RESPONSE);
PUMP_DEBUG;
// This pipe does not work if it does not have everyting. This
@@ -360,7 +361,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCResponse::process_impl(
}
else
{
- llwarns << "Unable to determine the type of LLSD response." << llendl;
+ LL_WARNS() << "Unable to determine the type of LLSD response." << LL_ENDL;
}
PUMP_DEBUG;
return rv;
@@ -385,7 +386,7 @@ LLFilterSD2XMLRPCRequest::~LLFilterSD2XMLRPCRequest()
{
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_SD2XMLRPC_REQUEST("S22XMLRPC Request");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_SD2XMLRPC_REQUEST("S22XMLRPC Request");
// virtual
LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl(
@@ -395,14 +396,14 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_SD2XMLRPC_REQUEST);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_SD2XMLRPC_REQUEST);
// This pipe does not work if it does not have everyting. This
// could be addressed by making a stream parser for llsd which
// handled partial information.
PUMP_DEBUG;
if(!eos)
{
- llinfos << "!eos" << llendl;
+ LL_INFOS() << "!eos" << LL_ENDL;
return STATUS_BREAK;
}
@@ -412,7 +413,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl(
LLSDSerialize::fromNotation(sd, stream, buffer->count(channels.in()));
if(stream.fail())
{
- llinfos << "STREAM FAILURE reading structure data." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading structure data." << LL_ENDL;
}
PUMP_DEBUG;
@@ -434,7 +435,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl(
}
if(method.empty())
{
- llwarns << "SD -> XML Request no method found." << llendl;
+ LL_WARNS() << "SD -> XML Request no method found." << LL_ENDL;
return STATUS_ERROR;
}
@@ -445,13 +446,13 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl(
ostream.precision(DEFAULT_PRECISION);
if(ostream.fail())
{
- llinfos << "STREAM FAILURE setting precision" << llendl;
+ LL_INFOS() << "STREAM FAILURE setting precision" << LL_ENDL;
}
ostream << XML_HEADER << XMLRPC_REQUEST_HEADER_1
<< xml_escape_string(method) << XMLRPC_REQUEST_HEADER_2;
if(ostream.fail())
{
- llinfos << "STREAM FAILURE writing method headers" << llendl;
+ LL_INFOS() << "STREAM FAILURE writing method headers" << LL_ENDL;
}
switch(param_sd.type())
{
@@ -518,7 +519,7 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value)
break;
}
case xmlrpc_type_boolean:
- //lldebugs << "stream_out() bool" << llendl;
+ //LL_DEBUGS() << "stream_out() bool" << LL_ENDL;
ostr << " " << (XMLRPC_GetValueBoolean(value) ? "true" : "false");
break;
case xmlrpc_type_datetime:
@@ -526,23 +527,23 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value)
break;
case xmlrpc_type_double:
ostr << " r" << XMLRPC_GetValueDouble(value);
- //lldebugs << "stream_out() double" << XMLRPC_GetValueDouble(value)
- // << llendl;
+ //LL_DEBUGS() << "stream_out() double" << XMLRPC_GetValueDouble(value)
+ // << LL_ENDL;
break;
case xmlrpc_type_int:
ostr << " i" << XMLRPC_GetValueInt(value);
- //lldebugs << "stream_out() integer:" << XMLRPC_GetValueInt(value)
- // << llendl;
+ //LL_DEBUGS() << "stream_out() integer:" << XMLRPC_GetValueInt(value)
+ // << LL_ENDL;
break;
case xmlrpc_type_string:
- //lldebugs << "stream_out() string: " << str << llendl;
+ //LL_DEBUGS() << "stream_out() string: " << str << LL_ENDL;
ostr << " s(" << XMLRPC_GetValueStringLen(value) << ")'"
<< XMLRPC_GetValueString(value) << "'";
break;
case xmlrpc_type_array: // vector
case xmlrpc_type_mixed: // vector
{
- //lldebugs << "stream_out() array" << llendl;
+ //LL_DEBUGS() << "stream_out() array" << LL_ENDL;
ostr << " [";
U32 needs_comma = 0;
XMLRPC_VALUE current = XMLRPC_VectorRewind(value);
@@ -557,7 +558,7 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value)
}
case xmlrpc_type_struct: // still vector
{
- //lldebugs << "stream_out() struct" << llendl;
+ //LL_DEBUGS() << "stream_out() struct" << LL_ENDL;
ostr << " {";
std::string name;
U32 needs_comma = 0;
@@ -577,7 +578,7 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value)
case xmlrpc_type_none:
default:
status = LLIOPipe::STATUS_ERROR;
- llwarns << "Found an empty xmlrpc type.." << llendl;
+ LL_WARNS() << "Found an empty xmlrpc type.." << LL_ENDL;
// not much we can do here...
break;
};
@@ -592,7 +593,7 @@ LLFilterXMLRPCResponse2LLSD::~LLFilterXMLRPCResponse2LLSD()
{
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_XMLRPC2LLSD_RESPONSE("XMLRPC2LLSD Response");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_XMLRPC2LLSD_RESPONSE("XMLRPC2LLSD Response");
LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl(
const LLChannelDescriptors& channels,
@@ -601,7 +602,7 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_XMLRPC2LLSD_RESPONSE);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_XMLRPC2LLSD_RESPONSE);
PUMP_DEBUG;
if(!eos) return STATUS_BREAK;
@@ -617,7 +618,7 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl(
buf[bytes] = '\0';
buffer->readAfter(channels.in(), NULL, (U8*)buf, bytes);
- //lldebugs << "xmlrpc response: " << buf << llendl;
+ //LL_DEBUGS() << "xmlrpc response: " << buf << LL_ENDL;
PUMP_DEBUG;
XMLRPC_REQUEST response = XMLRPC_REQUEST_FromXML(
@@ -626,7 +627,7 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl(
NULL);
if(!response)
{
- llwarns << "XML -> SD Response unable to parse xml." << llendl;
+ LL_WARNS() << "XML -> SD Response unable to parse xml." << LL_ENDL;
delete[] buf;
return STATUS_ERROR;
}
@@ -678,7 +679,7 @@ LLFilterXMLRPCRequest2LLSD::~LLFilterXMLRPCRequest2LLSD()
{
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_XMLRPC2LLSD_REQUEST("XMLRPC2LLSD Request");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_XMLRPC2LLSD_REQUEST("XMLRPC2LLSD Request");
LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl(
const LLChannelDescriptors& channels,
buffer_ptr_t& buffer,
@@ -686,7 +687,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_XMLRPC2LLSD_REQUEST);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_XMLRPC2LLSD_REQUEST);
PUMP_DEBUG;
if(!eos) return STATUS_BREAK;
if(!buffer) return STATUS_ERROR;
@@ -701,7 +702,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl(
buf[bytes] = '\0';
buffer->readAfter(channels.in(), NULL, (U8*)buf, bytes);
- //lldebugs << "xmlrpc request: " << buf << llendl;
+ //LL_DEBUGS() << "xmlrpc request: " << buf << LL_ENDL;
// Check the value in the buffer. XMLRPC_REQUEST_FromXML will report a error code 4 if
// values that are less than 0x20 are passed to it, except
@@ -728,7 +729,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl(
NULL);
if(!request)
{
- llwarns << "XML -> SD Request process parse error." << llendl;
+ LL_WARNS() << "XML -> SD Request process parse error." << LL_ENDL;
delete[] buf;
return STATUS_ERROR;
}