diff options
| author | Robert Knop <prospero@lindenlab.com> | 2009-02-25 21:02:17 +0000 |
|---|---|---|
| committer | Robert Knop <prospero@lindenlab.com> | 2009-02-25 21:02:17 +0000 |
| commit | c88b470a8a2cdae8e69e5570b46d4b21c43368bc (patch) | |
| tree | 551d764767aa1d9c095a99b586f5bb38ae3f1e57 /indra/llmessage/message.h | |
| parent | 997d24b83221aa63ef8141a9ab94434d2ba2ddc6 (diff) | |
svn merge -r108815:112761 svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.26
The biggest things in this are Scalable Space Servers and Maint-Server-6
QAR-1209 : SSS
QAR-1295 : maint-server-6
Conflicts resolved by prospero:
C scripts/farm_distribute
C scripts/automated_build_scripts/build-linux.sh : resolved by
prospero, mostly kept the merge-right version in
the conflict, but there was one block of repeated
code from earlier that I removed.
C scripts/automated_build_scripts/build-mac.sh : kept merge-right
C indra/llcommon/llversionserver.h : svn revert
C indra/newsim/llsimparcel.h : kept *both*... working had "setArea",
merge-right had exportStream and importStream
C indra/newsim/llsimparcel.cpp : see llsimparcel.h
C indra/newsim/lltask.h : working had LLTask derived also from
LLScriptResourceConsumer, merge-right had LLTask
dervied also from LLAgentPosition. To resolve
conflict, derive from both.
C indra/newsim/lllslmanager.h : kept merge-right (had an added comment)
C indra/llmessage/llhttpnode.h : kept working (added the definition
of method LLHTTPNode::extendedResult)
C indra/lscript/lscript_execute_mono/llscriptexecutemono.cpp
C indra/lscript/lscript_execute_mono/llscriptexecutemono.h
: These two were resolved by si, in consultation with daveh
I also had to add the following stubs to
indra/newsim/tests/llgodkickutils_test.cpp in order to get it to
compile:
// LLScriptResourceConsumer interface methods in LLTask
LLScriptResource::LLScriptResource() { }
LLScriptResourcePool::LLScriptResourcePool() { }
LLScriptResourcePool LLScriptResourcePool::null;
LLScriptResourceConsumer::LLScriptResourceConsumer() { }
LLScriptResourcePool& LLScriptResourceConsumer::getScriptResourcePool() { return LLScriptResourcePool::null; }
const LLScriptResourcePool& LLScriptResourceConsumer::getScriptResourcePool() const { return LLScriptResourcePool::null; }
bool LLScriptResourceConsumer::switchScriptResourcePools(LLScriptResourcePool& new_pool) { return false; }
bool LLScriptResourceConsumer::canUseScriptResourcePool(const LLScriptResourcePool& resource_pool) { return false; }
bool LLScriptResourceConsumer::isInPool(const LLScriptResourcePool& resource_pool) { return false; }
void LLScriptResourceConsumer::setScriptResourcePool(LLScriptResourcePool& pool) { }
S32 LLTask::getUsedPublicURLs() const { return 0; }
void LLTask::setScriptResourcePool(LLScriptResourcePool& pool) { }
Diffstat (limited to 'indra/llmessage/message.h')
| -rw-r--r-- | indra/llmessage/message.h | 75 |
1 files changed, 58 insertions, 17 deletions
diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index 25eeb85323..4fda8f01d7 100644 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -63,6 +63,9 @@ #include "llstl.h" #include "llmsgvariabletype.h" #include "llmsgvariabletype.h" +#include "llmessagesenderinterface.h" + +#include "llstoredmessage.h" const U32 MESSAGE_MAX_STRINGS_LENGTH = 64; const U32 MESSAGE_NUMBER_OF_HASH_BUCKETS = 8192; @@ -206,7 +209,7 @@ public: virtual void complete(const LLHost& host, const LLUUID& agent) const = 0; }; -class LLMessageSystem +class LLMessageSystem : public LLMessageSenderInterface { private: U8 mSendBuffer[MAX_BUFFER_SIZE]; @@ -373,14 +376,33 @@ public: void newMessageFast(const char *name); void newMessage(const char *name); - void copyMessageRtoS(); - void clearMessage(); + +public: + LLStoredMessagePtr getReceivedMessage() const; + LLStoredMessagePtr getBuiltMessage() const; + S32 sendMessage(const LLHost &host, LLStoredMessagePtr message); + +private: + LLSD getReceivedMessageLLSD() const; + LLSD getBuiltMessageLLSD() const; + + // NOTE: babbage: Only use to support legacy misuse of the + // LLMessageSystem API where values are dangerously written + // as one type and read as another. LLSD does not support + // dangerous conversions and so converting the message to an + // LLSD would result in the reads failing. All code which + // misuses the message system in this way should be made safe + // but while the unsafe code is run in old processes, this + // method should be used to forward unsafe messages. + LLSD wrapReceivedTemplateData() const; + +public: + + void copyMessageReceivedToSend(); + void clearMessage(); void nextBlockFast(const char *blockname); - void nextBlock(const char *blockname) - { - nextBlockFast(LLMessageStringTable::getInstance()->getString(blockname)); - } + void nextBlock(const char *blockname); public: void addBinaryDataFast(const char *varname, const void *data, S32 size); @@ -461,14 +483,14 @@ public: void (*callback)(void **,S32), void ** callback_data); // flush sends a message only if data's been pushed on it. - S32 flushSemiReliable( const LLHost &host, + S32 flushSemiReliable( const LLHost &host, void (*callback)(void **,S32), void ** callback_data); - S32 flushReliable( const LLHost &host ); + S32 flushReliable( const LLHost &host ); - void forwardMessage(const LLHost &host); - void forwardReliable(const LLHost &host); - void forwardReliable(const U32 circuit_code); + void forwardMessage(const LLHost &host); + void forwardReliable(const LLHost &host); + void forwardReliable(const U32 circuit_code); S32 forwardReliable( const LLHost &host, S32 retries, @@ -480,9 +502,10 @@ public: LLHTTPClient::ResponderPtr createResponder(const std::string& name); S32 sendMessage(const LLHost &host); S32 sendMessage(const U32 circuit); +private: S32 sendMessage(const LLHost &host, const char* name, const LLSD& message); - +public: // BOOL decodeData(const U8 *buffer, const LLHost &host); void getBinaryDataFast(const char *blockname, const char *varname, void *datap, S32 size, S32 blocknum = 0, S32 max_size = S32_MAX); @@ -561,8 +584,12 @@ public: void sendDenyTrustedCircuit(const LLHost &host); /** Return false if host is unknown or untrusted */ + // Note:DaveH/Babbage some trusted messages can be received without a circuit bool isTrustedSender(const LLHost& host) const; + /** Return true if current message is from trusted source */ + bool isTrustedSender() const; + /** Return false true if name is unknown or untrusted */ bool isTrustedMessage(const std::string& name) const; @@ -578,6 +605,7 @@ public: // Change this message to be UDP black listed. void banUdpMessage(const std::string& name); + private: // A list of the circuits that need to be sent DenyTrustedCircuit messages. typedef std::set<LLHost> host_set_t; @@ -594,6 +622,7 @@ public: void establishBidirectionalTrust(const LLHost &host, S64 frame_count = 0); // returns whether the given host is on a trusted circuit + // Note:DaveH/Babbage some trusted messages can be received without a circuit BOOL getCircuitTrust(const LLHost &host); void setCircuitAllowTimeout(const LLHost &host, BOOL allow); @@ -663,6 +692,12 @@ public: const LLSD& message, LLHTTPNode::ResponsePtr responsep); + // this is added to support specific legacy messages and is + // ***not intended for general use*** Si, Gabriel, 2009 + static void dispatchTemplate(const std::string& msg_name, + const LLSD& message, + LLHTTPNode::ResponsePtr responsep); + void setMessageBans(const LLSD& trusted, const LLSD& untrusted); /** @@ -690,9 +725,18 @@ public: // Check UDP messages and pump http_pump to receive HTTP messages. bool checkAllMessages(S64 frame_count, LLPumpIO* http_pump); + + // Moved to allow access from LLTemplateMessageDispatcher + void clearReceiveState(); + + // This will cause all trust queries to return true until the next message + // is read: use with caution! + void receivedMessageFromTrustedSender(); private: + bool mLastMessageFromTrustedMessageService; + // The mCircuitCodes is a map from circuit codes to session // ids. This allows us to verify sessions on connect. typedef std::map<U32, LLUUID> code_session_map_t; @@ -703,7 +747,6 @@ private: LLUUID mSessionID; void addTemplate(LLMessageTemplate *templatep); - void clearReceiveState(); BOOL decodeTemplate( const U8* buffer, S32 buffer_size, LLMessageTemplate** msg_template ); void logMsgFromInvalidCircuit( const LLHost& sender, BOOL recv_reliable ); @@ -799,7 +842,7 @@ bool start_messaging_system( const F32 circuit_heartbeat_interval, const F32 circuit_timeout); -void end_messaging_system(); +void end_messaging_system(bool print_summary = true); void null_message_callback(LLMessageSystem *msg, void **data); @@ -976,8 +1019,6 @@ inline void *ntohmemcpy(void *s, const void *ct, EMsgVariableType type, size_t n return(htonmemcpy(s,ct,type, n)); } - -inline const LLHost& LLMessageSystem::getSender() const {return mLastSender;} inline const LLHost& LLMessageSystem::getReceivingInterface() const {return mLastReceivingIF;} inline U32 LLMessageSystem::getSenderIP() const |
