summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorAaron Brashears <aaronb@lindenlab.com>2007-06-13 18:02:37 +0000
committerAaron Brashears <aaronb@lindenlab.com>2007-06-13 18:02:37 +0000
commitf118e7c80b95d8c0a0c8abb14ff379b6697e01b6 (patch)
treedb55a74f8d18b3c366608a537e2a32f6d089d56f /indra/llmessage
parent680667d4bdca7e2a6df15cd6f16f34c12c97da8e (diff)
result of merge manually performed through diff and patch. svn diff svn+ssh://svn/svn/linden/release@63615 svn+ssh://svn/svn/linden/branches/release-candidate@63637 | patch -p0 in release
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llbuffer.h1
-rw-r--r--indra/llmessage/llcachename.cpp6
-rw-r--r--indra/llmessage/llcachename.h2
-rw-r--r--indra/llmessage/llhttpclient.cpp53
-rw-r--r--indra/llmessage/llhttpclient.h8
-rw-r--r--indra/llmessage/llinstantmessage.cpp36
-rw-r--r--indra/llmessage/llinstantmessage.h20
-rw-r--r--indra/llmessage/llregionflags.h9
-rw-r--r--indra/llmessage/message.cpp12
9 files changed, 98 insertions, 49 deletions
diff --git a/indra/llmessage/llbuffer.h b/indra/llmessage/llbuffer.h
index 0a0a457d56..7933b84e5c 100644
--- a/indra/llmessage/llbuffer.h
+++ b/indra/llmessage/llbuffer.h
@@ -19,6 +19,7 @@
*/
#include <list>
+#include <vector>
/**
* @class LLChannelDescriptors
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index b2e1500859..9c6e5e7f85 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -623,6 +623,12 @@ void LLCacheName::dumpStats()
<< llendl;
}
+//static
+LLString LLCacheName::getDefaultName()
+{
+ return LLString(CN_WAITING);
+}
+
void LLCacheName::Impl::processPendingAsks()
{
sendRequest(_PREHASH_UUIDNameRequest, mAskNameQueue);
diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h
index c4f88ac490..3c8a6587b1 100644
--- a/indra/llmessage/llcachename.h
+++ b/indra/llmessage/llcachename.h
@@ -81,6 +81,8 @@ public:
void dump(); // Dumps the contents of the cache
void dumpStats(); // Dumps the sizes of the cache and associated queues.
+ static LLString getDefaultName();
+
private:
class Impl;
Impl& impl;
diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp
index a7d187f534..16586dc9c7 100644
--- a/indra/llmessage/llhttpclient.cpp
+++ b/indra/llmessage/llhttpclient.cpp
@@ -50,6 +50,29 @@ void LLHTTPClient::Responder::result(const LLSD& content)
{
}
+// virtual
+void LLHTTPClient::Responder::completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels,
+ const LLIOPipe::buffer_ptr_t& buffer)
+{
+ LLBufferStream istr(channels, buffer.get());
+ LLSD content;
+
+ if (200 <= status && status < 300)
+ {
+ LLSDSerialize::fromXML(content, istr);
+/*
+ const S32 parseError = -1;
+ if(LLSDSerialize::fromXML(content, istr) == parseError)
+ {
+ mStatus = 498;
+ mReason = "Client Parse Error";
+ }
+*/
+ }
+
+ completed(status, reason, content);
+}
+
// virtual
void LLHTTPClient::Responder::completed(U32 status, const std::string& reason, const LLSD& content)
{
@@ -88,25 +111,9 @@ namespace
virtual void complete(const LLChannelDescriptors& channels,
const buffer_ptr_t& buffer)
{
- LLBufferStream istr(channels, buffer.get());
- LLSD content;
-
- if (200 <= mStatus && mStatus < 300)
- {
- LLSDSerialize::fromXML(content, istr);
-/*
- const S32 parseError = -1;
- if(LLSDSerialize::fromXML(content, istr) == parseError)
- {
- mStatus = 498;
- mReason = "Client Parse Error";
- }
-*/
- }
-
if (mResponder.get())
{
- mResponder->completed(mStatus, mReason, content);
+ mResponder->completedRaw(mStatus, mReason, channels, buffer);
}
}
@@ -223,15 +230,18 @@ namespace
LLPumpIO* theClientPump = NULL;
}
-static void request(const std::string& url, LLURLRequest::ERequestAction method,
- Injector* body_injector, LLHTTPClient::ResponderPtr responder, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS)
+static void request(
+ const std::string& url,
+ LLURLRequest::ERequestAction method,
+ Injector* body_injector,
+ LLHTTPClient::ResponderPtr responder,
+ const F32 timeout=HTTP_REQUEST_EXPIRY_SECS)
{
if (!LLHTTPClient::hasPump())
{
responder->completed(U32_MAX, "No pump", LLSD());
return;
}
-
LLPumpIO::chain_t chain;
LLURLRequest *req = new LLURLRequest(method, url);
@@ -242,7 +252,8 @@ static void request(const std::string& url, LLURLRequest::ERequestAction method,
}
req->setCallback(new LLHTTPClientURLAdaptor(responder));
- if (method == LLURLRequest::HTTP_POST && gMessageSystem) {
+ if (method == LLURLRequest::HTTP_POST && gMessageSystem)
+ {
req->addHeader(llformat("X-SecondLife-UDP-Listen-Port: %d",
gMessageSystem->mPort).c_str());
}
diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h
index f2674ba417..447bd691ba 100644
--- a/indra/llmessage/llhttpclient.h
+++ b/indra/llmessage/llhttpclient.h
@@ -18,6 +18,8 @@
#include <boost/intrusive_ptr.hpp>
#include "llassettype.h"
+#include "llbuffer.h"
+#include "lliopipe.h"
extern const F32 HTTP_REQUEST_EXPIRY_SECS;
@@ -38,7 +40,11 @@ public:
virtual void error(U32 status, const std::string& reason); // called with bad status codes
virtual void result(const LLSD& content);
-
+
+ // Override point for clients that may want to use this class when the response is some other format besides LLSD
+ virtual void completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels,
+ const LLIOPipe::buffer_ptr_t& buffer);
+
virtual void completed(U32 status, const std::string& reason, const LLSD& content);
/**< The default implemetnation calls
either:
diff --git a/indra/llmessage/llinstantmessage.cpp b/indra/llmessage/llinstantmessage.cpp
index 28886108ea..132f4f6e7b 100644
--- a/indra/llmessage/llinstantmessage.cpp
+++ b/indra/llmessage/llinstantmessage.cpp
@@ -308,18 +308,46 @@ LLSD im_info_to_llsd(LLPointer<LLIMInfo> im_info)
param_message["parent_estate_id"] = (S32)im_info->mParentEstateID;
param_message["region_id"] = im_info->mRegionID;
param_message["position"] = ll_sd_from_vector3(im_info->mPosition);
- if (im_info->mData) param_message["data"] = im_info->mData;
+ param_message["data"] = im_info->mData;
+ param_message["source"]= im_info->mSource;
+ param_message["ttl"] = im_info->mTTL;
+
LLSD param_agent;
param_agent["agent_id"] = im_info->mFromID;
LLSD params;
- params.append(param_version);
- params.append(param_message);
- params.append(param_agent);
+ params["version_params"] = param_version;
+ params["message_params"] = param_message;
+ params["agent_params"] = param_agent;
return params;
}
+LLPointer<LLIMInfo> llsd_to_im_info(const LLSD& im_info_sd)
+{
+ LLSD param_message = im_info_sd["message_params"];
+ LLSD param_agent = im_info_sd["agent_params"];
+
+ LLPointer<LLIMInfo> im_info = new LLIMInfo(
+ param_message["from_id"].asUUID(),
+ param_message["from_group"].asBoolean(),
+ param_message["to_id"].asUUID(),
+ (EInstantMessage) param_message["type"].asInteger(),
+ param_message["from_name"].asString(),
+ param_message["message"].asString(),
+ param_message["id"].asUUID(),
+ (U32) param_message["parent_estate_id"].asInteger(),
+ im_info->mRegionID = param_message["region_id"].asUUID(),
+ ll_vector3_from_sd(param_message["position"]),
+ param_message["data"],
+ (U8) param_message["offline"].asInteger(),
+ (U32) param_message["timestamp"].asInteger(),
+ (EIMSource)param_message["source"].asInteger(),
+ param_message["ttl"].asInteger());
+
+ return im_info;
+}
+
LLPointer<LLIMInfo> LLIMInfo::clone()
{
return new LLIMInfo(
diff --git a/indra/llmessage/llinstantmessage.h b/indra/llmessage/llinstantmessage.h
index 99b2734a70..7292ff42de 100644
--- a/indra/llmessage/llinstantmessage.h
+++ b/indra/llmessage/llinstantmessage.h
@@ -74,13 +74,10 @@ enum EInstantMessage
// communicate with each other.
//
- // Add users to a session.
- IM_SESSION_ADD = 13,
+ // Invite users to a session.
+ IM_SESSION_INVITE = 13,
- // IM sent automatically on call for help,
- // sets up a way for each Helper reached to teleport to the
- // helpee
- IM_SESSION_911_SEND = 14,
+ IM_SESSION_P2P_INVITE = 14,
// start a session with your gruop
IM_SESSION_GROUP_START = 15,
@@ -92,7 +89,7 @@ enum EInstantMessage
IM_SESSION_SEND = 17,
// leave a session
- IM_SESSION_DROP = 18,
+ IM_SESSION_LEAVE = 18,
// an instant message from an object - for differentiation on the
// viewer, since you can't IM an object yet.
@@ -121,14 +118,6 @@ enum EInstantMessage
// bucket.
IM_GOTO_URL = 28,
- // IM for help from the GAURDIAN_ANGELS
- // Binary bucket contains the name of the session.
- IM_SESSION_911_START = 29,
-
- // IM for requesting to teleport to the creator
- // of a livehelp session (assuming they are verified first)
- IM_TELEPORT_911 = 30,
-
// a message generated by a script which we don't want to
// be sent through e-mail. Similar to IM_FROM_TASK, but
// it is shown as an alert on the viewer.
@@ -268,6 +257,7 @@ public:
S32 mTTL;
};
+LLPointer<LLIMInfo> llsd_to_im_info(const LLSD& im_info_sd);
LLSD im_info_to_llsd(LLPointer<LLIMInfo> im_info);
void pack_instant_message(
diff --git a/indra/llmessage/llregionflags.h b/indra/llmessage/llregionflags.h
index 15e7a32257..28a741789c 100644
--- a/indra/llmessage/llregionflags.h
+++ b/indra/llmessage/llregionflags.h
@@ -36,7 +36,7 @@ const U32 REGION_FLAGS_BLOCK_LAND_RESELL = (1 << 7);
// All content wiped once per night
const U32 REGION_FLAGS_SANDBOX = (1 << 8);
-
+const U32 REGION_FLAGS_NULL_LAYER = (1 << 9);
const U32 REGION_FLAGS_SKIP_AGENT_ACTION = (1 << 10);
const U32 REGION_FLAGS_SKIP_UPDATE_INTEREST_LIST= (1 << 11);
const U32 REGION_FLAGS_SKIP_COLLISIONS = (1 << 12); // Pin all non agent rigid bodies
@@ -68,11 +68,14 @@ const U32 REGION_FLAGS_ALLOW_PARCEL_CHANGES = (1 << 26);
const U32 REGION_FLAGS_ABUSE_EMAIL_TO_ESTATE_OWNER = (1 << 27);
-const U32 REGION_FLAGS_NULL_LAYER = (1 << 9);
+const U32 REGION_FLAGS_ALLOW_VOICE = (1 << 28);
+
const U32 REGION_FLAGS_DEFAULT = REGION_FLAGS_ALLOW_LANDMARK |
REGION_FLAGS_ALLOW_SET_HOME |
- REGION_FLAGS_ALLOW_PARCEL_CHANGES;
+ REGION_FLAGS_ALLOW_PARCEL_CHANGES |
+ REGION_FLAGS_ALLOW_VOICE;
+
const U32 REGION_FLAGS_PRELUDE_SET = REGION_FLAGS_RESET_HOME_ON_TELEPORT;
const U32 REGION_FLAGS_PRELUDE_UNSET = REGION_FLAGS_ALLOW_LANDMARK
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index a305797fd2..c00a0fe154 100644
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -2927,17 +2927,19 @@ static LLHTTPNode& messageRootNode()
}
//static
-void LLMessageSystem::dispatch(const std::string& msg_name,
- const LLSD& message)
+void LLMessageSystem::dispatch(
+ const std::string& msg_name,
+ const LLSD& message)
{
LLPointer<LLSimpleResponse> responsep = LLSimpleResponse::create();
dispatch(msg_name, message, responsep);
}
//static
-void LLMessageSystem::dispatch(const std::string& msg_name,
- const LLSD& message,
- LLHTTPNode::ResponsePtr responsep)
+void LLMessageSystem::dispatch(
+ const std::string& msg_name,
+ const LLSD& message,
+ LLHTTPNode::ResponsePtr responsep)
{
if (msg_name.empty())
{