aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:50 -0500
committerJacek Antonelli2008-08-15 23:45:50 -0500
commit2a4dea528f670b9bb1f77ef27a8a1dd16603d114 (patch)
tree95c68e362703c9099d571ecbdc6142b1cda1e005 /linden/indra/llmessage
parentSecond Life viewer sources 1.20.6 (diff)
downloadmeta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.zip
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.gz
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.bz2
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.xz
Second Life viewer sources 1.20.7
Diffstat (limited to 'linden/indra/llmessage')
-rw-r--r--linden/indra/llmessage/llassetstorage.cpp4
-rw-r--r--linden/indra/llmessage/llblowfishcipher.cpp33
-rw-r--r--linden/indra/llmessage/llcachename.cpp2
-rw-r--r--linden/indra/llmessage/llcachename.h2
-rw-r--r--linden/indra/llmessage/llcurl.cpp5
-rw-r--r--linden/indra/llmessage/lldatapacker.h4
-rw-r--r--linden/indra/llmessage/llfiltersd2xmlrpc.cpp18
-rw-r--r--linden/indra/llmessage/llhttpassetstorage.cpp2
-rw-r--r--linden/indra/llmessage/llhttpclient.h7
-rw-r--r--linden/indra/llmessage/llhttpnode.cpp4
-rw-r--r--linden/indra/llmessage/llmessageconfig.cpp47
-rw-r--r--linden/indra/llmessage/llmessageconfig.h1
-rw-r--r--linden/indra/llmessage/llregionhandle.h2
-rw-r--r--linden/indra/llmessage/lltransfermanager.cpp4
-rw-r--r--linden/indra/llmessage/lltransfersourcefile.cpp4
-rw-r--r--linden/indra/llmessage/lltransfersourcefile.h2
-rw-r--r--linden/indra/llmessage/lltransfertargetfile.h2
-rw-r--r--linden/indra/llmessage/llxfer_file.cpp6
-rw-r--r--linden/indra/llmessage/llxfer_file.h2
-rw-r--r--linden/indra/llmessage/llxfermanager.cpp4
-rw-r--r--linden/indra/llmessage/message.cpp270
-rw-r--r--linden/indra/llmessage/net.cpp22
22 files changed, 233 insertions, 214 deletions
diff --git a/linden/indra/llmessage/llassetstorage.cpp b/linden/indra/llmessage/llassetstorage.cpp
index 13b1525..a6077e5 100644
--- a/linden/indra/llmessage/llassetstorage.cpp
+++ b/linden/indra/llmessage/llassetstorage.cpp
@@ -318,7 +318,7 @@ LLAssetStorage::~LLAssetStorage()
318 318
319void LLAssetStorage::setUpstream(const LLHost &upstream_host) 319void LLAssetStorage::setUpstream(const LLHost &upstream_host)
320{ 320{
321 llinfos << "AssetStorage: Setting upstream provider to " << upstream_host << llendl; 321 LL_DEBUGS("AppInit") << "AssetStorage: Setting upstream provider to " << upstream_host << LL_ENDL;
322 322
323 mUpstreamHost = upstream_host; 323 mUpstreamHost = upstream_host;
324} 324}
@@ -1242,7 +1242,7 @@ void LLAssetStorage::legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAss
1242 uuid.toString(uuid_str); 1242 uuid.toString(uuid_str);
1243 snprintf(filename,sizeof(filename),"%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); /* Flawfinder: ignore */ 1243 snprintf(filename,sizeof(filename),"%s.%s",gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_str).c_str(),LLAssetType::lookup(type)); /* Flawfinder: ignore */
1244 1244
1245 FILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */ 1245 LLFILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */
1246 if (fp) 1246 if (fp)
1247 { 1247 {
1248 const S32 buf_size = 65536; 1248 const S32 buf_size = 65536;
diff --git a/linden/indra/llmessage/llblowfishcipher.cpp b/linden/indra/llmessage/llblowfishcipher.cpp
index 45ff045..a0fe157 100644
--- a/linden/indra/llmessage/llblowfishcipher.cpp
+++ b/linden/indra/llmessage/llblowfishcipher.cpp
@@ -30,8 +30,8 @@
30 */ 30 */
31 31
32#include "linden_common.h" 32#include "linden_common.h"
33
34#include "llblowfishcipher.h" 33#include "llblowfishcipher.h"
34#include <openssl/evp.h>
35 35
36 36
37LLBlowfishCipher::LLBlowfishCipher(const U8* secret, size_t secret_size) 37LLBlowfishCipher::LLBlowfishCipher(const U8* secret, size_t secret_size)
@@ -50,11 +50,6 @@ LLBlowfishCipher::~LLBlowfishCipher()
50 mSecret = NULL; 50 mSecret = NULL;
51} 51}
52 52
53
54#if LL_LINUX
55
56#include <openssl/evp.h>
57
58// virtual 53// virtual
59U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) 54U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
60{ 55{
@@ -133,29 +128,3 @@ U32 LLBlowfishCipher::requiredEncryptionSpace(U32 len) const
133 len -= (len % BLOCK_SIZE); 128 len -= (len % BLOCK_SIZE);
134 return len; 129 return len;
135} 130}
136
137#else // !LL_LINUX
138
139// virtual
140U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
141{
142 llerrs << "LLBlowfishCipher only supported on Linux" << llendl;
143 return 0;
144}
145
146// virtual
147U32 LLBlowfishCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
148{
149 llerrs << "LLBlowfishCipher only supported on Linux" << llendl;
150 return 0;
151}
152
153// virtual
154U32 LLBlowfishCipher::requiredEncryptionSpace(U32 len) const
155{
156 llerrs << "LLBlowfishCipher only supported on Linux" << llendl;
157 return 0;
158}
159
160#endif
161
diff --git a/linden/indra/llmessage/llcachename.cpp b/linden/indra/llmessage/llcachename.cpp
index e8208cc..9adf10d 100644
--- a/linden/indra/llmessage/llcachename.cpp
+++ b/linden/indra/llmessage/llcachename.cpp
@@ -323,7 +323,7 @@ void LLCacheName::cancelCallback(const LLUUID& id, LLCacheNameCallback callback,
323 } 323 }
324} 324}
325 325
326void LLCacheName::importFile(FILE* fp) 326void LLCacheName::importFile(LLFILE* fp)
327{ 327{
328 S32 count = 0; 328 S32 count = 0;
329 329
diff --git a/linden/indra/llmessage/llcachename.h b/linden/indra/llmessage/llcachename.h
index 26a873f..e7d5a44 100644
--- a/linden/indra/llmessage/llcachename.h
+++ b/linden/indra/llmessage/llcachename.h
@@ -64,7 +64,7 @@ public:
64 void cancelCallback(const LLUUID& id, LLCacheNameCallback callback, void* user_data = NULL); 64 void cancelCallback(const LLUUID& id, LLCacheNameCallback callback, void* user_data = NULL);
65 65
66 // janky old format. Remove after a while. Phoenix. 2008-01-30 66 // janky old format. Remove after a while. Phoenix. 2008-01-30
67 void importFile(FILE* fp); 67 void importFile(LLFILE* fp);
68 68
69 // storing cache on disk; for viewer, in name.cache 69 // storing cache on disk; for viewer, in name.cache
70 bool importFile(std::istream& istr); 70 bool importFile(std::istream& istr);
diff --git a/linden/indra/llmessage/llcurl.cpp b/linden/indra/llmessage/llcurl.cpp
index a8bb46b..f03cebc 100644
--- a/linden/indra/llmessage/llcurl.cpp
+++ b/linden/indra/llmessage/llcurl.cpp
@@ -674,8 +674,9 @@ std::string LLCurl::strerror(CURLcode errorcode)
674// For generating a simple request for data 674// For generating a simple request for data
675// using one multi and one easy per request 675// using one multi and one easy per request
676 676
677LLCurlRequest::LLCurlRequest() 677LLCurlRequest::LLCurlRequest() :
678 : mActiveMulti(NULL) 678 mActiveMulti(NULL),
679 mActiveRequestCount(0)
679{ 680{
680} 681}
681 682
diff --git a/linden/indra/llmessage/lldatapacker.h b/linden/indra/llmessage/lldatapacker.h
index f41fb76..b1aa8fe 100644
--- a/linden/indra/llmessage/lldatapacker.h
+++ b/linden/indra/llmessage/lldatapacker.h
@@ -330,7 +330,7 @@ inline BOOL LLDataPackerAsciiBuffer::verifyLength(const S32 data_size, const cha
330class LLDataPackerAsciiFile : public LLDataPacker 330class LLDataPackerAsciiFile : public LLDataPacker
331{ 331{
332public: 332public:
333 LLDataPackerAsciiFile(FILE *fp, const S32 indent = 2) 333 LLDataPackerAsciiFile(LLFILE *fp, const S32 indent = 2)
334 : LLDataPacker(), 334 : LLDataPacker(),
335 mIndent(indent), 335 mIndent(indent),
336 mFP(fp), 336 mFP(fp),
@@ -407,7 +407,7 @@ protected:
407 407
408protected: 408protected:
409 S32 mIndent; 409 S32 mIndent;
410 FILE *mFP; 410 LLFILE *mFP;
411 std::ostream* mOutputStream; 411 std::ostream* mOutputStream;
412 std::istream* mInputStream; 412 std::istream* mInputStream;
413}; 413};
diff --git a/linden/indra/llmessage/llfiltersd2xmlrpc.cpp b/linden/indra/llmessage/llfiltersd2xmlrpc.cpp
index 4e38924..b3ebd0b 100644
--- a/linden/indra/llmessage/llfiltersd2xmlrpc.cpp
+++ b/linden/indra/llmessage/llfiltersd2xmlrpc.cpp
@@ -695,6 +695,24 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl(
695 buffer->readAfter(channels.in(), NULL, (U8*)buf, bytes); 695 buffer->readAfter(channels.in(), NULL, (U8*)buf, bytes);
696 696
697 //lldebugs << "xmlrpc request: " << buf << llendl; 697 //lldebugs << "xmlrpc request: " << buf << llendl;
698
699 // Check the value in the buffer. XMLRPC_REQUEST_FromXML will report a error code 4 if
700 // values that are less than 0x20 are passed to it, except
701 // 0x09: Horizontal tab; 0x0a: New Line; 0x0d: Carriage
702 U8* cur_pBuf = (U8*)buf;
703 U8 cur_char;
704 for (S32 i=0; i<bytes; i++)
705 {
706 cur_char = *cur_pBuf;
707 if ( cur_char < 0x20
708 && 0x09 != cur_char
709 && 0x0a != cur_char
710 && 0x0d != cur_char )
711 {
712 *cur_pBuf = '?';
713 }
714 ++cur_pBuf;
715 }
698 716
699 PUMP_DEBUG; 717 PUMP_DEBUG;
700 XMLRPC_REQUEST request = XMLRPC_REQUEST_FromXML( 718 XMLRPC_REQUEST request = XMLRPC_REQUEST_FromXML(
diff --git a/linden/indra/llmessage/llhttpassetstorage.cpp b/linden/indra/llmessage/llhttpassetstorage.cpp
index 80598c6..49896c6 100644
--- a/linden/indra/llmessage/llhttpassetstorage.cpp
+++ b/linden/indra/llmessage/llhttpassetstorage.cpp
@@ -334,6 +334,8 @@ void LLHTTPAssetRequest::finishCompressedUpload()
334 334
335size_t LLHTTPAssetRequest::readCompressedData(void* data, size_t size) 335size_t LLHTTPAssetRequest::readCompressedData(void* data, size_t size)
336{ 336{
337 llassert(mZInitialized);
338
337 mZStream.next_out = (Bytef*)data; 339 mZStream.next_out = (Bytef*)data;
338 mZStream.avail_out = size; 340 mZStream.avail_out = size;
339 341
diff --git a/linden/indra/llmessage/llhttpclient.h b/linden/indra/llmessage/llhttpclient.h
index 1587268..df31b44 100644
--- a/linden/indra/llmessage/llhttpclient.h
+++ b/linden/indra/llmessage/llhttpclient.h
@@ -77,7 +77,12 @@ public:
77 static void postFile(const std::string& url, const LLUUID& uuid, 77 static void postFile(const std::string& url, const LLUUID& uuid,
78 LLAssetType::EType asset_type, ResponderPtr responder, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); 78 LLAssetType::EType asset_type, ResponderPtr responder, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
79 79
80 // Blocking HTTP get that returns an LLSD map of status and body. 80 /**
81 * @brief Blocking HTTP get that returns an LLSD map of status and body.
82 *
83 * @param url the complete serialized (and escaped) url to get
84 * @return An LLSD of { 'status':status, 'body':payload }
85 */
81 static LLSD blockingGet(const std::string& url); 86 static LLSD blockingGet(const std::string& url);
82 87
83 static void del(const std::string& url, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS); 88 static void del(const std::string& url, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
diff --git a/linden/indra/llmessage/llhttpnode.cpp b/linden/indra/llmessage/llhttpnode.cpp
index 540b507..46f2061 100644
--- a/linden/indra/llmessage/llhttpnode.cpp
+++ b/linden/indra/llmessage/llhttpnode.cpp
@@ -426,8 +426,8 @@ void LLHTTPRegistrar::buildAllServices(LLHTTPNode& root)
426 FactoryMap::const_iterator end = map.end(); 426 FactoryMap::const_iterator end = map.end();
427 for (; i != end; ++i) 427 for (; i != end; ++i)
428 { 428 {
429 llinfos << "LLHTTPRegistrar::buildAllServices adding node for path " 429 LL_DEBUGS("AppInit") << "LLHTTPRegistrar::buildAllServices adding node for path "
430 << i->first << llendl; 430 << i->first << LL_ENDL;
431 431
432 root.addNode(i->first, i->second->build()); 432 root.addNode(i->first, i->second->build());
433 } 433 }
diff --git a/linden/indra/llmessage/llmessageconfig.cpp b/linden/indra/llmessage/llmessageconfig.cpp
index 807a35b..e23ed07 100644
--- a/linden/indra/llmessage/llmessageconfig.cpp
+++ b/linden/indra/llmessage/llmessageconfig.cpp
@@ -66,6 +66,7 @@ public:
66 66
67 /* virtual */ void loadFile(); 67 /* virtual */ void loadFile();
68 void loadServerDefaults(const LLSD& data); 68 void loadServerDefaults(const LLSD& data);
69 void loadMaxQueuedEvents(const LLSD& data);
69 void loadMessages(const LLSD& data); 70 void loadMessages(const LLSD& data);
70 void loadCapBans(const LLSD& blacklist); 71 void loadCapBans(const LLSD& blacklist);
71 void loadMessageBans(const LLSD& blacklist); 72 void loadMessageBans(const LLSD& blacklist);
@@ -73,6 +74,7 @@ public:
73 74
74public: 75public:
75 LLSD mCapBans; 76 LLSD mCapBans;
77 S32 mMaxQueuedEvents;
76}; 78};
77 79
78std::string LLMessageConfigFile::filename() 80std::string LLMessageConfigFile::filename()
@@ -99,19 +101,20 @@ void LLMessageConfigFile::loadFile()
99 101
100 if (file.is_open()) 102 if (file.is_open())
101 { 103 {
102 llinfos << "Loading message.xml file at " << filename() << llendl; 104 LL_DEBUGS("AppInit") << "Loading message.xml file at " << filename() << LL_ENDL;
103 LLSDSerialize::fromXML(data, file); 105 LLSDSerialize::fromXML(data, file);
104 } 106 }
105 107
106 if (data.isUndefined()) 108 if (data.isUndefined())
107 { 109 {
108 llinfos << "LLMessageConfigFile::loadFile: file missing," 110 LL_INFOS("AppInit") << "LLMessageConfigFile::loadFile: file missing,"
109 " ill-formed, or simply undefined; not changing the" 111 " ill-formed, or simply undefined; not changing the"
110 " file" << llendl; 112 " file" << LL_ENDL;
111 return; 113 return;
112 } 114 }
113 } 115 }
114 loadServerDefaults(data); 116 loadServerDefaults(data);
117 loadMaxQueuedEvents(data);
115 loadMessages(data); 118 loadMessages(data);
116 loadCapBans(data); 119 loadCapBans(data);
117 loadMessageBans(data); 120 loadMessageBans(data);
@@ -122,6 +125,19 @@ void LLMessageConfigFile::loadServerDefaults(const LLSD& data)
122 mServerDefault = data["serverDefaults"][sServerName].asString(); 125 mServerDefault = data["serverDefaults"][sServerName].asString();
123} 126}
124 127
128const S32 DEFAULT_MAX_QUEUED_EVENTS = 100;
129void LLMessageConfigFile::loadMaxQueuedEvents(const LLSD& data)
130{
131 if (data.has("maxQueuedEvents"))
132 {
133 mMaxQueuedEvents = data["maxQueuedEvents"].asInteger();
134 }
135 else
136 {
137 mMaxQueuedEvents = DEFAULT_MAX_QUEUED_EVENTS;
138 }
139}
140
125void LLMessageConfigFile::loadMessages(const LLSD& data) 141void LLMessageConfigFile::loadMessages(const LLSD& data)
126{ 142{
127 mMessages = data["messages"]; 143 mMessages = data["messages"];
@@ -141,15 +157,15 @@ void LLMessageConfigFile::loadCapBans(const LLSD& data)
141 LLSD bans = data["capBans"]; 157 LLSD bans = data["capBans"];
142 if (!bans.isMap()) 158 if (!bans.isMap())
143 { 159 {
144 llinfos << "LLMessageConfigFile::loadCapBans: missing capBans section" 160 LL_INFOS("AppInit") << "LLMessageConfigFile::loadCapBans: missing capBans section"
145 << llendl; 161 << LL_ENDL;
146 return; 162 return;
147 } 163 }
148 164
149 mCapBans = bans; 165 mCapBans = bans;
150 166
151 llinfos << "LLMessageConfigFile::loadCapBans: " 167 LL_DEBUGS("AppInit") << "LLMessageConfigFile::loadCapBans: "
152 << bans.size() << " ban tests" << llendl; 168 << bans.size() << " ban tests" << LL_ENDL;
153} 169}
154 170
155void LLMessageConfigFile::loadMessageBans(const LLSD& data) 171void LLMessageConfigFile::loadMessageBans(const LLSD& data)
@@ -157,8 +173,8 @@ void LLMessageConfigFile::loadMessageBans(const LLSD& data)
157 LLSD bans = data["messageBans"]; 173 LLSD bans = data["messageBans"];
158 if (!bans.isMap()) 174 if (!bans.isMap())
159 { 175 {
160 llinfos << "LLMessageConfigFile::loadMessageBans: missing messageBans section" 176 LL_INFOS("AppInit") << "LLMessageConfigFile::loadMessageBans: missing messageBans section"
161 << llendl; 177 << LL_ENDL;
162 return; 178 return;
163 } 179 }
164 180
@@ -182,8 +198,8 @@ void LLMessageConfig::initClass(const std::string& server_name,
182 sServerName = server_name; 198 sServerName = server_name;
183 sConfigDir = config_dir; 199 sConfigDir = config_dir;
184 (void) LLMessageConfigFile::instance(); 200 (void) LLMessageConfigFile::instance();
185 llinfos << "LLMessageConfig::initClass config file " 201 LL_DEBUGS("AppInit") << "LLMessageConfig::initClass config file "
186 << config_dir << "/" << messageConfigFileName << llendl; 202 << config_dir << "/" << messageConfigFileName << LL_ENDL;
187} 203}
188 204
189//static 205//static
@@ -191,10 +207,10 @@ void LLMessageConfig::useConfig(const LLSD& config)
191{ 207{
192 LLMessageConfigFile &the_file = LLMessageConfigFile::instance(); 208 LLMessageConfigFile &the_file = LLMessageConfigFile::instance();
193 the_file.loadServerDefaults(config); 209 the_file.loadServerDefaults(config);
210 the_file.loadMaxQueuedEvents(config);
194 the_file.loadMessages(config); 211 the_file.loadMessages(config);
195 the_file.loadCapBans(config); 212 the_file.loadCapBans(config);
196 the_file.loadMessageBans(config); 213 the_file.loadMessageBans(config);
197
198} 214}
199 215
200//static 216//static
@@ -213,6 +229,13 @@ LLMessageConfig::Flavor LLMessageConfig::getServerDefaultFlavor()
213} 229}
214 230
215//static 231//static
232S32 LLMessageConfig::getMaxQueuedEvents()
233{
234 LLMessageConfigFile& file = LLMessageConfigFile::instance();
235 return file.mMaxQueuedEvents;
236}
237
238//static
216LLMessageConfig::Flavor LLMessageConfig::getMessageFlavor(const std::string& msg_name) 239LLMessageConfig::Flavor LLMessageConfig::getMessageFlavor(const std::string& msg_name)
217{ 240{
218 LLMessageConfigFile& file = LLMessageConfigFile::instance(); 241 LLMessageConfigFile& file = LLMessageConfigFile::instance();
diff --git a/linden/indra/llmessage/llmessageconfig.h b/linden/indra/llmessage/llmessageconfig.h
index 9b62f06..61788c7 100644
--- a/linden/indra/llmessage/llmessageconfig.h
+++ b/linden/indra/llmessage/llmessageconfig.h
@@ -48,6 +48,7 @@ public:
48 static void useConfig(const LLSD& config); 48 static void useConfig(const LLSD& config);
49 49
50 static Flavor getServerDefaultFlavor(); 50 static Flavor getServerDefaultFlavor();
51 static S32 getMaxQueuedEvents();
51 52
52 // For individual messages 53 // For individual messages
53 static Flavor getMessageFlavor(const std::string& msg_name); 54 static Flavor getMessageFlavor(const std::string& msg_name);
diff --git a/linden/indra/llmessage/llregionhandle.h b/linden/indra/llmessage/llregionhandle.h
index ac7fb14..7e62e96 100644
--- a/linden/indra/llmessage/llregionhandle.h
+++ b/linden/indra/llmessage/llregionhandle.h
@@ -115,7 +115,7 @@ inline LLVector3d from_region_handle(const U64 &region_handle)
115 115
116// grid-based region handle encoding. pass in a grid position 116// grid-based region handle encoding. pass in a grid position
117// (eg: 1000,1000) and this will return the region handle. 117// (eg: 1000,1000) and this will return the region handle.
118inline U64 grid_to_region_handle(U32 grid_x, U32 grid_y) 118inline U64 grid_to_region_handle(const U32 grid_x, const U32 grid_y)
119{ 119{
120 return to_region_handle(grid_x * REGION_WIDTH_UNITS, 120 return to_region_handle(grid_x * REGION_WIDTH_UNITS,
121 grid_y * REGION_WIDTH_UNITS); 121 grid_y * REGION_WIDTH_UNITS);
diff --git a/linden/indra/llmessage/lltransfermanager.cpp b/linden/indra/llmessage/lltransfermanager.cpp
index 6fbb4f9..7817dba 100644
--- a/linden/indra/llmessage/lltransfermanager.cpp
+++ b/linden/indra/llmessage/lltransfermanager.cpp
@@ -1336,7 +1336,9 @@ BOOL LLTransferSourceParamsInvItem::unpackParams(LLDataPacker &dp)
1336} 1336}
1337 1337
1338LLTransferSourceParamsEstate::LLTransferSourceParamsEstate() : 1338LLTransferSourceParamsEstate::LLTransferSourceParamsEstate() :
1339 LLTransferSourceParams(LLTST_SIM_ESTATE), mEstateAssetType(ET_NONE) 1339 LLTransferSourceParams(LLTST_SIM_ESTATE),
1340 mEstateAssetType(ET_NONE),
1341 mAssetType(LLAssetType::AT_NONE)
1340{ 1342{
1341} 1343}
1342 1344
diff --git a/linden/indra/llmessage/lltransfersourcefile.cpp b/linden/indra/llmessage/lltransfersourcefile.cpp
index 55f368f..4b60cf3 100644
--- a/linden/indra/llmessage/lltransfersourcefile.cpp
+++ b/linden/indra/llmessage/lltransfersourcefile.cpp
@@ -153,7 +153,9 @@ BOOL LLTransferSourceFile::unpackParams(LLDataPacker &dp)
153} 153}
154 154
155 155
156LLTransferSourceParamsFile::LLTransferSourceParamsFile() : LLTransferSourceParams(LLTST_FILE) 156LLTransferSourceParamsFile::LLTransferSourceParamsFile() :
157 LLTransferSourceParams(LLTST_FILE),
158 mDeleteOnCompletion(FALSE)
157{ 159{
158} 160}
159 161
diff --git a/linden/indra/llmessage/lltransfersourcefile.h b/linden/indra/llmessage/lltransfersourcefile.h
index 1a9ff9e..030f80e 100644
--- a/linden/indra/llmessage/lltransfersourcefile.h
+++ b/linden/indra/llmessage/lltransfersourcefile.h
@@ -74,7 +74,7 @@ protected:
74 74
75protected: 75protected:
76 LLTransferSourceParamsFile mParams; 76 LLTransferSourceParamsFile mParams;
77 FILE *mFP; 77 LLFILE *mFP;
78}; 78};
79 79
80#endif // LL_LLTRANSFERSOURCEFILE_H 80#endif // LL_LLTRANSFERSOURCEFILE_H
diff --git a/linden/indra/llmessage/lltransfertargetfile.h b/linden/indra/llmessage/lltransfertargetfile.h
index 3f5284e..02c0c11 100644
--- a/linden/indra/llmessage/lltransfertargetfile.h
+++ b/linden/indra/llmessage/lltransfertargetfile.h
@@ -69,7 +69,7 @@ protected:
69 69
70 LLTransferTargetParamsFile mParams; 70 LLTransferTargetParamsFile mParams;
71 71
72 FILE *mFP; 72 LLFILE *mFP;
73}; 73};
74 74
75#endif // LL_LLTRANSFERTARGETFILE_H 75#endif // LL_LLTRANSFERTARGETFILE_H
diff --git a/linden/indra/llmessage/llxfer_file.cpp b/linden/indra/llmessage/llxfer_file.cpp
index 027bacb..840d84c 100644
--- a/linden/indra/llmessage/llxfer_file.cpp
+++ b/linden/indra/llmessage/llxfer_file.cpp
@@ -353,7 +353,7 @@ S32 LLXfer_File::processEOF()
353 } 353 }
354 else 354 else
355 { 355 {
356 //FILE* fp = LLFile::fopen(mTempFilename, "r"); 356 //LLFILE* fp = LLFile::fopen(mTempFilename, "r");
357 //llwarns << "File " << mTempFilename << " does " 357 //llwarns << "File " << mTempFilename << " does "
358 // << (!fp ? "not" : "" ) << " exit." << llendl; 358 // << (!fp ? "not" : "" ) << " exit." << llendl;
359 //if(fp) fclose(fp); 359 //if(fp) fclose(fp);
@@ -424,8 +424,8 @@ U32 LLXfer_File::getXferTypeTag()
424S32 copy_file(const char* from, const char* to) 424S32 copy_file(const char* from, const char* to)
425{ 425{
426 S32 rv = 0; 426 S32 rv = 0;
427 FILE* in = LLFile::fopen(from, "rb"); /*Flawfinder: ignore*/ 427 LLFILE* in = LLFile::fopen(from, "rb"); /*Flawfinder: ignore*/
428 FILE* out = LLFile::fopen(to, "wb"); /*Flawfinder: ignore*/ 428 LLFILE* out = LLFile::fopen(to, "wb"); /*Flawfinder: ignore*/
429 if(in && out) 429 if(in && out)
430 { 430 {
431 S32 read = 0; 431 S32 read = 0;
diff --git a/linden/indra/llmessage/llxfer_file.h b/linden/indra/llmessage/llxfer_file.h
index 7958af1..b5294ad 100644
--- a/linden/indra/llmessage/llxfer_file.h
+++ b/linden/indra/llmessage/llxfer_file.h
@@ -38,7 +38,7 @@
38class LLXfer_File : public LLXfer 38class LLXfer_File : public LLXfer
39{ 39{
40 protected: 40 protected:
41 FILE *mFp; 41 LLFILE *mFp;
42 char mLocalFilename[LL_MAX_PATH]; /* Flawfinder : ignore */ 42 char mLocalFilename[LL_MAX_PATH]; /* Flawfinder : ignore */
43 char mRemoteFilename[LL_MAX_PATH]; /* Flawfinder : ignore */ 43 char mRemoteFilename[LL_MAX_PATH]; /* Flawfinder : ignore */
44 ELLPath mRemotePath; 44 ELLPath mRemotePath;
diff --git a/linden/indra/llmessage/llxfermanager.cpp b/linden/indra/llmessage/llxfermanager.cpp
index 47c950b..f7b83ec 100644
--- a/linden/indra/llmessage/llxfermanager.cpp
+++ b/linden/indra/llmessage/llxfermanager.cpp
@@ -143,8 +143,8 @@ void LLXferManager::setAckThrottleBPS(const F32 bps)
143 143
144 // Set 144 // Set
145 F32 actual_rate = llmax(min_bps*1.1f, bps); 145 F32 actual_rate = llmax(min_bps*1.1f, bps);
146 llinfos << "LLXferManager ack throttle min rate: " << min_bps << llendl; 146 LL_DEBUGS("AppInit") << "LLXferManager ack throttle min rate: " << min_bps << LL_ENDL;
147 llinfos << "LLXferManager ack throttle actual rate: " << actual_rate << llendl; 147 LL_DEBUGS("AppInit") << "LLXferManager ack throttle actual rate: " << actual_rate << LL_ENDL;
148 mAckThrottle.setRate(actual_rate); 148 mAckThrottle.setRate(actual_rate);
149} 149}
150 150
diff --git a/linden/indra/llmessage/message.cpp b/linden/indra/llmessage/message.cpp
index c572341..f3aac29 100644
--- a/linden/indra/llmessage/message.cpp
+++ b/linden/indra/llmessage/message.cpp
@@ -120,7 +120,7 @@ namespace
120 // don't spam when agent communication disconnected already 120 // don't spam when agent communication disconnected already
121 if (status != 410) 121 if (status != 410)
122 { 122 {
123 llwarns << "error status " << status 123 LL_WARNS("Messaging") << "error status " << status
124 << " for message " << mMessageName 124 << " for message " << mMessageName
125 << " reason " << reason << llendl; 125 << " reason " << reason << llendl;
126 } 126 }
@@ -176,7 +176,7 @@ void LLTrustedMessageService::post(LLHTTPNode::ResponsePtr response,
176 gMessageSystem->isTrustedMessage(name))) 176 gMessageSystem->isTrustedMessage(name)))
177 && !gMessageSystem->isTrustedSender(LLHost(sender))) 177 && !gMessageSystem->isTrustedSender(LLHost(sender)))
178 { 178 {
179 llwarns << "trusted message POST to /trusted-message/" 179 LL_WARNS("Messaging") << "trusted message POST to /trusted-message/"
180 << name << " from unknown or untrusted sender " 180 << name << " from unknown or untrusted sender "
181 << sender << llendl; 181 << sender << llendl;
182 response->status(403, "Unknown or untrusted sender"); 182 response->status(403, "Unknown or untrusted sender");
@@ -326,14 +326,14 @@ LLMessageSystem::LLMessageSystem(const char *filename, U32 port,
326 mbError = TRUE; 326 mbError = TRUE;
327 mErrorCode = error; 327 mErrorCode = error;
328 } 328 }
329 //llinfos << << "*** port: " << mPort << llendl; 329// LL_DEBUGS("Messaging") << << "*** port: " << mPort << llendl;
330 330
331 // 331 //
332 // Create the data structure that we can poll on 332 // Create the data structure that we can poll on
333 // 333 //
334 if (!gAPRPoolp) 334 if (!gAPRPoolp)
335 { 335 {
336 llerrs << "No APR pool before message system initialization!" << llendl; 336 LL_ERRS("Messaging") << "No APR pool before message system initialization!" << llendl;
337 ll_init_apr(); 337 ll_init_apr();
338 } 338 }
339 apr_socket_t *aprSocketp = NULL; 339 apr_socket_t *aprSocketp = NULL;
@@ -369,7 +369,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
369{ 369{
370 if(!filename) 370 if(!filename)
371 { 371 {
372 llerrs << "No template filename specified" << llendl; 372 LL_ERRS("Messaging") << "No template filename specified" << llendl;
373 mbError = TRUE; 373 mbError = TRUE;
374 return; 374 return;
375 } 375 }
@@ -377,7 +377,7 @@ void LLMessageSystem::loadTemplateFile(const char* filename)
377 std::string template_body; 377 std::string template_body;
378 if(!_read_file_into_string(template_body, filename)) 378 if(!_read_file_into_string(template_body, filename))
379 { 379 {
380 llwarns << "Failed to open template: " << filename << llendl; 380 LL_WARNS("Messaging") << "Failed to open template: " << filename << llendl;
381 mbError = TRUE; 381 mbError = TRUE;
382 return; 382 return;
383 } 383 }
@@ -588,7 +588,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
588 // Ones that are non-zero but below the minimum packet size are worrisome. 588 // Ones that are non-zero but below the minimum packet size are worrisome.
589 if (receive_size > 0) 589 if (receive_size > 0)
590 { 590 {
591 llwarns << "Invalid (too short) packet discarded " << receive_size << llendl; 591 LL_WARNS("Messaging") << "Invalid (too short) packet discarded " << receive_size << llendl;
592 callExceptionFunc(MX_PACKET_TOO_SHORT); 592 callExceptionFunc(MX_PACKET_TOO_SHORT);
593 } 593 }
594 // no data in packet receive buffer 594 // no data in packet receive buffer
@@ -612,7 +612,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
612 { 612 {
613 // mal-formed packet. ignore it and continue with 613 // mal-formed packet. ignore it and continue with
614 // the next one 614 // the next one
615 llwarns << "Malformed packet received. Packet size " 615 LL_WARNS("Messaging") << "Malformed packet received. Packet size "
616 << receive_size << " with invalid no. of acks " << acks 616 << receive_size << " with invalid no. of acks " << acks
617 << llendl; 617 << llendl;
618 valid_packet = FALSE; 618 valid_packet = FALSE;
@@ -642,7 +642,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
642 memcpy(&mem_id, &mTrueReceiveBuffer[true_rcv_size], /* Flawfinder: ignore*/ 642 memcpy(&mem_id, &mTrueReceiveBuffer[true_rcv_size], /* Flawfinder: ignore*/
643 sizeof(TPACKETID)); 643 sizeof(TPACKETID));
644 packet_id = ntohl(mem_id); 644 packet_id = ntohl(mem_id);
645 //llinfos << "got ack: " << packet_id << llendl; 645 //LL_INFOS("Messaging") << "got ack: " << packet_id << llendl;
646 cdp->ackReliablePacket(packet_id); 646 cdp->ackReliablePacket(packet_id);
647 } 647 }
648 if (!cdp->getUnackedPacketCount()) 648 if (!cdp->getUnackedPacketCount())
@@ -671,7 +671,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
671 // TESTING CODE 671 // TESTING CODE
672 //if(mCircuitInfo.mCurrentCircuit->mHost != host) 672 //if(mCircuitInfo.mCurrentCircuit->mHost != host)
673 //{ 673 //{
674 // llwarns << "DISCARDED PACKET HOST MISMATCH! HOST: " 674 // LL_WARNS("Messaging") << "DISCARDED PACKET HOST MISMATCH! HOST: "
675 // << host << " CIRCUIT: " 675 // << host << " CIRCUIT: "
676 // << mCircuitInfo.mCurrentCircuit->mHost 676 // << mCircuitInfo.mCurrentCircuit->mHost
677 // << llendl; 677 // << llendl;
@@ -681,7 +681,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
681 cdp->collectRAck(mCurrentRecvPacketID); 681 cdp->collectRAck(mCurrentRecvPacketID);
682 } 682 }
683 683
684 //llinfos << "Discarding duplicate resend from " << host << llendl; 684 LL_DEBUGS("Messaging") << "Discarding duplicate resend from " << host << llendl;
685 if(mVerboseLog) 685 if(mVerboseLog)
686 { 686 {
687 std::ostringstream str; 687 std::ostringstream str;
@@ -693,7 +693,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
693 << " resent " 693 << " resent "
694 << ((acks > 0) ? "acks" : "") 694 << ((acks > 0) ? "acks" : "")
695 << " DISCARD DUPLICATE"; 695 << " DISCARD DUPLICATE";
696 llinfos << str.str() << llendl; 696 LL_INFOS("Messaging") << str.str() << llendl;
697 } 697 }
698 mPacketsIn++; 698 mPacketsIn++;
699 valid_packet = FALSE; 699 valid_packet = FALSE;
@@ -740,7 +740,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
740 valid_packet && 740 valid_packet &&
741 mTemplateMessageReader->isBanned(cdp && cdp->getTrusted())) 741 mTemplateMessageReader->isBanned(cdp && cdp->getTrusted()))
742 { 742 {
743 llwarns << "LLMessageSystem::checkMessages " 743 LL_WARNS("Messaging") << "LLMessageSystem::checkMessages "
744 << "received banned message " 744 << "received banned message "
745 << mTemplateMessageReader->getMessageName() 745 << mTemplateMessageReader->getMessageName()
746 << " from " 746 << " from "
@@ -764,7 +764,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
764 if (valid_packet) 764 if (valid_packet)
765 { 765 {
766 // enable this for output of message names 766 // enable this for output of message names
767 //llinfos << "< \"" << mTemplateMessageReader->getMessageName() 767 //LL_INFOS("Messaging") << "< \"" << mTemplateMessageReader->getMessageName()
768 //<< "\"" << llendl; 768 //<< "\"" << llendl;
769 769
770 /* Code for dumping the complete contents of a message. Keep for future use in optimizing messages. 770 /* Code for dumping the complete contents of a message. Keep for future use in optimizing messages.
@@ -773,23 +773,23 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
773 static char* object_update = LLMessageStringTable::getInstance()->getString("ObjectUpdate"); 773 static char* object_update = LLMessageStringTable::getInstance()->getString("ObjectUpdate");
774 if(object_update == mTemplateMessageReader->getMessageName() ) 774 if(object_update == mTemplateMessageReader->getMessageName() )
775 { 775 {
776 llinfos << "ObjectUpdate:" << llendl; 776 LL_INFOS("Messaging") << "ObjectUpdate:" << llendl;
777 U32 i; 777 U32 i;
778 llinfos << " Zero Encoded: " << zero_unexpanded_size << llendl; 778 LL_INFOS("Messaging") << " Zero Encoded: " << zero_unexpanded_size << llendl;
779 for( i = 0; i<zero_unexpanded_size; i++ ) 779 for( i = 0; i<zero_unexpanded_size; i++ )
780 { 780 {
781 llinfos << " " << i << ": " << (U32) zero_unexpanded_buffer[i] << llendl; 781 LL_INFOS("Messaging") << " " << i << ": " << (U32) zero_unexpanded_buffer[i] << llendl;
782 } 782 }
783 llinfos << "" << llendl; 783 LL_INFOS("Messaging") << "" << llendl;
784 784
785 llinfos << " Zero Unencoded: " << receive_size << llendl; 785 LL_INFOS("Messaging") << " Zero Unencoded: " << receive_size << llendl;
786 for( i = 0; i<receive_size; i++ ) 786 for( i = 0; i<receive_size; i++ )
787 { 787 {
788 llinfos << " " << i << ": " << (U32) buffer[i] << llendl; 788 LL_INFOS("Messaging") << " " << i << ": " << (U32) buffer[i] << llendl;
789 } 789 }
790 llinfos << "" << llendl; 790 LL_INFOS("Messaging") << "" << llendl;
791 791
792 llinfos << " Blocks and variables: " << llendl; 792 LL_INFOS("Messaging") << " Blocks and variables: " << llendl;
793 S32 byte_count = 0; 793 S32 byte_count = 0;
794 for (LLMessageTemplate::message_block_map_t::iterator 794 for (LLMessageTemplate::message_block_map_t::iterator
795 iter = mCurrentRMessageTemplate->mMemberBlocks.begin(), 795 iter = mCurrentRMessageTemplate->mMemberBlocks.begin(),
@@ -807,7 +807,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
807 807
808 if( getNumberOfBlocksFast( block_name ) < 1 ) 808 if( getNumberOfBlocksFast( block_name ) < 1 )
809 { 809 {
810 llinfos << var_name << " has no blocks" << llendl; 810 LL_INFOS("Messaging") << var_name << " has no blocks" << llendl;
811 } 811 }
812 for( S32 blocknum = 0; blocknum < getNumberOfBlocksFast( block_name ); blocknum++ ) 812 for( S32 blocknum = 0; blocknum < getNumberOfBlocksFast( block_name ); blocknum++ )
813 { 813 {
@@ -820,7 +820,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
820 if (!msg_block_data) 820 if (!msg_block_data)
821 { 821 {
822 sprintf(errmsg, "Block %s #%d not in message %s", block_name, blocknum, mCurrentRMessageData->mName); 822 sprintf(errmsg, "Block %s #%d not in message %s", block_name, blocknum, mCurrentRMessageData->mName);
823 llerrs << errmsg << llendl; 823 LL_ERRS("Messaging") << errmsg << llendl;
824 } 824 }
825 825
826 LLMsgVarData vardata = msg_block_data->mMemberVarData[vnamep]; 826 LLMsgVarData vardata = msg_block_data->mMemberVarData[vnamep];
@@ -828,7 +828,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
828 if (!vardata.getName()) 828 if (!vardata.getName())
829 { 829 {
830 sprintf(errmsg, "Variable %s not in message %s block %s", vnamep, mCurrentRMessageData->mName, bnamep); 830 sprintf(errmsg, "Variable %s not in message %s block %s", vnamep, mCurrentRMessageData->mName, bnamep);
831 llerrs << errmsg << llendl; 831 LL_ERRS("Messaging") << errmsg << llendl;
832 } 832 }
833 833
834 const S32 vardata_size = vardata.getSize(); 834 const S32 vardata_size = vardata.getSize();
@@ -837,17 +837,17 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
837 for( i = 0; i < vardata_size; i++ ) 837 for( i = 0; i < vardata_size; i++ )
838 { 838 {
839 byte_count++; 839 byte_count++;
840 llinfos << block_name << " " << var_name << " [" << blocknum << "][" << i << "]= " << (U32)(((U8*)vardata.getData())[i]) << llendl; 840 LL_INFOS("Messaging") << block_name << " " << var_name << " [" << blocknum << "][" << i << "]= " << (U32)(((U8*)vardata.getData())[i]) << llendl;
841 } 841 }
842 } 842 }
843 else 843 else
844 { 844 {
845 llinfos << block_name << " " << var_name << " [" << blocknum << "] 0 bytes" << llendl; 845 LL_INFOS("Messaging") << block_name << " " << var_name << " [" << blocknum << "] 0 bytes" << llendl;
846 } 846 }
847 } 847 }
848 } 848 }
849 } 849 }
850 llinfos << "Byte count =" << byte_count << llendl; 850 LL_INFOS("Messaging") << "Byte count =" << byte_count << llendl;
851 } 851 }
852 } 852 }
853 */ 853 */
@@ -871,7 +871,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
871 { 871 {
872 if (mbProtected && (!cdp)) 872 if (mbProtected && (!cdp))
873 { 873 {
874 llwarns << "Invalid Packet from invalid circuit " << host << llendl; 874 LL_WARNS("Messaging") << "Invalid Packet from invalid circuit " << host << llendl;
875 mOffCircuitPackets++; 875 mOffCircuitPackets++;
876 } 876 }
877 else 877 else
@@ -944,7 +944,7 @@ void LLMessageSystem::processAcks()
944 944
945 if (!mDenyTrustedCircuitSet.empty()) 945 if (!mDenyTrustedCircuitSet.empty())
946 { 946 {
947 llinfos << "Sending queued DenyTrustedCircuit messages." << llendl; 947 LL_INFOS("Messaging") << "Sending queued DenyTrustedCircuit messages." << llendl;
948 for (host_set_t::iterator hostit = mDenyTrustedCircuitSet.begin(); hostit != mDenyTrustedCircuitSet.end(); ++hostit) 948 for (host_set_t::iterator hostit = mDenyTrustedCircuitSet.begin(); hostit != mDenyTrustedCircuitSet.end(); ++hostit)
949 { 949 {
950 reallySendDenyTrustedCircuit(*hostit); 950 reallySendDenyTrustedCircuit(*hostit);
@@ -1176,7 +1176,7 @@ LLHTTPClient::ResponderPtr LLMessageSystem::createResponder(const std::string& n
1176 { 1176 {
1177 // These messages aren't really unreliable, they just weren't 1177 // These messages aren't really unreliable, they just weren't
1178 // explicitly sent as reliable, so they don't have a callback 1178 // explicitly sent as reliable, so they don't have a callback
1179// llwarns << "LLMessageSystem::sendMessage: Sending unreliable " 1179// LL_WARNS("Messaging") << "LLMessageSystem::sendMessage: Sending unreliable "
1180// << mMessageBuilder->getMessageName() << " message via HTTP" 1180// << mMessageBuilder->getMessageName() << " message via HTTP"
1181// << llendl; 1181// << llendl;
1182 return new LLFnPtrResponder( 1182 return new LLFnPtrResponder(
@@ -1213,10 +1213,10 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
1213 // yup! don't send packets to an unknown circuit 1213 // yup! don't send packets to an unknown circuit
1214 if(mVerboseLog) 1214 if(mVerboseLog)
1215 { 1215 {
1216 llinfos << "MSG: -> " << host << "\tUNKNOWN CIRCUIT:\t" 1216 LL_INFOS_ONCE("Messaging") << "MSG: -> " << host << "\tUNKNOWN CIRCUIT:\t"
1217 << mMessageBuilder->getMessageName() << llendl; 1217 << mMessageBuilder->getMessageName() << llendl;
1218 } 1218 }
1219 llwarns << "sendMessage - Trying to send " 1219 LL_WARNS_ONCE("Messaging") << "sendMessage - Trying to send "
1220 << mMessageBuilder->getMessageName() << " on unknown circuit " 1220 << mMessageBuilder->getMessageName() << " on unknown circuit "
1221 << host << llendl; 1221 << host << llendl;
1222 return 0; 1222 return 0;
@@ -1236,10 +1236,10 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
1236 // nope. don't send to dead circuits 1236 // nope. don't send to dead circuits
1237 if(mVerboseLog) 1237 if(mVerboseLog)
1238 { 1238 {
1239 llinfos << "MSG: -> " << host << "\tDEAD CIRCUIT\t\t" 1239 LL_INFOS("Messaging") << "MSG: -> " << host << "\tDEAD CIRCUIT\t\t"
1240 << mMessageBuilder->getMessageName() << llendl; 1240 << mMessageBuilder->getMessageName() << llendl;
1241 } 1241 }
1242 llwarns << "sendMessage - Trying to send message " 1242 LL_WARNS("Messaging") << "sendMessage - Trying to send message "
1243 << mMessageBuilder->getMessageName() << " to dead circuit " 1243 << mMessageBuilder->getMessageName() << " to dead circuit "
1244 << host << llendl; 1244 << host << llendl;
1245 return 0; 1245 return 0;
@@ -1283,7 +1283,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
1283 if((mMessageBuilder->getMessageName() != _PREHASH_ChildAgentUpdate) 1283 if((mMessageBuilder->getMessageName() != _PREHASH_ChildAgentUpdate)
1284 && (mMessageBuilder->getMessageName() != _PREHASH_SendXferPacket)) 1284 && (mMessageBuilder->getMessageName() != _PREHASH_SendXferPacket))
1285 { 1285 {
1286 llwarns << "sendMessage - Trying to send " 1286 LL_WARNS("Messaging") << "sendMessage - Trying to send "
1287 << ((buffer_length > 4000) ? "EXTRA " : "") 1287 << ((buffer_length > 4000) ? "EXTRA " : "")
1288 << "BIG message " << mMessageBuilder->getMessageName() << " - " 1288 << "BIG message " << mMessageBuilder->getMessageName() << " - "
1289 << buffer_length << llendl; 1289 << buffer_length << llendl;
@@ -1348,7 +1348,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
1348 // append_acout_count is incorrect or that 1348 // append_acout_count is incorrect or that
1349 // MAX_BUFFER_SIZE has fallen below MTU which is bad 1349 // MAX_BUFFER_SIZE has fallen below MTU which is bad
1350 // and probably programmer error. 1350 // and probably programmer error.
1351 llerrs << "Buffer packing failed due to size.." << llendl; 1351 LL_ERRS("Messaging") << "Buffer packing failed due to size.." << llendl;
1352 } 1352 }
1353 } 1353 }
1354 1354
@@ -1389,13 +1389,9 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
1389 std::ostream_iterator<TPACKETID> append(str, " "); 1389 std::ostream_iterator<TPACKETID> append(str, " ");
1390 std::copy(acks.begin(), acks.end(), append); 1390 std::copy(acks.begin(), acks.end(), append);
1391 } 1391 }
1392 llinfos << str.str() << llendl; 1392 LL_INFOS("Messaging") << str.str() << llendl;
1393 } 1393 }
1394 1394
1395 /*lldebugst(LLERR_MESSAGE) << "MessageSent at: " << (S32)totalTime()
1396 << "," << mMessageBuilder->getMessageName()
1397 << " to " << host
1398 << llendl;*/
1399 1395
1400 mPacketsOut++; 1396 mPacketsOut++;
1401 mBytesOut += buffer_length; 1397 mBytesOut += buffer_length;
@@ -1417,7 +1413,7 @@ void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, BOOL recv_re
1417 << nullToEmpty(mMessageReader->getMessageName()) 1413 << nullToEmpty(mMessageReader->getMessageName())
1418 << (recv_reliable ? " reliable" : "") 1414 << (recv_reliable ? " reliable" : "")
1419 << " REJECTED"; 1415 << " REJECTED";
1420 llinfos << str.str() << llendl; 1416 LL_INFOS("Messaging") << str.str() << llendl;
1421 } 1417 }
1422 // nope! 1418 // nope!
1423 // cout << "Rejecting unexpected message " << mCurrentMessageTemplate->mName << " from " << hex << ip << " , " << dec << port << endl; 1419 // cout << "Rejecting unexpected message " << mCurrentMessageTemplate->mName << " from " << hex << ip << " , " << dec << port << endl;
@@ -1425,7 +1421,7 @@ void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, BOOL recv_re
1425 // Keep track of rejected messages as well 1421 // Keep track of rejected messages as well
1426 if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM) 1422 if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM)
1427 { 1423 {
1428 llwarns << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << llendl; 1424 LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << llendl;
1429 } 1425 }
1430 else 1426 else
1431 { 1427 {
@@ -1444,13 +1440,13 @@ S32 LLMessageSystem::sendMessage(
1444{ 1440{
1445 if (!(host.isOk())) 1441 if (!(host.isOk()))
1446 { 1442 {
1447 llwarns << "trying to send message to invalid host" << llendl; 1443 LL_WARNS("Messaging") << "trying to send message to invalid host" << llendl;
1448 return 0; 1444 return 0;
1449 } 1445 }
1450 newMessage(name); 1446 newMessage(name);
1451 if (mMessageBuilder != mLLSDMessageBuilder) 1447 if (mMessageBuilder != mLLSDMessageBuilder)
1452 { 1448 {
1453 llwarns << "trying to send llsd message when builder is not LLSD!" 1449 LL_WARNS("Messaging") << "trying to send llsd message when builder is not LLSD!"
1454 << llendl; 1450 << llendl;
1455 return 0; 1451 return 0;
1456 } 1452 }
@@ -1466,7 +1462,7 @@ void LLMessageSystem::logTrustedMsgFromUntrustedCircuit( const LLHost& host )
1466 // if it's received on a trusted circuit. JC 1462 // if it's received on a trusted circuit. JC
1467 if (strcmp(mMessageReader->getMessageName(), "RequestTrustedCircuit")) 1463 if (strcmp(mMessageReader->getMessageName(), "RequestTrustedCircuit"))
1468 { 1464 {
1469 llwarns << "Received trusted message on untrusted circuit. " 1465 LL_WARNS("Messaging") << "Received trusted message on untrusted circuit. "
1470 << "Will reply with deny. " 1466 << "Will reply with deny. "
1471 << "Message: " << nullToEmpty(mMessageReader->getMessageName()) 1467 << "Message: " << nullToEmpty(mMessageReader->getMessageName())
1472 << " Host: " << host << llendl; 1468 << " Host: " << host << llendl;
@@ -1474,7 +1470,7 @@ void LLMessageSystem::logTrustedMsgFromUntrustedCircuit( const LLHost& host )
1474 1470
1475 if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM) 1471 if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM)
1476 { 1472 {
1477 llwarns << "got more than " << MAX_MESSAGE_COUNT_NUM 1473 LL_WARNS("Messaging") << "got more than " << MAX_MESSAGE_COUNT_NUM
1478 << " packets without clearing counts" 1474 << " packets without clearing counts"
1479 << llendl; 1475 << llendl;
1480 } 1476 }
@@ -1494,7 +1490,7 @@ void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL r
1494{ 1490{
1495 if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM) 1491 if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM)
1496 { 1492 {
1497 llwarns << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << llendl; 1493 LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << llendl;
1498 } 1494 }
1499 else 1495 else
1500 { 1496 {
@@ -1523,7 +1519,7 @@ void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL r
1523 << (recv_reliable ? " reliable" : "") 1519 << (recv_reliable ? " reliable" : "")
1524 << (recv_resent ? " resent" : "") 1520 << (recv_resent ? " resent" : "")
1525 << (recv_acks ? " acks" : ""); 1521 << (recv_acks ? " acks" : "");
1526 llinfos << str.str() << llendl; 1522 LL_INFOS("Messaging") << str.str() << llendl;
1527 } 1523 }
1528} 1524}
1529 1525
@@ -1533,48 +1529,48 @@ void LLMessageSystem::sanityCheck()
1533 1529
1534// if (!mCurrentRMessageData) 1530// if (!mCurrentRMessageData)
1535// { 1531// {
1536// llerrs << "mCurrentRMessageData is NULL" << llendl; 1532// LL_ERRS("Messaging") << "mCurrentRMessageData is NULL" << llendl;
1537// } 1533// }
1538 1534
1539// if (!mCurrentRMessageTemplate) 1535// if (!mCurrentRMessageTemplate)
1540// { 1536// {
1541// llerrs << "mCurrentRMessageTemplate is NULL" << llendl; 1537// LL_ERRS("Messaging") << "mCurrentRMessageTemplate is NULL" << llendl;
1542// } 1538// }
1543 1539
1544// if (!mCurrentRTemplateBlock) 1540// if (!mCurrentRTemplateBlock)
1545// { 1541// {
1546// llerrs << "mCurrentRTemplateBlock is NULL" << llendl; 1542// LL_ERRS("Messaging") << "mCurrentRTemplateBlock is NULL" << llendl;
1547// } 1543// }
1548 1544
1549// if (!mCurrentRDataBlock) 1545// if (!mCurrentRDataBlock)
1550// { 1546// {
1551// llerrs << "mCurrentRDataBlock is NULL" << llendl; 1547// LL_ERRS("Messaging") << "mCurrentRDataBlock is NULL" << llendl;
1552// } 1548// }
1553 1549
1554// if (!mCurrentSMessageData) 1550// if (!mCurrentSMessageData)
1555// { 1551// {
1556// llerrs << "mCurrentSMessageData is NULL" << llendl; 1552// LL_ERRS("Messaging") << "mCurrentSMessageData is NULL" << llendl;
1557// } 1553// }
1558 1554
1559// if (!mCurrentSMessageTemplate) 1555// if (!mCurrentSMessageTemplate)
1560// { 1556// {
1561// llerrs << "mCurrentSMessageTemplate is NULL" << llendl; 1557// LL_ERRS("Messaging") << "mCurrentSMessageTemplate is NULL" << llendl;
1562// } 1558// }
1563 1559
1564// if (!mCurrentSTemplateBlock) 1560// if (!mCurrentSTemplateBlock)
1565// { 1561// {
1566// llerrs << "mCurrentSTemplateBlock is NULL" << llendl; 1562// LL_ERRS("Messaging") << "mCurrentSTemplateBlock is NULL" << llendl;
1567// } 1563// }
1568 1564
1569// if (!mCurrentSDataBlock) 1565// if (!mCurrentSDataBlock)
1570// { 1566// {
1571// llerrs << "mCurrentSDataBlock is NULL" << llendl; 1567// LL_ERRS("Messaging") << "mCurrentSDataBlock is NULL" << llendl;
1572// } 1568// }
1573} 1569}
1574 1570
1575void LLMessageSystem::showCircuitInfo() 1571void LLMessageSystem::showCircuitInfo()
1576{ 1572{
1577 llinfos << mCircuitInfo << llendl; 1573 LL_INFOS("Messaging") << mCircuitInfo << llendl;
1578} 1574}
1579 1575
1580 1576
@@ -1624,7 +1620,7 @@ void LLMessageSystem::enableCircuit(const LLHost &host, BOOL trusted)
1624 1620
1625void LLMessageSystem::disableCircuit(const LLHost &host) 1621void LLMessageSystem::disableCircuit(const LLHost &host)
1626{ 1622{
1627 llinfos << "LLMessageSystem::disableCircuit for " << host << llendl; 1623 LL_INFOS("Messaging") << "LLMessageSystem::disableCircuit for " << host << llendl;
1628 U32 code = gMessageSystem->findCircuitCode( host ); 1624 U32 code = gMessageSystem->findCircuitCode( host );
1629 1625
1630 // Don't need to do this, as we're removing the circuit info anyway - djs 01/28/03 1626 // Don't need to do this, as we're removing the circuit info anyway - djs 01/28/03
@@ -1637,7 +1633,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host)
1637 code_session_map_t::iterator it = mCircuitCodes.find(code); 1633 code_session_map_t::iterator it = mCircuitCodes.find(code);
1638 if(it != mCircuitCodes.end()) 1634 if(it != mCircuitCodes.end())
1639 { 1635 {
1640 llinfos << "Circuit " << code << " removed from list" << llendl; 1636 LL_INFOS("Messaging") << "Circuit " << code << " removed from list" << llendl;
1641 //mCircuitCodes.removeData(code); 1637 //mCircuitCodes.removeData(code);
1642 mCircuitCodes.erase(it); 1638 mCircuitCodes.erase(it);
1643 } 1639 }
@@ -1653,7 +1649,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host)
1653 U32 old_port = (U32)(ip_port & (U64)0xFFFFFFFF); 1649 U32 old_port = (U32)(ip_port & (U64)0xFFFFFFFF);
1654 U32 old_ip = (U32)(ip_port >> 32); 1650 U32 old_ip = (U32)(ip_port >> 32);
1655 1651
1656 llinfos << "Host " << LLHost(old_ip, old_port) << " circuit " << code << " removed from lookup table" << llendl; 1652 LL_INFOS("Messaging") << "Host " << LLHost(old_ip, old_port) << " circuit " << code << " removed from lookup table" << llendl;
1657 gMessageSystem->mIPPortToCircuitCode.erase(ip_port); 1653 gMessageSystem->mIPPortToCircuitCode.erase(ip_port);
1658 } 1654 }
1659 mCircuitInfo.removeCircuitData(host); 1655 mCircuitInfo.removeCircuitData(host);
@@ -1663,7 +1659,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host)
1663 // Sigh, since we can open circuits which don't have circuit 1659 // Sigh, since we can open circuits which don't have circuit
1664 // codes, it's possible for this to happen... 1660 // codes, it's possible for this to happen...
1665 1661
1666 llwarns << "Couldn't find circuit code for " << host << llendl; 1662 LL_WARNS("Messaging") << "Couldn't find circuit code for " << host << llendl;
1667 } 1663 }
1668 1664
1669} 1665}
@@ -1694,7 +1690,7 @@ BOOL LLMessageSystem::checkCircuitBlocked(const U32 circuit)
1694 1690
1695 if (!host.isOk()) 1691 if (!host.isOk())
1696 { 1692 {
1697 //llinfos << "checkCircuitBlocked: Unknown circuit " << circuit << llendl; 1693 LL_DEBUGS("Messaging") << "checkCircuitBlocked: Unknown circuit " << circuit << llendl;
1698 return TRUE; 1694 return TRUE;
1699 } 1695 }
1700 1696
@@ -1705,7 +1701,7 @@ BOOL LLMessageSystem::checkCircuitBlocked(const U32 circuit)
1705 } 1701 }
1706 else 1702 else
1707 { 1703 {
1708 llinfos << "checkCircuitBlocked(circuit): Unknown host - " << host << llendl; 1704 LL_INFOS("Messaging") << "checkCircuitBlocked(circuit): Unknown host - " << host << llendl;
1709 return FALSE; 1705 return FALSE;
1710 } 1706 }
1711} 1707}
@@ -1716,7 +1712,7 @@ BOOL LLMessageSystem::checkCircuitAlive(const U32 circuit)
1716 1712
1717 if (!host.isOk()) 1713 if (!host.isOk())
1718 { 1714 {
1719 //llinfos << "checkCircuitAlive: Unknown circuit " << circuit << llendl; 1715 LL_DEBUGS("Messaging") << "checkCircuitAlive: Unknown circuit " << circuit << llendl;
1720 return FALSE; 1716 return FALSE;
1721 } 1717 }
1722 1718
@@ -1727,7 +1723,7 @@ BOOL LLMessageSystem::checkCircuitAlive(const U32 circuit)
1727 } 1723 }
1728 else 1724 else
1729 { 1725 {
1730 llinfos << "checkCircuitAlive(circuit): Unknown host - " << host << llendl; 1726 LL_INFOS("Messaging") << "checkCircuitAlive(circuit): Unknown host - " << host << llendl;
1731 return FALSE; 1727 return FALSE;
1732 } 1728 }
1733} 1729}
@@ -1741,7 +1737,7 @@ BOOL LLMessageSystem::checkCircuitAlive(const LLHost &host)
1741 } 1737 }
1742 else 1738 else
1743 { 1739 {
1744 //llinfos << "checkCircuitAlive(host): Unknown host - " << host << llendl; 1740 LL_DEBUGS("Messaging") << "checkCircuitAlive(host): Unknown host - " << host << llendl;
1745 return FALSE; 1741 return FALSE;
1746 } 1742 }
1747} 1743}
@@ -1891,7 +1887,7 @@ void LLMessageSystem::processAssignCircuitCode(LLMessageSystem* msg, void**)
1891 msg->getUUIDFast(_PREHASH_CircuitCode, _PREHASH_SessionID, session_id); 1887 msg->getUUIDFast(_PREHASH_CircuitCode, _PREHASH_SessionID, session_id);
1892 if(session_id != msg->getMySessionID()) 1888 if(session_id != msg->getMySessionID())
1893 { 1889 {
1894 llwarns << "AssignCircuitCode, bad session id. Expecting " 1890 LL_WARNS("Messaging") << "AssignCircuitCode, bad session id. Expecting "
1895 << msg->getMySessionID() << " but got " << session_id 1891 << msg->getMySessionID() << " but got " << session_id
1896 << llendl; 1892 << llendl;
1897 return; 1893 return;
@@ -1900,11 +1896,11 @@ void LLMessageSystem::processAssignCircuitCode(LLMessageSystem* msg, void**)
1900 msg->getU32Fast(_PREHASH_CircuitCode, _PREHASH_Code, code); 1896 msg->getU32Fast(_PREHASH_CircuitCode, _PREHASH_Code, code);
1901 if (!code) 1897 if (!code)
1902 { 1898 {
1903 llerrs << "Assigning circuit code of zero!" << llendl; 1899 LL_ERRS("Messaging") << "Assigning circuit code of zero!" << llendl;
1904 } 1900 }
1905 1901
1906 msg->mOurCircuitCode = code; 1902 msg->mOurCircuitCode = code;
1907 llinfos << "Circuit code " << code << " assigned." << llendl; 1903 LL_INFOS("Messaging") << "Circuit code " << code << " assigned." << llendl;
1908} 1904}
1909*/ 1905*/
1910 1906
@@ -1928,20 +1924,20 @@ bool LLMessageSystem::addCircuitCode(U32 code, const LLUUID& session_id)
1928{ 1924{
1929 if(!code) 1925 if(!code)
1930 { 1926 {
1931 llwarns << "addCircuitCode: zero circuit code" << llendl; 1927 LL_WARNS("Messaging") << "addCircuitCode: zero circuit code" << llendl;
1932 return false; 1928 return false;
1933 } 1929 }
1934 code_session_map_t::iterator it = mCircuitCodes.find(code); 1930 code_session_map_t::iterator it = mCircuitCodes.find(code);
1935 if(it == mCircuitCodes.end()) 1931 if(it == mCircuitCodes.end())
1936 { 1932 {
1937 llinfos << "New circuit code " << code << " added" << llendl; 1933 LL_INFOS("Messaging") << "New circuit code " << code << " added" << llendl;
1938 //msg->mCircuitCodes[circuit_code] = circuit_code; 1934 //msg->mCircuitCodes[circuit_code] = circuit_code;
1939 1935
1940 mCircuitCodes.insert(code_session_map_t::value_type(code, session_id)); 1936 mCircuitCodes.insert(code_session_map_t::value_type(code, session_id));
1941 } 1937 }
1942 else 1938 else
1943 { 1939 {
1944 llinfos << "Duplicate circuit code " << code << " added" << llendl; 1940 LL_INFOS("Messaging") << "Duplicate circuit code " << code << " added" << llendl;
1945 } 1941 }
1946 return true; 1942 return true;
1947} 1943}
@@ -1973,7 +1969,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
1973 if(it == msg->mCircuitCodes.end()) 1969 if(it == msg->mCircuitCodes.end())
1974 { 1970 {
1975 // Whoah, abort! We don't know anything about this circuit code. 1971 // Whoah, abort! We don't know anything about this circuit code.
1976 llwarns << "UseCircuitCode for " << circuit_code_in 1972 LL_WARNS("Messaging") << "UseCircuitCode for " << circuit_code_in
1977 << " received without AddCircuitCode message - aborting" 1973 << " received without AddCircuitCode message - aborting"
1978 << llendl; 1974 << llendl;
1979 return; 1975 return;
@@ -1985,7 +1981,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
1985 msg->getUUIDFast(_PREHASH_CircuitCode, _PREHASH_SessionID, session_id); 1981 msg->getUUIDFast(_PREHASH_CircuitCode, _PREHASH_SessionID, session_id);
1986 if(session_id != (*it).second) 1982 if(session_id != (*it).second)
1987 { 1983 {
1988 llwarns << "UseCircuitCode unmatched session id. Got " 1984 LL_WARNS("Messaging") << "UseCircuitCode unmatched session id. Got "
1989 << session_id << " but expected " << (*it).second 1985 << session_id << " but expected " << (*it).second
1990 << llendl; 1986 << llendl;
1991 return; 1987 return;
@@ -2000,7 +1996,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
2000 if ((ip_port_old == ip_port_in) && (circuit_code_old == circuit_code_in)) 1996 if ((ip_port_old == ip_port_in) && (circuit_code_old == circuit_code_in))
2001 { 1997 {
2002 // Current information is the same as incoming info, ignore 1998 // Current information is the same as incoming info, ignore
2003 llinfos << "Got duplicate UseCircuitCode for circuit " << circuit_code_in << " to " << msg->getSender() << llendl; 1999 LL_INFOS("Messaging") << "Got duplicate UseCircuitCode for circuit " << circuit_code_in << " to " << msg->getSender() << llendl;
2004 return; 2000 return;
2005 } 2001 }
2006 2002
@@ -2010,25 +2006,25 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
2010 msg->mIPPortToCircuitCode.erase(ip_port_old); 2006 msg->mIPPortToCircuitCode.erase(ip_port_old);
2011 U32 old_port = (U32)(ip_port_old & (U64)0xFFFFFFFF); 2007 U32 old_port = (U32)(ip_port_old & (U64)0xFFFFFFFF);
2012 U32 old_ip = (U32)(ip_port_old >> 32); 2008 U32 old_ip = (U32)(ip_port_old >> 32);
2013 llinfos << "Removing derelict lookup entry for circuit " << circuit_code_old << " to " << LLHost(old_ip, old_port) << llendl; 2009 LL_INFOS("Messaging") << "Removing derelict lookup entry for circuit " << circuit_code_old << " to " << LLHost(old_ip, old_port) << llendl;
2014 } 2010 }
2015 2011
2016 if (circuit_code_old) 2012 if (circuit_code_old)
2017 { 2013 {
2018 LLHost cur_host(ip, port); 2014 LLHost cur_host(ip, port);
2019 2015
2020 llwarns << "Disabling existing circuit for " << cur_host << llendl; 2016 LL_WARNS("Messaging") << "Disabling existing circuit for " << cur_host << llendl;
2021 msg->disableCircuit(cur_host); 2017 msg->disableCircuit(cur_host);
2022 if (circuit_code_old == circuit_code_in) 2018 if (circuit_code_old == circuit_code_in)
2023 { 2019 {
2024 llwarns << "Asymmetrical circuit to ip/port lookup!" << llendl; 2020 LL_WARNS("Messaging") << "Asymmetrical circuit to ip/port lookup!" << llendl;
2025 llwarns << "Multiple circuit codes for " << cur_host << " probably!" << llendl; 2021 LL_WARNS("Messaging") << "Multiple circuit codes for " << cur_host << " probably!" << llendl;
2026 llwarns << "Permanently disabling circuit" << llendl; 2022 LL_WARNS("Messaging") << "Permanently disabling circuit" << llendl;
2027 return; 2023 return;
2028 } 2024 }
2029 else 2025 else
2030 { 2026 {
2031 llwarns << "Circuit code changed for " << msg->getSender() 2027 LL_WARNS("Messaging") << "Circuit code changed for " << msg->getSender()
2032 << " from " << circuit_code_old << " to " 2028 << " from " << circuit_code_old << " to "
2033 << circuit_code_in << llendl; 2029 << circuit_code_in << llendl;
2034 } 2030 }
@@ -2070,7 +2066,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
2070 msg->mIPPortToCircuitCode[ip_port_in] = circuit_code_in; 2066 msg->mIPPortToCircuitCode[ip_port_in] = circuit_code_in;
2071 msg->mCircuitCodeToIPPort[circuit_code_in] = ip_port_in; 2067 msg->mCircuitCodeToIPPort[circuit_code_in] = ip_port_in;
2072 2068
2073 llinfos << "Circuit code " << circuit_code_in << " from " 2069 LL_INFOS("Messaging") << "Circuit code " << circuit_code_in << " from "
2074 << msg->getSender() << " for agent " << id << " in session " 2070 << msg->getSender() << " for agent " << id << " in session "
2075 << session_id << llendl; 2071 << session_id << llendl;
2076 2072
@@ -2083,7 +2079,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
2083 } 2079 }
2084 else 2080 else
2085 { 2081 {
2086 llwarns << "Got zero circuit code in use_circuit_code" << llendl; 2082 LL_WARNS("Messaging") << "Got zero circuit code in use_circuit_code" << llendl;
2087 } 2083 }
2088} 2084}
2089 2085
@@ -2105,7 +2101,7 @@ void LLMessageSystem::processError(LLMessageSystem* msg, void**)
2105 msg->getString("Data", "Message", MTUBYTES, buffer); 2101 msg->getString("Data", "Message", MTUBYTES, buffer);
2106 error_message.assign(buffer); 2102 error_message.assign(buffer);
2107 2103
2108 llwarns << "Message error from " << msg->getSender() << " - " 2104 LL_WARNS("Messaging") << "Message error from " << msg->getSender() << " - "
2109 << error_code << " " << error_token << " " << error_id << " \"" 2105 << error_code << " " << error_token << " " << error_id << " \""
2110 << error_system << "\" \"" << error_message << "\"" << llendl; 2106 << error_system << "\" \"" << error_message << "\"" << llendl;
2111} 2107}
@@ -2143,7 +2139,7 @@ void LLMessageSystem::dispatch(
2143 gMessageSystem->mMessageTemplates.end()) && 2139 gMessageSystem->mMessageTemplates.end()) &&
2144 !LLMessageConfig::isValidMessage(msg_name)) 2140 !LLMessageConfig::isValidMessage(msg_name))
2145 { 2141 {
2146 llwarns << "Ignoring unknown message " << msg_name << llendl; 2142 LL_WARNS("Messaging") << "Ignoring unknown message " << msg_name << llendl;
2147 responsep->notFound("Invalid message name"); 2143 responsep->notFound("Invalid message name");
2148 return; 2144 return;
2149 } 2145 }
@@ -2153,12 +2149,12 @@ void LLMessageSystem::dispatch(
2153 const LLHTTPNode* handler = messageRootNode().traverse(path, context); 2149 const LLHTTPNode* handler = messageRootNode().traverse(path, context);
2154 if (!handler) 2150 if (!handler)
2155 { 2151 {
2156 llwarns << "LLMessageService::dispatch > no handler for " 2152 LL_WARNS("Messaging") << "LLMessageService::dispatch > no handler for "
2157 << path << llendl; 2153 << path << llendl;
2158 return; 2154 return;
2159 } 2155 }
2160 // enable this for output of message names 2156 // enable this for output of message names
2161 //llinfos << "< \"" << msg_name << "\"" << llendl; 2157 //LL_INFOS("Messaging") << "< \"" << msg_name << "\"" << llendl;
2162 //lldebugs << "data: " << LLSDNotationStreamer(message) << llendl; 2158 //lldebugs << "data: " << LLSDNotationStreamer(message) << llendl;
2163 2159
2164 handler->post(responsep, context, message); 2160 handler->post(responsep, context, message);
@@ -2177,9 +2173,9 @@ static void check_for_unrecognized_messages(
2177 2173
2178 if (templates.find(name) == templates.end()) 2174 if (templates.find(name) == templates.end())
2179 { 2175 {
2180 llinfos << " " << type 2176 LL_INFOS("AppInit") << " " << type
2181 << " ban list contains unrecognized message " 2177 << " ban list contains unrecognized message "
2182 << name << llendl; 2178 << name << LL_ENDL;
2183 } 2179 }
2184 } 2180 }
2185} 2181}
@@ -2187,7 +2183,7 @@ static void check_for_unrecognized_messages(
2187void LLMessageSystem::setMessageBans( 2183void LLMessageSystem::setMessageBans(
2188 const LLSD& trusted, const LLSD& untrusted) 2184 const LLSD& trusted, const LLSD& untrusted)
2189{ 2185{
2190 llinfos << "LLMessageSystem::setMessageBans:" << llendl; 2186 LL_DEBUGS("AppInit") << "LLMessageSystem::setMessageBans:" << LL_ENDL;
2191 bool any_set = false; 2187 bool any_set = false;
2192 2188
2193 for (message_template_name_map_t::iterator iter = mMessageTemplates.begin(), 2189 for (message_template_name_map_t::iterator iter = mMessageTemplates.begin(),
@@ -2207,17 +2203,17 @@ void LLMessageSystem::setMessageBans(
2207 2203
2208 if (ban_from_trusted || ban_from_untrusted) 2204 if (ban_from_trusted || ban_from_untrusted)
2209 { 2205 {
2210 llinfos << " " << name << " banned from " 2206 LL_INFOS("AppInit") << " " << name << " banned from "
2211 << (ban_from_trusted ? "TRUSTED " : " ") 2207 << (ban_from_trusted ? "TRUSTED " : " ")
2212 << (ban_from_untrusted ? "UNTRUSTED " : " ") 2208 << (ban_from_untrusted ? "UNTRUSTED " : " ")
2213 << llendl; 2209 << LL_ENDL;
2214 any_set = true; 2210 any_set = true;
2215 } 2211 }
2216 } 2212 }
2217 2213
2218 if (!any_set) 2214 if (!any_set)
2219 { 2215 {
2220 llinfos << " no messages banned" << llendl; 2216 LL_DEBUGS("AppInit") << " no messages banned" << LL_ENDL;
2221 } 2217 }
2222 2218
2223 check_for_unrecognized_messages("trusted", trusted, mMessageTemplates); 2219 check_for_unrecognized_messages("trusted", trusted, mMessageTemplates);
@@ -2267,7 +2263,7 @@ S32 LLMessageSystem::sendError(
2267 } 2263 }
2268 else 2264 else
2269 { 2265 {
2270 llwarns << "Data and message were too large -- data removed." 2266 LL_WARNS("Messaging") << "Data and message were too large -- data removed."
2271 << llendl; 2267 << llendl;
2272 addBinaryData("Data", NULL, 0); 2268 addBinaryData("Data", NULL, 0);
2273 } 2269 }
@@ -2288,7 +2284,7 @@ void process_packet_ack(LLMessageSystem *msgsystem, void** /*user_data*/)
2288 for (S32 i = 0; i < ack_count; i++) 2284 for (S32 i = 0; i < ack_count; i++)
2289 { 2285 {
2290 msgsystem->getU32Fast(_PREHASH_Packets, _PREHASH_ID, packet_id, i); 2286 msgsystem->getU32Fast(_PREHASH_Packets, _PREHASH_ID, packet_id, i);
2291// llinfos << "ack recvd' from " << host << " for packet " << (TPACKETID)packet_id << llendl; 2287// LL_DEBUGS("Messaging") << "ack recvd' from " << host << " for packet " << (TPACKETID)packet_id << llendl;
2292 cdp->ackReliablePacket(packet_id); 2288 cdp->ackReliablePacket(packet_id);
2293 } 2289 }
2294 if (!cdp->getUnackedPacketCount()) 2290 if (!cdp->getUnackedPacketCount())
@@ -2309,12 +2305,12 @@ void process_log_messages(LLMessageSystem* msg, void**)
2309 2305
2310 if (log_message) 2306 if (log_message)
2311 { 2307 {
2312 llinfos << "Starting logging via message" << llendl; 2308 LL_INFOS("Messaging") << "Starting logging via message" << llendl;
2313 msg->startLogging(); 2309 msg->startLogging();
2314 } 2310 }
2315 else 2311 else
2316 { 2312 {
2317 llinfos << "Stopping logging via message" << llendl; 2313 LL_INFOS("Messaging") << "Stopping logging via message" << llendl;
2318 msg->stopLogging(); 2314 msg->stopLogging();
2319 } 2315 }
2320}*/ 2316}*/
@@ -2333,7 +2329,7 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **)
2333 LLCircuitData *cdp = msg->mCircuitInfo.findCircuit(msg->getSender()); 2329 LLCircuitData *cdp = msg->mCircuitInfo.findCircuit(msg->getSender());
2334 if (!cdp) 2330 if (!cdp)
2335 { 2331 {
2336 llwarns << "Attempt to create trusted circuit without circuit data: " 2332 LL_WARNS("Messaging") << "Attempt to create trusted circuit without circuit data: "
2337 << msg->getSender() << llendl; 2333 << msg->getSender() << llendl;
2338 return; 2334 return;
2339 } 2335 }
@@ -2358,7 +2354,7 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **)
2358 if(msg->isMatchingDigestForWindowAndUUIDs(their_digest, TRUST_TIME_WINDOW, local_id, remote_id)) 2354 if(msg->isMatchingDigestForWindowAndUUIDs(their_digest, TRUST_TIME_WINDOW, local_id, remote_id))
2359 { 2355 {
2360 cdp->setTrusted(TRUE); 2356 cdp->setTrusted(TRUE);
2361 llinfos << "Trusted digest from " << msg->getSender() << llendl; 2357 LL_INFOS("Messaging") << "Trusted digest from " << msg->getSender() << llendl;
2362 return; 2358 return;
2363 } 2359 }
2364 else if (cdp->getTrusted()) 2360 else if (cdp->getTrusted())
@@ -2367,13 +2363,13 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **)
2367 // This means that this could just be the result of a stale deny sent from a while back, and 2363 // This means that this could just be the result of a stale deny sent from a while back, and
2368 // the message system is being slow. Don't bother sending the deny, as it may continually 2364 // the message system is being slow. Don't bother sending the deny, as it may continually
2369 // ping-pong back and forth on a very hosed circuit. 2365 // ping-pong back and forth on a very hosed circuit.
2370 llwarns << "Ignoring bad digest from known trusted circuit: " << their_digest 2366 LL_WARNS("Messaging") << "Ignoring bad digest from known trusted circuit: " << their_digest
2371 << " host: " << msg->getSender() << llendl; 2367 << " host: " << msg->getSender() << llendl;
2372 return; 2368 return;
2373 } 2369 }
2374 else 2370 else
2375 { 2371 {
2376 llwarns << "Bad digest from known circuit: " << their_digest 2372 LL_WARNS("Messaging") << "Bad digest from known circuit: " << their_digest
2377 << " host: " << msg->getSender() << llendl; 2373 << " host: " << msg->getSender() << llendl;
2378 msg->sendDenyTrustedCircuit(msg->getSender()); 2374 msg->sendDenyTrustedCircuit(msg->getSender());
2379 return; 2375 return;
@@ -2410,7 +2406,7 @@ void process_deny_trusted_circuit(LLMessageSystem *msg, void **)
2410 // spin. 2406 // spin.
2411 // *TODO: probably should keep a count of number of resends 2407 // *TODO: probably should keep a count of number of resends
2412 // per circuit, and stop resending after a while. 2408 // per circuit, and stop resending after a while.
2413 llinfos << "Got DenyTrustedCircuit. Sending CreateTrustedCircuit to " 2409 LL_INFOS("Messaging") << "Got DenyTrustedCircuit. Sending CreateTrustedCircuit to "
2414 << msg->getSender() << llendl; 2410 << msg->getSender() << llendl;
2415 msg->sendCreateTrustedCircuit(msg->getSender(), local_id, remote_id); 2411 msg->sendCreateTrustedCircuit(msg->getSender(), local_id, remote_id);
2416} 2412}
@@ -2419,7 +2415,7 @@ void process_deny_trusted_circuit(LLMessageSystem *msg, void **)
2419void dump_prehash_files() 2415void dump_prehash_files()
2420{ 2416{
2421 U32 i; 2417 U32 i;
2422 FILE* fp = LLFile::fopen("../../indra/llmessage/message_prehash.h", "w"); /* Flawfinder: ignore */ 2418 LLFILE* fp = LLFile::fopen("../../indra/llmessage/message_prehash.h", "w"); /* Flawfinder: ignore */
2423 if (fp) 2419 if (fp)
2424 { 2420 {
2425 fprintf( 2421 fprintf(
@@ -2499,7 +2495,7 @@ BOOL start_messaging_system(
2499 2495
2500 if (!gMessageSystem) 2496 if (!gMessageSystem)
2501 { 2497 {
2502 llerrs << "Messaging system initialization failed." << llendl; 2498 LL_ERRS("AppInit") << "Messaging system initialization failed." << LL_ENDL;
2503 return FALSE; 2499 return FALSE;
2504 } 2500 }
2505 2501
@@ -2518,12 +2514,12 @@ BOOL start_messaging_system(
2518 { 2514 {
2519 if (gMessageSystem->mMessageFileVersionNumber != gPrehashVersionNumber) 2515 if (gMessageSystem->mMessageFileVersionNumber != gPrehashVersionNumber)
2520 { 2516 {
2521 llinfos << "Message template version does not match prehash version number" << llendl; 2517 LL_INFOS("AppInit") << "Message template version does not match prehash version number" << LL_ENDL;
2522 llinfos << "Run simulator with -prehash command line option to rebuild prehash data" << llendl; 2518 LL_INFOS("AppInit") << "Run simulator with -prehash command line option to rebuild prehash data" << llendl;
2523 } 2519 }
2524 else 2520 else
2525 { 2521 {
2526 llinfos << "Message template version matches prehash version number" << llendl; 2522 LL_DEBUGS("AppInit") << "Message template version matches prehash version number" << llendl;
2527 } 2523 }
2528 } 2524 }
2529 2525
@@ -2569,7 +2565,7 @@ void LLMessageSystem::startLogging()
2569 str << "\t<-\tincoming message" <<std::endl; 2565 str << "\t<-\tincoming message" <<std::endl;
2570 str << "\t->\toutgoing message" << std::endl; 2566 str << "\t->\toutgoing message" << std::endl;
2571 str << " <> host size zero id name"; 2567 str << " <> host size zero id name";
2572 llinfos << str.str() << llendl; 2568 LL_INFOS("Messaging") << str.str() << llendl;
2573} 2569}
2574 2570
2575void LLMessageSystem::stopLogging() 2571void LLMessageSystem::stopLogging()
@@ -2577,7 +2573,7 @@ void LLMessageSystem::stopLogging()
2577 if(mVerboseLog) 2573 if(mVerboseLog)
2578 { 2574 {
2579 mVerboseLog = FALSE; 2575 mVerboseLog = FALSE;
2580 llinfos << "END MESSAGE LOG" << llendl; 2576 LL_INFOS("Messaging") << "END MESSAGE LOG" << llendl;
2581 } 2577 }
2582} 2578}
2583 2579
@@ -2683,7 +2679,7 @@ void end_messaging_system()
2683 2679
2684 std::ostringstream str; 2680 std::ostringstream str;
2685 gMessageSystem->summarizeLogs(str); 2681 gMessageSystem->summarizeLogs(str);
2686 llinfos << str.str().c_str() << llendl; 2682 LL_INFOS("Messaging") << str.str().c_str() << llendl;
2687 2683
2688 delete gMessageSystem; 2684 delete gMessageSystem;
2689 gMessageSystem = NULL; 2685 gMessageSystem = NULL;
@@ -2735,7 +2731,7 @@ void LLMessageSystem::dumpReceiveCounts()
2735 2731
2736 if(mNumMessageCounts > 0) 2732 if(mNumMessageCounts > 0)
2737 { 2733 {
2738 llinfos << "Dump: " << mNumMessageCounts << " messages processed in " << mReceiveTime << " seconds" << llendl; 2734 LL_DEBUGS("Messaging") << "Dump: " << mNumMessageCounts << " messages processed in " << mReceiveTime << " seconds" << llendl;
2739 for (message_template_name_map_t::const_iterator iter = mMessageTemplates.begin(), 2735 for (message_template_name_map_t::const_iterator iter = mMessageTemplates.begin(),
2740 end = mMessageTemplates.end(); 2736 end = mMessageTemplates.end();
2741 iter != end; iter++) 2737 iter != end; iter++)
@@ -2743,7 +2739,7 @@ void LLMessageSystem::dumpReceiveCounts()
2743 const LLMessageTemplate* mt = iter->second; 2739 const LLMessageTemplate* mt = iter->second;
2744 if (mt->mReceiveCount > 0) 2740 if (mt->mReceiveCount > 0)
2745 { 2741 {
2746 llinfos << "Num: " << std::setw(3) << mt->mReceiveCount << " Bytes: " << std::setw(6) << mt->mReceiveBytes 2742 LL_INFOS("Messaging") << "Num: " << std::setw(3) << mt->mReceiveCount << " Bytes: " << std::setw(6) << mt->mReceiveBytes
2747 << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime) << "%" << llendl; 2743 << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime) << "%" << llendl;
2748 } 2744 }
2749 } 2745 }
@@ -2860,7 +2856,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size)
2860{ 2856{
2861 if ((*data_size ) < LL_MINIMUM_VALID_PACKET_SIZE) 2857 if ((*data_size ) < LL_MINIMUM_VALID_PACKET_SIZE)
2862 { 2858 {
2863 llwarns << "zeroCodeExpand() called with data_size of " << *data_size 2859 LL_WARNS("Messaging") << "zeroCodeExpand() called with data_size of " << *data_size
2864 << llendl; 2860 << llendl;
2865 } 2861 }
2866 2862
@@ -2900,7 +2896,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size)
2900 { 2896 {
2901 if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-1])) 2897 if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-1]))
2902 { 2898 {
2903 llwarns << "attempt to write past reasonable encoded buffer size 1" << llendl; 2899 LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 1" << llendl;
2904 callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE); 2900 callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE);
2905 outptr = mEncodedRecvBuffer; 2901 outptr = mEncodedRecvBuffer;
2906 break; 2902 break;
@@ -2912,7 +2908,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size)
2912 *outptr++ = *inptr++; 2908 *outptr++ = *inptr++;
2913 if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-256])) 2909 if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-256]))
2914 { 2910 {
2915 llwarns << "attempt to write past reasonable encoded buffer size 2" << llendl; 2911 LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 2" << llendl;
2916 callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE); 2912 callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE);
2917 outptr = mEncodedRecvBuffer; 2913 outptr = mEncodedRecvBuffer;
2918 count = -1; 2914 count = -1;
@@ -2931,7 +2927,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size)
2931 { 2927 {
2932 if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-(*inptr)])) 2928 if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-(*inptr)]))
2933 { 2929 {
2934 llwarns << "attempt to write past reasonable encoded buffer size 3" << llendl; 2930 LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 3" << llendl;
2935 callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE); 2931 callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE);
2936 outptr = mEncodedRecvBuffer; 2932 outptr = mEncodedRecvBuffer;
2937 } 2933 }
@@ -2954,7 +2950,7 @@ void LLMessageSystem::addTemplate(LLMessageTemplate *templatep)
2954{ 2950{
2955 if (mMessageTemplates.count(templatep->mName) > 0) 2951 if (mMessageTemplates.count(templatep->mName) > 0)
2956 { 2952 {
2957 llerrs << templatep->mName << " already used as a template name!" 2953 LL_ERRS("Messaging") << templatep->mName << " already used as a template name!"
2958 << llendl; 2954 << llendl;
2959 } 2955 }
2960 mMessageTemplates[templatep->mName] = templatep; 2956 mMessageTemplates[templatep->mName] = templatep;
@@ -2971,7 +2967,7 @@ void LLMessageSystem::setHandlerFuncFast(const char *name, void (*handler_func)(
2971 } 2967 }
2972 else 2968 else
2973 { 2969 {
2974 llerrs << name << " is not a known message name!" << llendl; 2970 LL_ERRS("Messaging") << name << " is not a known message name!" << llendl;
2975 } 2971 }
2976} 2972}
2977 2973
@@ -2983,7 +2979,7 @@ bool LLMessageSystem::callHandler(const char *name,
2983 iter = mMessageTemplates.find(name); 2979 iter = mMessageTemplates.find(name);
2984 if(iter == mMessageTemplates.end()) 2980 if(iter == mMessageTemplates.end())
2985 { 2981 {
2986 llwarns << "LLMessageSystem::callHandler: unknown message " 2982 LL_WARNS("Messaging") << "LLMessageSystem::callHandler: unknown message "
2987 << name << llendl; 2983 << name << llendl;
2988 return false; 2984 return false;
2989 } 2985 }
@@ -2991,7 +2987,7 @@ bool LLMessageSystem::callHandler(const char *name,
2991 const LLMessageTemplate* msg_template = iter->second; 2987 const LLMessageTemplate* msg_template = iter->second;
2992 if (msg_template->isBanned(trustedSource)) 2988 if (msg_template->isBanned(trustedSource))
2993 { 2989 {
2994 llwarns << "LLMessageSystem::callHandler: banned message " 2990 LL_WARNS("Messaging") << "LLMessageSystem::callHandler: banned message "
2995 << name 2991 << name
2996 << " from " 2992 << " from "
2997 << (trustedSource ? "trusted " : "untrusted ") 2993 << (trustedSource ? "trusted " : "untrusted ")
@@ -3131,7 +3127,7 @@ bool LLMessageSystem::generateDigestForWindowAndUUIDs(char* digest, const S32 wi
3131 std::string shared_secret = get_shared_secret(); 3127 std::string shared_secret = get_shared_secret();
3132 if(shared_secret.empty()) 3128 if(shared_secret.empty())
3133 { 3129 {
3134 llerrs << "Trying to generate complex digest on a machine without a shared secret!" << llendl; 3130 LL_ERRS("Messaging") << "Trying to generate complex digest on a machine without a shared secret!" << llendl;
3135 } 3131 }
3136 3132
3137 U32 now = time(NULL); 3133 U32 now = time(NULL);
@@ -3150,7 +3146,7 @@ bool LLMessageSystem::isMatchingDigestForWindowAndUUIDs(const char* digest, cons
3150 std::string shared_secret = get_shared_secret(); 3146 std::string shared_secret = get_shared_secret();
3151 if(shared_secret.empty()) 3147 if(shared_secret.empty())
3152 { 3148 {
3153 llerrs << "Trying to compare complex digests on a machine without a shared secret!" << llendl; 3149 LL_ERRS("Messaging") << "Trying to compare complex digests on a machine without a shared secret!" << llendl;
3154 } 3150 }
3155 3151
3156 char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ 3152 char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
@@ -3197,7 +3193,7 @@ bool LLMessageSystem::generateDigestForWindow(char* digest, const S32 window) co
3197 std::string shared_secret = get_shared_secret(); 3193 std::string shared_secret = get_shared_secret();
3198 if(shared_secret.empty()) 3194 if(shared_secret.empty())
3199 { 3195 {
3200 llerrs << "Trying to generate simple digest on a machine without a shared secret!" << llendl; 3196 LL_ERRS("Messaging") << "Trying to generate simple digest on a machine without a shared secret!" << llendl;
3201 } 3197 }
3202 3198
3203 U32 now = time(NULL); 3199 U32 now = time(NULL);
@@ -3216,7 +3212,7 @@ bool LLMessageSystem::isMatchingDigestForWindow(const char* digest, S32 const wi
3216 std::string shared_secret = get_shared_secret(); 3212 std::string shared_secret = get_shared_secret();
3217 if(shared_secret.empty()) 3213 if(shared_secret.empty())
3218 { 3214 {
3219 llerrs << "Trying to compare simple digests on a machine without a shared secret!" << llendl; 3215 LL_ERRS("Messaging") << "Trying to compare simple digests on a machine without a shared secret!" << llendl;
3220 } 3216 }
3221 3217
3222 char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ 3218 char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
@@ -3250,12 +3246,12 @@ void LLMessageSystem::sendCreateTrustedCircuit(const LLHost &host, const LLUUID
3250 char digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ 3246 char digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
3251 if (id1.isNull()) 3247 if (id1.isNull())
3252 { 3248 {
3253 llwarns << "Can't send CreateTrustedCircuit to " << host << " because we don't have the local end point ID" << llendl; 3249 LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the local end point ID" << llendl;
3254 return; 3250 return;
3255 } 3251 }
3256 if (id2.isNull()) 3252 if (id2.isNull())
3257 { 3253 {
3258 llwarns << "Can't send CreateTrustedCircuit to " << host << " because we don't have the remote end point ID" << llendl; 3254 LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the remote end point ID" << llendl;
3259 return; 3255 return;
3260 } 3256 }
3261 generateDigestForWindowAndUUIDs(digest, TRUST_TIME_WINDOW, id1, id2); 3257 generateDigestForWindowAndUUIDs(digest, TRUST_TIME_WINDOW, id1, id2);
@@ -3263,7 +3259,7 @@ void LLMessageSystem::sendCreateTrustedCircuit(const LLHost &host, const LLUUID
3263 nextBlockFast(_PREHASH_DataBlock); 3259 nextBlockFast(_PREHASH_DataBlock);
3264 addUUIDFast(_PREHASH_EndPointID, id1); 3260 addUUIDFast(_PREHASH_EndPointID, id1);
3265 addBinaryDataFast(_PREHASH_Digest, digest, MD5HEX_STR_BYTES); 3261 addBinaryDataFast(_PREHASH_Digest, digest, MD5HEX_STR_BYTES);
3266 llinfos << "xmitting digest: " << digest << " Host: " << host << llendl; 3262 LL_INFOS("Messaging") << "xmitting digest: " << digest << " Host: " << host << llendl;
3267 sendMessage(host); 3263 sendMessage(host);
3268} 3264}
3269 3265
@@ -3277,10 +3273,10 @@ void LLMessageSystem::reallySendDenyTrustedCircuit(const LLHost &host)
3277 LLCircuitData *cdp = mCircuitInfo.findCircuit(host); 3273 LLCircuitData *cdp = mCircuitInfo.findCircuit(host);
3278 if (!cdp) 3274 if (!cdp)
3279 { 3275 {
3280 llwarns << "Not sending DenyTrustedCircuit to host without a circuit." << llendl; 3276 LL_WARNS("Messaging") << "Not sending DenyTrustedCircuit to host without a circuit." << llendl;
3281 return; 3277 return;
3282 } 3278 }
3283 llinfos << "Sending DenyTrustedCircuit to " << host << llendl; 3279 LL_INFOS("Messaging") << "Sending DenyTrustedCircuit to " << host << llendl;
3284 newMessageFast(_PREHASH_DenyTrustedCircuit); 3280 newMessageFast(_PREHASH_DenyTrustedCircuit);
3285 nextBlockFast(_PREHASH_DataBlock); 3281 nextBlockFast(_PREHASH_DataBlock);
3286 addUUIDFast(_PREHASH_EndPointID, cdp->getLocalEndPointID()); 3282 addUUIDFast(_PREHASH_EndPointID, cdp->getLocalEndPointID());
@@ -3301,7 +3297,7 @@ void LLMessageSystem::establishBidirectionalTrust(const LLHost &host, S64 frame_
3301 std::string shared_secret = get_shared_secret(); 3297 std::string shared_secret = get_shared_secret();
3302 if(shared_secret.empty()) 3298 if(shared_secret.empty())
3303 { 3299 {
3304 llerrs << "Trying to establish bidirectional trust on a machine without a shared secret!" << llendl; 3300 LL_ERRS("Messaging") << "Trying to establish bidirectional trust on a machine without a shared secret!" << llendl;
3305 } 3301 }
3306 LLTimer timeout; 3302 LLTimer timeout;
3307 3303
@@ -3353,8 +3349,8 @@ void LLMessageSystem::establishBidirectionalTrust(const LLHost &host, S64 frame_
3353 3349
3354void LLMessageSystem::dumpPacketToLog() 3350void LLMessageSystem::dumpPacketToLog()
3355{ 3351{
3356 llwarns << "Packet Dump from:" << mPacketRing.getLastSender() << llendl; 3352 LL_WARNS("Messaging") << "Packet Dump from:" << mPacketRing.getLastSender() << llendl;
3357 llwarns << "Packet Size:" << mTrueReceiveSize << llendl; 3353 LL_WARNS("Messaging") << "Packet Size:" << mTrueReceiveSize << llendl;
3358 char line_buffer[256]; /* Flawfinder: ignore */ 3354 char line_buffer[256]; /* Flawfinder: ignore */
3359 S32 i; 3355 S32 i;
3360 S32 cur_line_pos = 0; 3356 S32 cur_line_pos = 0;
@@ -3369,13 +3365,13 @@ void LLMessageSystem::dumpPacketToLog()
3369 if (cur_line_pos >= 16) 3365 if (cur_line_pos >= 16)
3370 { 3366 {
3371 cur_line_pos = 0; 3367 cur_line_pos = 0;
3372 llwarns << "PD:" << cur_line << "PD:" << line_buffer << llendl; 3368 LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << llendl;
3373 cur_line++; 3369 cur_line++;
3374 } 3370 }
3375 } 3371 }
3376 if (cur_line_pos) 3372 if (cur_line_pos)
3377 { 3373 {
3378 llwarns << "PD:" << cur_line << "PD:" << line_buffer << llendl; 3374 LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << llendl;
3379 } 3375 }
3380} 3376}
3381 3377
@@ -3919,7 +3915,7 @@ void LLMessageSystem::getStringFast(const char *block, const char *var,
3919{ 3915{
3920 if(buffer_size <= 0) 3916 if(buffer_size <= 0)
3921 { 3917 {
3922 llwarns << "buffer_size <= 0" << llendl; 3918 LL_WARNS("Messaging") << "buffer_size <= 0" << llendl;
3923 } 3919 }
3924 mMessageReader->getString(block, var, buffer_size, s, blocknum); 3920 mMessageReader->getString(block, var, buffer_size, s, blocknum);
3925} 3921}
diff --git a/linden/indra/llmessage/net.cpp b/linden/indra/llmessage/net.cpp
index 40c19a7..aa095a1 100644
--- a/linden/indra/llmessage/net.cpp
+++ b/linden/indra/llmessage/net.cpp
@@ -185,7 +185,7 @@ S32 start_net(S32& socket_out, int& nPort)
185 { 185 {
186 S32 err = WSAGetLastError(); 186 S32 err = WSAGetLastError();
187 WSACleanup(); 187 WSACleanup();
188 llwarns << "Windows Sockets initialization failed, err " << err << llendl; 188 LL_WARNS("AppInit") << "Windows Sockets initialization failed, err " << err << LL_ENDL;
189 return 1; 189 return 1;
190 } 190 }
191 191
@@ -195,7 +195,7 @@ S32 start_net(S32& socket_out, int& nPort)
195 { 195 {
196 S32 err = WSAGetLastError(); 196 S32 err = WSAGetLastError();
197 WSACleanup(); 197 WSACleanup();
198 llwarns << "socket() failed, err " << err << llendl; 198 LL_WARNS("AppInit") << "socket() failed, err " << err << LL_ENDL;
199 return 2; 199 return 2;
200 } 200 }
201 201
@@ -205,7 +205,7 @@ S32 start_net(S32& socket_out, int& nPort)
205 stLclAddr.sin_port = htons(nPort); 205 stLclAddr.sin_port = htons(nPort);
206 206
207 S32 attempt_port = nPort; 207 S32 attempt_port = nPort;
208 llinfos << "attempting to connect on port " << attempt_port << llendl; 208 LL_DEBUGS("AppInit") << "attempting to connect on port " << attempt_port << LL_ENDL;
209 nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr)); 209 nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr));
210 210
211 if (nRet == SOCKET_ERROR) 211 if (nRet == SOCKET_ERROR)
@@ -219,7 +219,7 @@ S32 start_net(S32& socket_out, int& nPort)
219 attempt_port++) 219 attempt_port++)
220 { 220 {
221 stLclAddr.sin_port = htons(attempt_port); 221 stLclAddr.sin_port = htons(attempt_port);
222 llinfos << "trying port " << attempt_port << llendl; 222 LL_DEBUGS("AppInit") << "trying port " << attempt_port << LL_ENDL;
223 nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr)); 223 nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr));
224 224
225 if (!(nRet == SOCKET_ERROR && 225 if (!(nRet == SOCKET_ERROR &&
@@ -231,7 +231,7 @@ S32 start_net(S32& socket_out, int& nPort)
231 231
232 if (nRet == SOCKET_ERROR) 232 if (nRet == SOCKET_ERROR)
233 { 233 {
234 llwarns << "startNet() : Couldn't find available network port." << llendl; 234 LL_WARNS("AppInit") << "startNet() : Couldn't find available network port." << LL_ENDL;
235 // Fail gracefully here in release 235 // Fail gracefully here in release
236 return 3; 236 return 3;
237 } 237 }
@@ -239,7 +239,7 @@ S32 start_net(S32& socket_out, int& nPort)
239 else 239 else
240 // Some other socket error 240 // Some other socket error
241 { 241 {
242 llwarns << llformat("bind() port: %d failed, Err: %d\n", nPort, WSAGetLastError()) << llendl; 242 LL_WARNS("AppInit") << llformat("bind() port: %d failed, Err: %d\n", nPort, WSAGetLastError()) << LL_ENDL;
243 // Fail gracefully in release. 243 // Fail gracefully in release.
244 return 4; 244 return 4;
245 } 245 }
@@ -250,7 +250,7 @@ S32 start_net(S32& socket_out, int& nPort)
250 getsockname(hSocket, (SOCKADDR*) &socket_address, &socket_address_size); 250 getsockname(hSocket, (SOCKADDR*) &socket_address, &socket_address_size);
251 attempt_port = ntohs(socket_address.sin_port); 251 attempt_port = ntohs(socket_address.sin_port);
252 252
253 llinfos << "connected on port " << attempt_port << llendl; 253 LL_INFOS("AppInit") << "connected on port " << attempt_port << LL_ENDL;
254 nPort = attempt_port; 254 nPort = attempt_port;
255 255
256 // Set socket to be non-blocking 256 // Set socket to be non-blocking
@@ -266,20 +266,20 @@ S32 start_net(S32& socket_out, int& nPort)
266 nRet = setsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, buff_size); 266 nRet = setsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, buff_size);
267 if (nRet) 267 if (nRet)
268 { 268 {
269 llinfos << "Can't set receive buffer size!" << llendl; 269 LL_INFOS("AppInit") << "Can't set receive buffer size!" << LL_ENDL;
270 } 270 }
271 271
272 nRet = setsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, buff_size); 272 nRet = setsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, buff_size);
273 if (nRet) 273 if (nRet)
274 { 274 {
275 llinfos << "Can't set send buffer size!" << llendl; 275 LL_INFOS("AppInit") << "Can't set send buffer size!" << LL_ENDL;
276 } 276 }
277 277
278 getsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, &buff_size); 278 getsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, &buff_size);
279 getsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, &buff_size); 279 getsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, &buff_size);
280 280
281 llinfos << "startNet - receive buffer size : " << rec_size << llendl; 281 LL_DEBUGS("AppInit") << "startNet - receive buffer size : " << rec_size << LL_ENDL;
282 llinfos << "startNet - send buffer size : " << snd_size << llendl; 282 LL_DEBUGS("AppInit") << "startNet - send buffer size : " << snd_size << LL_ENDL;
283 283
284 // Setup a destination address 284 // Setup a destination address
285 char achMCAddr[MAXADDRSTR] = " "; /* Flawfinder: ignore */ 285 char achMCAddr[MAXADDRSTR] = " "; /* Flawfinder: ignore */