diff options
Diffstat (limited to 'indra/llmessage')
88 files changed, 1950 insertions, 1440 deletions
diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index d193e367eb..ca48e613d2 100755 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -27,6 +27,7 @@ set(llmessage_SOURCE_FILES llares.cpp llareslistener.cpp llassetstorage.cpp + llavatarname.cpp llavatarnamecache.cpp llblowfishcipher.cpp llbuffer.cpp @@ -114,6 +115,7 @@ set(llmessage_HEADER_FILES llares.h llareslistener.h llassetstorage.h + llavatarname.h llavatarnamecache.h llblowfishcipher.h llbuffer.h @@ -128,6 +130,7 @@ set(llmessage_HEADER_FILES lldbstrings.h lldispatcher.h lleventflags.h + llextendedstatus.h llfiltersd2xmlrpc.h llfollowcamparams.h llhost.h diff --git a/indra/llmessage/llares.cpp b/indra/llmessage/llares.cpp index 7f74247a13..81e28121fd 100755 --- a/indra/llmessage/llares.cpp +++ b/indra/llmessage/llares.cpp @@ -55,13 +55,13 @@ LLAres::HostResponder::~HostResponder() void LLAres::HostResponder::hostResult(const hostent *ent) { - llinfos << "LLAres::HostResponder::hostResult not implemented" << llendl; + LL_INFOS() << "LLAres::HostResponder::hostResult not implemented" << LL_ENDL; } void LLAres::HostResponder::hostError(int code) { - llinfos << "LLAres::HostResponder::hostError " << code << ": " - << LLAres::strerror(code) << llendl; + LL_INFOS() << "LLAres::HostResponder::hostError " << code << ": " + << LLAres::strerror(code) << LL_ENDL; } LLAres::NameInfoResponder::~NameInfoResponder() @@ -71,14 +71,14 @@ LLAres::NameInfoResponder::~NameInfoResponder() void LLAres::NameInfoResponder::nameInfoResult(const char *node, const char *service) { - llinfos << "LLAres::NameInfoResponder::nameInfoResult not implemented" - << llendl; + LL_INFOS() << "LLAres::NameInfoResponder::nameInfoResult not implemented" + << LL_ENDL; } void LLAres::NameInfoResponder::nameInfoError(int code) { - llinfos << "LLAres::NameInfoResponder::nameInfoError " << code << ": " - << LLAres::strerror(code) << llendl; + LL_INFOS() << "LLAres::NameInfoResponder::nameInfoError " << code << ": " + << LLAres::strerror(code) << LL_ENDL; } LLAres::QueryResponder::~QueryResponder() @@ -87,14 +87,14 @@ LLAres::QueryResponder::~QueryResponder() void LLAres::QueryResponder::queryResult(const char *buf, size_t len) { - llinfos << "LLAres::QueryResponder::queryResult not implemented" - << llendl; + LL_INFOS() << "LLAres::QueryResponder::queryResult not implemented" + << LL_ENDL; } void LLAres::QueryResponder::queryError(int code) { - llinfos << "LLAres::QueryResponder::queryError " << code << ": " - << LLAres::strerror(code) << llendl; + LL_INFOS() << "LLAres::QueryResponder::queryError " << code << ": " + << LLAres::strerror(code) << LL_ENDL; } LLAres::LLAres() : @@ -104,7 +104,7 @@ LLAres::LLAres() : if (ares_library_init( ARES_LIB_INIT_ALL ) != ARES_SUCCESS || ares_init(&chan_) != ARES_SUCCESS) { - llwarns << "Could not succesfully initialize ares!" << llendl; + LL_WARNS() << "Could not succesfully initialize ares!" << LL_ENDL; return; } @@ -176,7 +176,7 @@ void LLAres::rewriteURI(const std::string &uri, UriRewriteResponder *resp) return; } - //llinfos << "LLAres::rewriteURI (" << uri << ") search: '" << "_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName() << "'" << llendl; + //LL_INFOS() << "LLAres::rewriteURI (" << uri << ") search: '" << "_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName() << "'" << LL_ENDL; search("_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName(), RES_SRV, resp); @@ -251,8 +251,8 @@ int LLQueryResponder::parseRR(const char *buf, size_t len, const char *&pos, r = new LLSrvRecord(rrname, rrttl); break; default: - llinfos << "LLQueryResponder::parseRR got unknown RR type " << rrtype - << llendl; + LL_INFOS() << "LLQueryResponder::parseRR got unknown RR type " << rrtype + << LL_ENDL; return ARES_EBADRESP; } @@ -333,7 +333,7 @@ void LLQueryResponder::queryResult(const char *buf, size_t len) mType = (LLResType) t; break; default: - llinfos << "Cannot grok query type " << t << llendl; + LL_INFOS() << "Cannot grok query type " << t << LL_ENDL; ret = ARES_EBADQUERY; goto bail; } @@ -373,7 +373,7 @@ bail: void LLQueryResponder::querySuccess() { - llinfos << "LLQueryResponder::queryResult not implemented" << llendl; + LL_INFOS() << "LLQueryResponder::queryResult not implemented" << LL_ENDL; } void LLAres::SrvResponder::querySuccess() @@ -393,23 +393,23 @@ void LLAres::SrvResponder::queryError(int code) void LLAres::SrvResponder::srvResult(const dns_rrs_t &ents) { - llinfos << "LLAres::SrvResponder::srvResult not implemented" << llendl; + LL_INFOS() << "LLAres::SrvResponder::srvResult not implemented" << LL_ENDL; for (size_t i = 0; i < ents.size(); i++) { const LLSrvRecord *s = (const LLSrvRecord *) ents[i].get(); - llinfos << "[" << i << "] " << s->host() << ":" << s->port() + LL_INFOS() << "[" << i << "] " << s->host() << ":" << s->port() << " priority " << s->priority() << " weight " << s->weight() - << llendl; + << LL_ENDL; } } void LLAres::SrvResponder::srvError(int code) { - llinfos << "LLAres::SrvResponder::srvError " << code << ": " - << LLAres::strerror(code) << llendl; + LL_INFOS() << "LLAres::SrvResponder::srvError " << code << ": " + << LLAres::strerror(code) << LL_ENDL; } static void nameinfo_callback_1_5(void *arg, int status, int timeouts, @@ -820,11 +820,11 @@ done: void LLAres::UriRewriteResponder::rewriteResult( const std::vector<std::string> &uris) { - llinfos << "LLAres::UriRewriteResponder::rewriteResult not implemented" - << llendl; + LL_INFOS() << "LLAres::UriRewriteResponder::rewriteResult not implemented" + << LL_ENDL; for (size_t i = 0; i < uris.size(); i++) { - llinfos << "[" << i << "] " << uris[i] << llendl; + LL_INFOS() << "[" << i << "] " << uris[i] << LL_ENDL; } } diff --git a/indra/llmessage/llareslistener.cpp b/indra/llmessage/llareslistener.cpp index 0a4effac19..3d65906b98 100755 --- a/indra/llmessage/llareslistener.cpp +++ b/indra/llmessage/llareslistener.cpp @@ -99,6 +99,6 @@ void LLAresListener::rewriteURI(const LLSD& data) } else { - llinfos << "LLAresListener::rewriteURI requested without Ares present. Ignoring: " << data << llendl; + LL_INFOS() << "LLAresListener::rewriteURI requested without Ares present. Ignoring: " << data << LL_ENDL; } } diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index 9b86daebe5..8ba2535531 100755 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -50,10 +50,14 @@ #include "lltransfertargetvfile.h" // For debugging #include "llmetrics.h" +#include "lltrace.h" LLAssetStorage *gAssetStorage = NULL; LLMetrics *LLAssetStorage::metric_recipient = NULL; +static LLTrace::CountStatHandle<> sFailedDownloadCount("faileddownloads", "Number of times LLAssetStorage::getAssetData() has failed"); + + const LLUUID CATEGORIZE_LOST_AND_FOUND_ID(std::string("00000000-0000-0000-0000-000000000010")); const U64 TOXIC_ASSET_LIFETIME = (120 * 1000000); // microseconds @@ -149,8 +153,8 @@ void LLAssetInfo::setFromNameValue( const LLNameValue& nv ) setName( buf ); buf.assign( str, pos2, std::string::npos ); setDescription( buf ); - LL_DEBUGS("AssetStorage") << "uuid: " << mUuid << llendl; - LL_DEBUGS("AssetStorage") << "creator: " << mCreatorID << llendl; + LL_DEBUGS("AssetStorage") << "uuid: " << mUuid << LL_ENDL; + LL_DEBUGS("AssetStorage") << "creator: " << mCreatorID << LL_ENDL; } ///---------------------------------------------------------------------------- @@ -190,8 +194,8 @@ LLSD LLAssetRequest::getTerseDetails() const sd["asset_id"] = getUUID(); sd["type_long"] = LLAssetType::lookupHumanReadable(getType()); sd["type"] = LLAssetType::lookup(getType()); - sd["time"] = mTime; - time_t timestamp = (time_t) mTime; + sd["time"] = mTime.value(); + time_t timestamp = (time_t) mTime.value(); std::ostringstream time_string; time_string << ctime(×tamp); sd["time_string"] = time_string.str(); @@ -337,7 +341,7 @@ void LLAssetStorage::checkForTimeouts() void LLAssetStorage::_cleanupRequests(BOOL all, S32 error) { - F64 mt_secs = LLMessageSystem::getMessageTimeSeconds(); + F64Seconds mt_secs = LLMessageSystem::getMessageTimeSeconds(); request_list_t timed_out; S32 rt; @@ -356,10 +360,10 @@ void LLAssetStorage::_cleanupRequests(BOOL all, S32 error) || ((RT_DOWNLOAD == rt) && LL_ASSET_STORAGE_TIMEOUT < (mt_secs - tmp->mTime))) { - llwarns << "Asset " << getRequestName((ERequestType)rt) << " request " + LL_WARNS() << "Asset " << getRequestName((ERequestType)rt) << " request " << (all ? "aborted" : "timed out") << " for " << tmp->getUUID() << "." - << LLAssetType::lookup(tmp->getType()) << llendl; + << LLAssetType::lookup(tmp->getType()) << LL_ENDL; timed_out.push_front(tmp); iter = requests->erase(curiter); @@ -401,7 +405,7 @@ bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAsse if (user_data) { // The *user_data should not be passed without a callback to clean it up. - llassert(callback != NULL) + llassert(callback != NULL); } BOOL exists = mStaticVFS->getExists(uuid, type); @@ -420,8 +424,8 @@ bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAsse } else { - llwarns << "Asset vfile " << uuid << ":" << type - << " found in static cache with bad size " << file.getSize() << ", ignoring" << llendl; + LL_WARNS() << "Asset vfile " << uuid << ":" << type + << " found in static cache with bad size " << file.getSize() << ", ignoring" << LL_ENDL; } } return false; @@ -434,22 +438,23 @@ bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAsse // IW - uuid is passed by value to avoid side effects, please don't re-add & void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LLGetAssetCallback callback, void *user_data, BOOL is_priority) { - LL_DEBUGS("AssetStorage") << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << llendl; + LL_DEBUGS("AssetStorage") << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << LL_ENDL; - LL_DEBUGS("AssetStorage") << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << llendl; + LL_DEBUGS("AssetStorage") << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << LL_ENDL; if (user_data) { // The *user_data should not be passed without a callback to clean it up. - llassert(callback != NULL) + llassert(callback != NULL); } if (mShutDown) { - LL_DEBUGS("AssetStorage") << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << llendl; + LL_DEBUGS("AssetStorage") << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << LL_ENDL; if (callback) { + add(sFailedDownloadCount, 1); callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_FAILED, LL_EXSTAT_NONE); } return; @@ -460,6 +465,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL // Special case early out for NULL uuid and for shutting down if (callback) { + add(sFailedDownloadCount, 1); callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID); } return; @@ -468,7 +474,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL // Try static VFS first. if (findInStaticVFSAndInvokeCallback(uuid,type,callback,user_data)) { - LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in static VFS" << llendl; + LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in static VFS" << LL_ENDL; return; } @@ -486,13 +492,13 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL callback(mVFS, uuid, type, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED); } - LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in VFS" << llendl; + LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in VFS" << LL_ENDL; } else { if (exists) { - llwarns << "Asset vfile " << uuid << ":" << type << " found with bad size " << file.getSize() << ", removing" << llendl; + LL_WARNS() << "Asset vfile " << uuid << ":" << type << " found with bad size " << file.getSize() << ", removing" << LL_ENDL; file.remove(); } @@ -508,8 +514,8 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL if (callback == tmp->mDownCallback && user_data == tmp->mUserData) { // this is a duplicate from the same subsystem - throw it away - llwarns << "Discarding duplicate request for asset " << uuid - << "." << LLAssetType::lookup(type) << llendl; + LL_WARNS() << "Discarding duplicate request for asset " << uuid + << "." << LLAssetType::lookup(type) << LL_ENDL; return; } @@ -521,7 +527,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL if (duplicate) { LL_DEBUGS("AssetStorage") << "Adding additional non-duplicate request for asset " << uuid - << "." << LLAssetType::lookup(type) << llendl; + << "." << LLAssetType::lookup(type) << LL_ENDL; } // This can be overridden by subclasses @@ -561,7 +567,7 @@ void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType at tpvf.setAsset(uuid, atype); tpvf.setCallback(downloadCompleteCallback, req); - //llinfos << "Starting transfer for " << uuid << llendl; + //LL_INFOS() << "Starting transfer for " << uuid << LL_ENDL; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(mUpstreamHost, LLTCT_ASSET); ttcp->requestTransfer(spa, tpvf, 100.f + (is_priority ? 1.f : 0.f)); } @@ -569,9 +575,10 @@ void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType at else { // uh-oh, we shouldn't have gotten here - llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl; + LL_WARNS() << "Attempt to move asset data request upstream w/o valid upstream provider" << LL_ENDL; if (callback) { + add(sFailedDownloadCount, 1); callback(mVFS, uuid, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM); } } @@ -584,20 +591,20 @@ void LLAssetStorage::downloadCompleteCallback( LLAssetType::EType file_type, void* user_data, LLExtStat ext_status) { - LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << file_id << " downloadCompleteCallback" << llendl; + LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << file_id << " downloadCompleteCallback" << LL_ENDL; LL_DEBUGS("AssetStorage") << "LLAssetStorage::downloadCompleteCallback() for " << file_id - << "," << LLAssetType::lookup(file_type) << llendl; + << "," << LLAssetType::lookup(file_type) << LL_ENDL; LLAssetRequest* req = (LLAssetRequest*)user_data; if(!req) { - llwarns << "LLAssetStorage::downloadCompleteCallback called without" - "a valid request." << llendl; + LL_WARNS() << "LLAssetStorage::downloadCompleteCallback called without" + "a valid request." << LL_ENDL; return; } if (!gAssetStorage) { - llwarns << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << llendl; + LL_WARNS() << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << LL_ENDL; return; } @@ -620,7 +627,7 @@ void LLAssetStorage::downloadCompleteCallback( LLVFile vfile(gAssetStorage->mVFS, req->getUUID(), req->getType()); if (vfile.getSize() <= 0) { - llwarns << "downloadCompleteCallback has non-existent or zero-size asset " << req->getUUID() << llendl; + LL_WARNS() << "downloadCompleteCallback has non-existent or zero-size asset " << req->getUUID() << LL_ENDL; result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE; vfile.remove(); @@ -649,6 +656,10 @@ void LLAssetStorage::downloadCompleteCallback( LLAssetRequest* tmp = *curiter; if (tmp->mDownCallback) { + if (result != LL_ERR_NOERR) + { + add(sFailedDownloadCount, 1); + } tmp->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getType(), tmp->mUserData, result, ext_status); } delete tmp; @@ -659,7 +670,7 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen const LLUUID &asset_id, LLAssetType::EType atype, EstateAssetType etype, LLGetAssetCallback callback, void *user_data, BOOL is_priority) { - lldebugs << "LLAssetStorage::getEstateAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << ", estatetype " << etype << llendl; + LL_DEBUGS() << "LLAssetStorage::getEstateAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << ", estatetype " << etype << LL_ENDL; // // Probably will get rid of this early out? @@ -669,6 +680,7 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen // Special case early out for NULL uuid if (callback) { + add(sFailedDownloadCount, 1); callback(mVFS, asset_id, atype, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID); } return; @@ -698,7 +710,7 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen { if (exists) { - llwarns << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << llendl; + LL_WARNS() << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << LL_ENDL; file.remove(); } @@ -731,16 +743,17 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen tpvf.setAsset(asset_id, atype); tpvf.setCallback(downloadEstateAssetCompleteCallback, req); - LL_DEBUGS("AssetStorage") << "Starting transfer for " << asset_id << llendl; + LL_DEBUGS("AssetStorage") << "Starting transfer for " << asset_id << LL_ENDL; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(source_host, LLTCT_ASSET); ttcp->requestTransfer(spe, tpvf, 100.f + (is_priority ? 1.f : 0.f)); } else { // uh-oh, we shouldn't have gotten here - llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl; + LL_WARNS() << "Attempt to move asset data request upstream w/o valid upstream provider" << LL_ENDL; if (callback) { + add(sFailedDownloadCount, 1); callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM); } } @@ -757,14 +770,14 @@ void LLAssetStorage::downloadEstateAssetCompleteCallback( LLEstateAssetRequest *req = (LLEstateAssetRequest*)user_data; if(!req) { - llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called" - " without a valid request." << llendl; + LL_WARNS() << "LLAssetStorage::downloadEstateAssetCompleteCallback called" + " without a valid request." << LL_ENDL; return; } if (!gAssetStorage) { - llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called" - " without any asset system, aborting!" << llendl; + LL_WARNS() << "LLAssetStorage::downloadEstateAssetCompleteCallback called" + " without any asset system, aborting!" << LL_ENDL; return; } @@ -776,13 +789,17 @@ void LLAssetStorage::downloadEstateAssetCompleteCallback( LLVFile vfile(gAssetStorage->mVFS, req->getUUID(), req->getAType()); if (vfile.getSize() <= 0) { - llwarns << "downloadCompleteCallback has non-existent or zero-size asset!" << llendl; + LL_WARNS() << "downloadCompleteCallback has non-existent or zero-size asset!" << LL_ENDL; result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE; vfile.remove(); } } + if (result != LL_ERR_NOERR) + { + add(sFailedDownloadCount, 1); + } req->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getAType(), req->mUserData, result, ext_status); } @@ -791,7 +808,7 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age const LLUUID &asset_id, LLAssetType::EType atype, LLGetAssetCallback callback, void *user_data, BOOL is_priority) { - lldebugs << "LLAssetStorage::getInvItemAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << llendl; + LL_DEBUGS() << "LLAssetStorage::getInvItemAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << LL_ENDL; // // Probably will get rid of this early out? @@ -822,7 +839,7 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age size = exists ? file.getSize() : 0; if(exists && size < 1) { - llwarns << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << llendl; + LL_WARNS() << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << LL_ENDL; file.remove(); } @@ -873,16 +890,17 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age LL_DEBUGS("AssetStorage") << "Starting transfer for inventory asset " << item_id << " owned by " << owner_id << "," << task_id - << llendl; + << LL_ENDL; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(source_host, LLTCT_ASSET); ttcp->requestTransfer(spi, tpvf, 100.f + (is_priority ? 1.f : 0.f)); } else { // uh-oh, we shouldn't have gotten here - llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl; + LL_WARNS() << "Attempt to move asset data request upstream w/o valid upstream provider" << LL_ENDL; if (callback) { + add(sFailedDownloadCount, 1); callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM); } } @@ -900,13 +918,13 @@ void LLAssetStorage::downloadInvItemCompleteCallback( LLInvItemRequest *req = (LLInvItemRequest*)user_data; if(!req) { - llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called" - " without a valid request." << llendl; + LL_WARNS() << "LLAssetStorage::downloadEstateAssetCompleteCallback called" + " without a valid request." << LL_ENDL; return; } if (!gAssetStorage) { - llwarns << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << llendl; + LL_WARNS() << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << LL_ENDL; return; } @@ -918,13 +936,17 @@ void LLAssetStorage::downloadInvItemCompleteCallback( LLVFile vfile(gAssetStorage->mVFS, req->getUUID(), req->getType()); if (vfile.getSize() <= 0) { - llwarns << "downloadCompleteCallback has non-existent or zero-size asset!" << llendl; + LL_WARNS() << "downloadCompleteCallback has non-existent or zero-size asset!" << LL_ENDL; result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE; vfile.remove(); } } + if (result != LL_ERR_NOERR) + { + add(sFailedDownloadCount, 1); + } req->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getType(), req->mUserData, result, ext_status); } @@ -937,7 +959,7 @@ void LLAssetStorage::uploadCompleteCallback(const LLUUID& uuid, void *user_data, { if (!gAssetStorage) { - llwarns << "LLAssetStorage::uploadCompleteCallback has no gAssetStorage!" << llendl; + LL_WARNS() << "LLAssetStorage::uploadCompleteCallback has no gAssetStorage!" << LL_ENDL; return; } LLAssetRequest *req = (LLAssetRequest *)user_data; @@ -945,7 +967,7 @@ void LLAssetStorage::uploadCompleteCallback(const LLUUID& uuid, void *user_data, if (result) { - llwarns << "LLAssetStorage::uploadCompleteCallback " << result << ":" << getErrorString(result) << " trying to upload file to upstream provider" << llendl; + LL_WARNS() << "LLAssetStorage::uploadCompleteCallback " << result << ":" << getErrorString(result) << " trying to upload file to upstream provider" << LL_ENDL; success = FALSE; } @@ -1027,7 +1049,7 @@ LLAssetStorage::request_list_t* LLAssetStorage::getRequestList(LLAssetStorage::E case RT_LOCALUPLOAD: return &mPendingLocalUploads; default: - llwarns << "Unable to find request list for request type '" << rt << "'" << llendl; + LL_WARNS() << "Unable to find request list for request type '" << rt << "'" << LL_ENDL; return NULL; } } @@ -1043,7 +1065,7 @@ const LLAssetStorage::request_list_t* LLAssetStorage::getRequestList(LLAssetStor case RT_LOCALUPLOAD: return &mPendingLocalUploads; default: - llwarns << "Unable to find request list for request type '" << rt << "'" << llendl; + LL_WARNS() << "Unable to find request list for request type '" << rt << "'" << LL_ENDL; return NULL; } } @@ -1060,7 +1082,7 @@ std::string LLAssetStorage::getRequestName(LLAssetStorage::ERequestType rt) case RT_LOCALUPLOAD: return "localupload"; default: - llwarns << "Unable to find request name for request type '" << rt << "'" << llendl; + LL_WARNS() << "Unable to find request name for request type '" << rt << "'" << LL_ENDL; return ""; } } @@ -1213,7 +1235,7 @@ bool LLAssetStorage::deletePendingRequest(LLAssetStorage::ERequestType rt, { LL_DEBUGS("AssetStorage") << "Asset " << getRequestName(rt) << " request for " << asset_id << "." << LLAssetType::lookup(asset_type) - << " removed from pending queue." << llendl; + << " removed from pending queue." << LL_ENDL; return true; } return false; @@ -1237,6 +1259,7 @@ bool LLAssetStorage::deletePendingRequestImpl(LLAssetStorage::request_list_t* re } if (req->mDownCallback) { + add(sFailedDownloadCount, 1); req->mDownCallback(mVFS, req->getUUID(), req->getType(), req->mUserData, error, LL_EXSTAT_REQUEST_DROPPED); } if (req->mInfoCallback) @@ -1307,7 +1330,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, vo user_data == ((LLLegacyAssetRequest *)tmp->mUserData)->mUserData) { // this is a duplicate from the same subsystem - throw it away - LL_DEBUGS("AssetStorage") << "Discarding duplicate request for UUID " << uuid << llendl; + LL_DEBUGS("AssetStorage") << "Discarding duplicate request for UUID " << uuid << LL_ENDL; return; } } @@ -1363,6 +1386,10 @@ void LLAssetStorage::legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAss } } + if (status != LL_ERR_NOERR) + { + add(sFailedDownloadCount, 1); + } legacy->mDownCallback(filename.c_str(), uuid, legacy->mUserData, status, ext_status); delete legacy; } @@ -1378,9 +1405,9 @@ void LLAssetStorage::storeAssetData( bool is_priority, bool store_local, bool user_waiting, - F64 timeout) + F64Seconds timeout) { - llwarns << "storeAssetData: wrong version called" << llendl; + LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL; // LLAssetStorage metric: Virtual base call reportMetric( LLUUID::null, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 1" ); } @@ -1397,9 +1424,9 @@ void LLAssetStorage::storeAssetData( bool store_local, const LLUUID& requesting_agent_id, bool user_waiting, - F64 timeout) + F64Seconds timeout) { - llwarns << "storeAssetData: wrong version called" << llendl; + LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL; // LLAssetStorage metric: Virtual base call reportMetric( asset_id, asset_type, LLStringUtil::null, requesting_agent_id, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 2" ); } @@ -1415,9 +1442,9 @@ void LLAssetStorage::storeAssetData( bool temp_file, bool is_priority, bool user_waiting, - F64 timeout) + F64Seconds timeout) { - llwarns << "storeAssetData: wrong version called" << llendl; + LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL; // LLAssetStorage metric: Virtual base call reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 3" ); } @@ -1433,9 +1460,9 @@ void LLAssetStorage::storeAssetData( bool temp_file, bool is_priority, bool user_waiting, - F64 timeout) + F64Seconds timeout) { - llwarns << "storeAssetData: wrong version called" << llendl; + LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL; // LLAssetStorage metric: Virtual base call reportMetric( LLUUID::null, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 4" ); } @@ -1490,7 +1517,7 @@ void LLAssetStorage::reportMetric( const LLUUID& asset_id, const LLAssetType::ET { if( !metric_recipient ) { - LL_DEBUGS("AssetStorage") << "Couldn't store LLAssetStoreage::reportMetric - no metrics_recipient" << llendl; + LL_DEBUGS("AssetStorage") << "Couldn't store LLAssetStoreage::reportMetric - no metrics_recipient" << LL_ENDL; return; } diff --git a/indra/llmessage/llassetstorage.h b/indra/llmessage/llassetstorage.h index 563ff9e077..1bb4acea9e 100755 --- a/indra/llmessage/llassetstorage.h +++ b/indra/llmessage/llassetstorage.h @@ -34,11 +34,11 @@ #include "lltimer.h" #include "llnamevalue.h" #include "llhost.h" -#include "stdenums.h" // for EDragAndDropType #include "lltransfermanager.h" // For LLTSCode enum #include "llassettype.h" #include "llstring.h" #include "llextendedstatus.h" +#include "llxfer.h" // Forward declarations class LLMessageSystem; @@ -49,7 +49,16 @@ class LLSD; // anything that takes longer than this to download will abort. // HTTP Uploads also timeout if they take longer than this. -const F32 LL_ASSET_STORAGE_TIMEOUT = 5 * 60.0f; +const F32Minutes LL_ASSET_STORAGE_TIMEOUT(5); + + +// Specific error codes +const int LL_ERR_ASSET_REQUEST_FAILED = -1; +//const int LL_ERR_ASSET_REQUEST_INVALID = -2; +const int LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE = -3; +const int LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE = -4; +const int LL_ERR_INSUFFICIENT_PERMISSIONS = -5; +const int LL_ERR_PRICE_MISMATCH = -23018; class LLAssetInfo { @@ -94,7 +103,7 @@ public: void setUUID(const LLUUID& id) { mUUID = id; } void setType(LLAssetType::EType type) { mType = type; } - void setTimeout (F64 timeout) { mTimeout = timeout; } + void setTimeout (F64Seconds timeout) { mTimeout = timeout; } protected: LLUUID mUUID; @@ -110,8 +119,8 @@ public: BOOL mIsTemp; BOOL mIsLocal; BOOL mIsUserWaiting; // We don't want to try forever if a user is waiting for a result. - F64 mTime; // Message system time - F64 mTimeout; // Amount of time before timing out. + F64Seconds mTime; // Message system time + F64Seconds mTimeout; // Amount of time before timing out. BOOL mIsPriority; BOOL mDataSentInFirstPacket; BOOL mDataIsInVFS; @@ -154,7 +163,7 @@ public: void *mUserData; LLHost mHost; BOOL mIsTemp; - F64 mTime; // Message system time + F64Seconds mTime; // Message system time BOOL mIsPriority; BOOL mDataSentInFirstPacket; BOOL mDataIsInVFS; @@ -184,7 +193,7 @@ public: void *mUserData; LLHost mHost; BOOL mIsTemp; - F64 mTime; // Message system time + F64Seconds mTime; // Message system time BOOL mIsPriority; BOOL mDataSentInFirstPacket; BOOL mDataIsInVFS; @@ -270,7 +279,7 @@ public: bool is_priority = false, bool store_local = false, bool user_waiting= false, - F64 timeout=LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT); /* * AssetID version @@ -286,7 +295,7 @@ public: bool store_local = false, const LLUUID& requesting_agent_id = LLUUID::null, bool user_waiting= false, - F64 timeout=LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT); virtual void checkForTimeouts(); @@ -394,7 +403,7 @@ public: bool temp_file = false, bool is_priority = false, bool user_waiting = false, - F64 timeout = LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout = LL_ASSET_STORAGE_TIMEOUT); /* * TransactionID version @@ -408,7 +417,7 @@ public: bool temp_file = false, bool is_priority = false, bool user_waiting = false, - F64 timeout = LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout = LL_ASSET_STORAGE_TIMEOUT); static void legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType, void *user_data, S32 status, LLExtStat ext_status); static void legacyStoreDataCallback(const LLUUID &uuid, void *user_data, S32 status, LLExtStat ext_status); diff --git a/indra/llmessage/llavatarname.cpp b/indra/llmessage/llavatarname.cpp new file mode 100644 index 0000000000..d12f157910 --- /dev/null +++ b/indra/llmessage/llavatarname.cpp @@ -0,0 +1,254 @@ +/** + * @file llavatarname.cpp + * @brief Represents name-related data for an avatar, such as the + * username/SLID ("bobsmith123" or "james.linden") and the display + * name ("James Cook") + * + * $LicenseInfo:firstyear=2010&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "llavatarname.h" + +#include "lldate.h" +#include "llframetimer.h" +#include "llsd.h" + +// Store these in pre-built std::strings to avoid memory allocations in +// LLSD map lookups +static const std::string USERNAME("username"); +static const std::string DISPLAY_NAME("display_name"); +static const std::string LEGACY_FIRST_NAME("legacy_first_name"); +static const std::string LEGACY_LAST_NAME("legacy_last_name"); +static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default"); +static const std::string DISPLAY_NAME_EXPIRES("display_name_expires"); +static const std::string DISPLAY_NAME_NEXT_UPDATE("display_name_next_update"); + +bool LLAvatarName::sUseDisplayNames = true; +bool LLAvatarName::sUseUsernames = true; + +// Minimum time-to-live (in seconds) for a name entry. +// Avatar name should always guarantee to expire reasonably soon by default +// so if the failure to get a valid expiration time was due to something temporary +// we will eventually request and get the right data. +const F64 MIN_ENTRY_LIFETIME = 60.0; + +LLAvatarName::LLAvatarName() +: mUsername(), + mDisplayName(), + mLegacyFirstName(), + mLegacyLastName(), + mIsDisplayNameDefault(false), + mIsTemporaryName(false), + mExpires(F64_MAX), + mNextUpdate(0.0) +{ } + +bool LLAvatarName::operator<(const LLAvatarName& rhs) const +{ + if (mUsername == rhs.mUsername) + return mDisplayName < rhs.mDisplayName; + else + return mUsername < rhs.mUsername; +} + +//static +void LLAvatarName::setUseDisplayNames(bool use) +{ + sUseDisplayNames = use; +} +//static +bool LLAvatarName::useDisplayNames() +{ + return sUseDisplayNames; +} + +void LLAvatarName::setUseUsernames(bool use) +{ + sUseUsernames = use; +} + +bool LLAvatarName::useUsernames() +{ + return sUseUsernames; +} + +LLSD LLAvatarName::asLLSD() const +{ + LLSD sd; + sd[USERNAME] = mUsername; + sd[DISPLAY_NAME] = mDisplayName; + sd[LEGACY_FIRST_NAME] = mLegacyFirstName; + sd[LEGACY_LAST_NAME] = mLegacyLastName; + sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault; + sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires); + sd[DISPLAY_NAME_NEXT_UPDATE] = LLDate(mNextUpdate); + return sd; +} + +void LLAvatarName::fromLLSD(const LLSD& sd) +{ + mUsername = sd[USERNAME].asString(); + mDisplayName = sd[DISPLAY_NAME].asString(); + mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString(); + mLegacyLastName = sd[LEGACY_LAST_NAME].asString(); + mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean(); + LLDate expires = sd[DISPLAY_NAME_EXPIRES]; + mExpires = expires.secondsSinceEpoch(); + LLDate next_update = sd[DISPLAY_NAME_NEXT_UPDATE]; + mNextUpdate = next_update.secondsSinceEpoch(); + + // Some avatars don't have explicit display names set. Force a legible display name here. + if (mDisplayName.empty()) + { + mDisplayName = mUsername; + } +} + +// Transform a string (typically provided by the legacy service) into a decent +// avatar name instance. +void LLAvatarName::fromString(const std::string& full_name) +{ + mDisplayName = full_name; + std::string::size_type index = full_name.find(' '); + if (index != std::string::npos) + { + // The name is in 2 parts (first last) + mLegacyFirstName = full_name.substr(0, index); + mLegacyLastName = full_name.substr(index+1); + if (mLegacyLastName != "Resident") + { + mUsername = mLegacyFirstName + "." + mLegacyLastName; + mDisplayName = full_name; + LLStringUtil::toLower(mUsername); + } + else + { + // Very old names do have a dummy "Resident" last name + // that we choose to hide from users. + mUsername = mLegacyFirstName; + mDisplayName = mLegacyFirstName; + } + } + else + { + mLegacyFirstName = full_name; + mLegacyLastName = ""; + mUsername = full_name; + mDisplayName = full_name; + } + mIsDisplayNameDefault = true; + mIsTemporaryName = true; + setExpires(MIN_ENTRY_LIFETIME); +} + +void LLAvatarName::setExpires(F64 expires) +{ + mExpires = LLFrameTimer::getTotalSeconds() + expires; +} + +std::string LLAvatarName::getCompleteName() const +{ + std::string name; + if (sUseDisplayNames) + { + if (mUsername.empty() || mIsDisplayNameDefault) + { + // If this particular display name is defaulted (i.e. based on user name), + // then display only the easier to read instance of the person's name. + name = mDisplayName; + } + else + { + name = mDisplayName; + if(sUseUsernames) + { + name += " (" + mUsername + ")"; + } + } + } + else + { + name = getUserName(); + } + return name; +} + +std::string LLAvatarName::getLegacyName() const +{ + if (mLegacyFirstName.empty() && mLegacyLastName.empty()) // display names disabled? + { + return mDisplayName; + } + + std::string name; + name.reserve( mLegacyFirstName.size() + 1 + mLegacyLastName.size() ); + name = mLegacyFirstName; + name += " "; + name += mLegacyLastName; + return name; +} + +std::string LLAvatarName::getDisplayName() const +{ + if (sUseDisplayNames) + { + return mDisplayName; + } + else + { + return getUserName(); + } +} + +std::string LLAvatarName::getUserName() const +{ + std::string name; + if (mLegacyLastName.empty() || (mLegacyLastName == "Resident")) + { + if (mLegacyFirstName.empty()) + { + // If we cannot create a user name from the legacy strings, use the display name + name = mDisplayName; + } + else + { + // The last name might be empty if it defaulted to "Resident" + name = mLegacyFirstName; + } + } + else + { + name = mLegacyFirstName + " " + mLegacyLastName; + } + return name; +} + +void LLAvatarName::dump() const +{ + LL_DEBUGS("AvNameCache") << "LLAvatarName: " + << "user '" << mUsername << "' " + << "display '" << mDisplayName << "' " + << "expires in " << mExpires - LLFrameTimer::getTotalSeconds() << " seconds" + << LL_ENDL; +} + diff --git a/indra/llmessage/llavatarname.h b/indra/llmessage/llavatarname.h new file mode 100644 index 0000000000..1cb3ae421f --- /dev/null +++ b/indra/llmessage/llavatarname.h @@ -0,0 +1,139 @@ +/** + * @file llavatarname.h + * @brief Represents name-related data for an avatar, such as the + * username/SLID ("bobsmith123" or "james.linden") and the display + * name ("James Cook") + * + * $LicenseInfo:firstyear=2010&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ +#ifndef LLAVATARNAME_H +#define LLAVATARNAME_H + +#include <string> + +class LLSD; + +class LL_COMMON_API LLAvatarName +{ +public: + LLAvatarName(); + + bool operator<(const LLAvatarName& rhs) const; + + // Conversion to and from LLSD (cache file or server response) + LLSD asLLSD() const; + void fromLLSD(const LLSD& sd); + + // Used only in legacy mode when the display name capability is not provided server side + // or to otherwise create a temporary valid item. + void fromString(const std::string& full_name); + + // Set the name object to become invalid in "expires" seconds from now + void setExpires(F64 expires); + + // Set and get the display name flag set by the user in preferences. + static void setUseDisplayNames(bool use); + static bool useDisplayNames(); + + static void setUseUsernames(bool use); + static bool useUsernames(); + + // A name object is valid if not temporary and not yet expired (default is expiration not checked) + bool isValidName(F64 max_unrefreshed = 0.0f) const { return !mIsTemporaryName && (mExpires >= max_unrefreshed); } + + // Return true if the name is made up from legacy or temporary data + bool isDisplayNameDefault() const { return mIsDisplayNameDefault; } + + // For normal names, returns "James Linden (james.linden)" + // When display names are disabled returns just "James Linden" + std::string getCompleteName() const; + + // Returns "James Linden" or "bobsmith123 Resident" for backwards + // compatibility with systems like voice and muting + // *TODO: Eliminate this in favor of username only + std::string getLegacyName() const; + + // "José Sanchez" or "James Linden", UTF-8 encoded Unicode + // Takes the display name preference into account. This is truly the name that should + // be used for all UI where an avatar name has to be used unless we truly want something else (rare) + std::string getDisplayName() const; + + // Returns "James Linden" or "bobsmith123 Resident" + // Used where we explicitely prefer or need a non UTF-8 legacy (ASCII) name + // Also used for backwards compatibility with systems like voice and muting + std::string getUserName() const; + + // Returns "james.linden" or the legacy name for very old names + std::string getAccountName() const { return mUsername; } + + // Debug print of the object + void dump() const; + + // Names can change, so need to keep track of when name was + // last checked. + // Unix time-from-epoch seconds for efficiency + F64 mExpires; + + // You can only change your name every N hours, so record + // when the next update is allowed + // Unix time-from-epoch seconds + F64 mNextUpdate; + +private: + // "bobsmith123" or "james.linden", US-ASCII only + std::string mUsername; + + // "José Sanchez" or "James Linden", UTF-8 encoded Unicode + // Contains data whether or not user has explicitly set + // a display name; may duplicate their username. + std::string mDisplayName; + + // For "James Linden", "James" + // For "bobsmith123", "bobsmith123" + // Used to communicate with legacy systems like voice and muting which + // rely on old-style names. + // *TODO: Eliminate this in favor of username only + std::string mLegacyFirstName; + + // For "James Linden", "Linden" + // For "bobsmith123", "Resident" + // see above for rationale + std::string mLegacyLastName; + + // If true, both display name and SLID were generated from + // a legacy first and last name, like "James Linden (james.linden)" + bool mIsDisplayNameDefault; + + // Under error conditions, we may insert "dummy" records with + // names like "???" into caches as placeholders. These can be + // shown in UI, but are not serialized. + bool mIsTemporaryName; + + // Global flag indicating if display name should be used or not + // This will affect the output of the high level "get" methods + static bool sUseDisplayNames; + + // Flag indicating if username should be shown after display name or not + static bool sUseUsernames; +}; + +#endif diff --git a/indra/llmessage/llblowfishcipher.cpp b/indra/llmessage/llblowfishcipher.cpp index 88aaf7c52a..0b5025a422 100755 --- a/indra/llmessage/llblowfishcipher.cpp +++ b/indra/llmessage/llblowfishcipher.cpp @@ -70,10 +70,10 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) int blocksize = EVP_CIPHER_CTX_block_size(&context); int keylen = EVP_CIPHER_CTX_key_length(&context); int iv_length = EVP_CIPHER_CTX_iv_length(&context); - lldebugs << "LLBlowfishCipher blocksize " << blocksize + LL_DEBUGS() << "LLBlowfishCipher blocksize " << blocksize << " keylen " << keylen << " iv_len " << iv_length - << llendl; + << LL_ENDL; int output_len = 0; int temp_len = 0; @@ -83,7 +83,7 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) src, src_len)) { - llwarns << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << llendl; + LL_WARNS() << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << LL_ENDL; goto ERROR; } @@ -91,7 +91,7 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) // not an exact multiple of the block size. if (!EVP_EncryptFinal_ex(&context, (unsigned char*)(dst + output_len), &temp_len)) { - llwarns << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << llendl; + LL_WARNS() << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << LL_ENDL; goto ERROR; } output_len += temp_len; @@ -107,7 +107,7 @@ ERROR: // virtual U32 LLBlowfishCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) { - llerrs << "LLBlowfishCipher decrypt unsupported" << llendl; + LL_ERRS() << "LLBlowfishCipher decrypt unsupported" << LL_ENDL; return 0; } diff --git a/indra/llmessage/llbuffer.cpp b/indra/llmessage/llbuffer.cpp index aaa49d2ed6..d07d9980c3 100755 --- a/indra/llmessage/llbuffer.cpp +++ b/indra/llmessage/llbuffer.cpp @@ -32,8 +32,9 @@ #include "llmath.h" #include "llstl.h" #include "llthread.h" +#include <iterator> -#define ASSERT_LLBUFFERARRAY_MUTEX_LOCKED llassert(!mMutexp || mMutexp->isSelfLocked()); +#define ASSERT_LLBUFFERARRAY_MUTEX_LOCKED() llassert(!mMutexp || mMutexp->isSelfLocked()) /** * LLSegment @@ -180,8 +181,8 @@ bool LLHeapBuffer::reclaimSegment(const LLSegment& segment) } else if(mReclaimedBytes > mSize) { - llwarns << "LLHeapBuffer reclaimed more memory than allocated." - << " This is probably programmer error." << llendl; + LL_WARNS() << "LLHeapBuffer reclaimed more memory than allocated." + << " This is probably programmer error." << LL_ENDL; } return true; } @@ -286,7 +287,7 @@ LLChannelDescriptors LLBufferArray::nextChannel() //mMutexp should be locked before calling this. S32 LLBufferArray::capacity() const { - ASSERT_LLBUFFERARRAY_MUTEX_LOCKED + ASSERT_LLBUFFERARRAY_MUTEX_LOCKED(); S32 total = 0; const_buffer_iterator_t iter = mBuffers.begin(); @@ -314,7 +315,7 @@ bool LLBufferArray::append(S32 channel, const U8* src, S32 len) //mMutexp should be locked before calling this. bool LLBufferArray::prepend(S32 channel, const U8* src, S32 len) { - ASSERT_LLBUFFERARRAY_MUTEX_LOCKED + ASSERT_LLBUFFERARRAY_MUTEX_LOCKED(); std::vector<LLSegment> segments; if(copyIntoBuffers(channel, src, len, segments)) @@ -349,7 +350,7 @@ bool LLBufferArray::insertAfter( //mMutexp should be locked before calling this. LLBufferArray::segment_iterator_t LLBufferArray::splitAfter(U8* address) { - ASSERT_LLBUFFERARRAY_MUTEX_LOCKED + ASSERT_LLBUFFERARRAY_MUTEX_LOCKED(); segment_iterator_t end = mSegments.end(); segment_iterator_t it = getSegment(address); @@ -381,14 +382,14 @@ LLBufferArray::segment_iterator_t LLBufferArray::splitAfter(U8* address) //mMutexp should be locked before calling this. LLBufferArray::segment_iterator_t LLBufferArray::beginSegment() { - ASSERT_LLBUFFERARRAY_MUTEX_LOCKED + ASSERT_LLBUFFERARRAY_MUTEX_LOCKED(); return mSegments.begin(); } //mMutexp should be locked before calling this. LLBufferArray::segment_iterator_t LLBufferArray::endSegment() { - ASSERT_LLBUFFERARRAY_MUTEX_LOCKED + ASSERT_LLBUFFERARRAY_MUTEX_LOCKED(); return mSegments.end(); } @@ -397,7 +398,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::constructSegmentAfter( U8* address, LLSegment& segment) { - ASSERT_LLBUFFERARRAY_MUTEX_LOCKED + ASSERT_LLBUFFERARRAY_MUTEX_LOCKED(); segment_iterator_t rv = mSegments.begin(); segment_iterator_t end = mSegments.end(); if(!address) @@ -446,7 +447,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::constructSegmentAfter( //mMutexp should be locked before calling this. LLBufferArray::segment_iterator_t LLBufferArray::getSegment(U8* address) { - ASSERT_LLBUFFERARRAY_MUTEX_LOCKED + ASSERT_LLBUFFERARRAY_MUTEX_LOCKED(); segment_iterator_t end = mSegments.end(); if(!address) { @@ -468,7 +469,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::getSegment(U8* address) LLBufferArray::const_segment_iterator_t LLBufferArray::getSegment( U8* address) const { - ASSERT_LLBUFFERARRAY_MUTEX_LOCKED + ASSERT_LLBUFFERARRAY_MUTEX_LOCKED(); const_segment_iterator_t end = mSegments.end(); if(!address) { @@ -623,7 +624,7 @@ U8* LLBufferArray::seek( U8* start, S32 delta) const { - ASSERT_LLBUFFERARRAY_MUTEX_LOCKED + ASSERT_LLBUFFERARRAY_MUTEX_LOCKED(); const_segment_iterator_t it; const_segment_iterator_t end = mSegments.end(); U8* rv = start; @@ -791,7 +792,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::makeSegment( S32 channel, S32 len) { - ASSERT_LLBUFFERARRAY_MUTEX_LOCKED + ASSERT_LLBUFFERARRAY_MUTEX_LOCKED(); // start at the end of the buffers, because it is the most likely // to have free space. LLSegment segment; @@ -829,7 +830,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::makeSegment( //mMutexp should be locked before calling this. bool LLBufferArray::eraseSegment(const segment_iterator_t& erase_iter) { - ASSERT_LLBUFFERARRAY_MUTEX_LOCKED + ASSERT_LLBUFFERARRAY_MUTEX_LOCKED(); // Find out which buffer contains the segment, and if it is found, // ask it to reclaim the memory. @@ -861,7 +862,7 @@ bool LLBufferArray::copyIntoBuffers( S32 len, std::vector<LLSegment>& segments) { - ASSERT_LLBUFFERARRAY_MUTEX_LOCKED + ASSERT_LLBUFFERARRAY_MUTEX_LOCKED(); if(!src || !len) return false; S32 copied = 0; LLSegment segment; diff --git a/indra/llmessage/llbufferstream.cpp b/indra/llmessage/llbufferstream.cpp index a51a48edc3..ff1c9993cc 100755 --- a/indra/llmessage/llbufferstream.cpp +++ b/indra/llmessage/llbufferstream.cpp @@ -53,7 +53,7 @@ LLBufferStreamBuf::~LLBufferStreamBuf() // virtual int LLBufferStreamBuf::underflow() { - //lldebugs << "LLBufferStreamBuf::underflow()" << llendl; + //LL_DEBUGS() << "LLBufferStreamBuf::underflow()" << LL_ENDL; if(!mBuffer) { return EOF; diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 13d779ff83..4dd8d04656 100755 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -343,7 +343,7 @@ bool LLCacheName::importFile(std::istream& istr) ++count; } - llinfos << "LLCacheName loaded " << count << " agent names" << llendl; + LL_INFOS() << "LLCacheName loaded " << count << " agent names" << LL_ENDL; count = 0; LLSD groups = data[GROUPS]; @@ -364,7 +364,7 @@ bool LLCacheName::importFile(std::istream& istr) impl.mReverseCache[entry->mGroupName] = id; ++count; } - llinfos << "LLCacheName loaded " << count << " group names" << llendl; + LL_INFOS() << "LLCacheName loaded " << count << " group names" << LL_ENDL; return true; } @@ -440,7 +440,7 @@ void LLCacheName::localizeCacheName(std::string key, std::string value) if (key!="" && value!= "" ) sCacheName[key]=value; else - llwarns<< " Error localizing cache key " << key << " To "<< value<<llendl; + LL_WARNS()<< " Error localizing cache key " << key << " To "<< value<<LL_ENDL; } BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname) @@ -467,7 +467,7 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) // COUNTER-HACK to combat James' HACK in exportFile()... // this group name was loaded from a name cache that did not // bother to save the group name ==> we must ask for it - lldebugs << "LLCacheName queuing HACK group request: " << id << llendl; + LL_DEBUGS() << "LLCacheName queuing HACK group request: " << id << LL_ENDL; entry = NULL; } @@ -676,8 +676,8 @@ void LLCacheName::processPending() if(!impl.mUpstreamHost.isOk()) { - lldebugs << "LLCacheName::processPending() - bad upstream host." - << llendl; + LL_DEBUGS() << "LLCacheName::processPending() - bad upstream host." + << LL_ENDL; return; } @@ -724,33 +724,33 @@ void LLCacheName::dump() LLCacheNameEntry* entry = iter->second; if (entry->mIsGroup) { - llinfos + LL_INFOS() << iter->first << " = (group) " << entry->mGroupName << " @ " << entry->mCreateTime - << llendl; + << LL_ENDL; } else { - llinfos + LL_INFOS() << iter->first << " = " << buildFullName(entry->mFirstName, entry->mLastName) << " @ " << entry->mCreateTime - << llendl; + << LL_ENDL; } } } void LLCacheName::dumpStats() { - llinfos << "Queue sizes: " + LL_INFOS() << "Queue sizes: " << " Cache=" << impl.mCache.size() << " AskName=" << impl.mAskNameQueue.size() << " AskGroup=" << impl.mAskGroupQueue.size() << " Pending=" << impl.mPendingQueue.size() << " Reply=" << impl.mReplyQueue.size() // << " Observers=" << impl.mSignal.size() - << llendl; + << LL_ENDL; } void LLCacheName::clear() @@ -886,7 +886,7 @@ void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup) // level, hence having an upstream provider. if (!mUpstreamHost.isOk()) { - llwarns << "LLCacheName - got UUID name/group request, but no upstream provider!" << llendl; + LL_WARNS() << "LLCacheName - got UUID name/group request, but no upstream provider!" << LL_ENDL; return; } @@ -903,11 +903,11 @@ void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup) { if (isGroup != entry->mIsGroup) { - llwarns << "LLCacheName - Asked for " + LL_WARNS() << "LLCacheName - Asked for " << (isGroup ? "group" : "user") << " name, " << "but found " << (entry->mIsGroup ? "group" : "user") - << ": " << id << llendl; + << ": " << id << LL_ENDL; } else { diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp index 0c2d4b823d..5aaada63b1 100755 --- a/indra/llmessage/llcircuit.cpp +++ b/indra/llmessage/llcircuit.cpp @@ -60,12 +60,12 @@ const S32 PING_START_BLOCK = 3; // How many pings behind we have to be to consider ourself blocked. const S32 PING_RELEASE_BLOCK = 2; // How many pings behind we have to be to consider ourself unblocked. -const F32 TARGET_PERIOD_LENGTH = 5.f; // seconds -const F32 LL_DUPLICATE_SUPPRESSION_TIMEOUT = 60.f; //seconds - this can be long, as time-based cleanup is +const F32Seconds TARGET_PERIOD_LENGTH(5.f); +const F32Seconds LL_DUPLICATE_SUPPRESSION_TIMEOUT(60.f); //this can be long, as time-based cleanup is // only done when wrapping packetids, now... LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id, - const F32 circuit_heartbeat_interval, const F32 circuit_timeout) + const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout) : mHost (host), mWrapID(0), mPacketsOutID(0), @@ -84,7 +84,7 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id, mPingsInTransit(0), mLastPingID(0), mPingDelay(INITIAL_PING_VALUE_MSEC), - mPingDelayAveraged((F32)INITIAL_PING_VALUE_MSEC), + mPingDelayAveraged(INITIAL_PING_VALUE_MSEC), mUnackedPacketCount(0), mUnackedPacketBytes(0), mLastPacketInTime(0.0), @@ -110,13 +110,13 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id, { // Need to guarantee that this time is up to date, we may be creating a circuit even though we haven't been // running a message system loop. - F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(TRUE); + F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds(TRUE); F32 distribution_offset = ll_frand(); mPingTime = mt_sec; mLastPingSendTime = mt_sec + mHeartbeatInterval * distribution_offset; mLastPingReceivedTime = mt_sec; - mNextPingSendTime = mLastPingSendTime + 0.95*mHeartbeatInterval + ll_frand(0.1f*mHeartbeatInterval); + mNextPingSendTime = mLastPingSendTime + 0.95*mHeartbeatInterval + F32Seconds(ll_frand(0.1f*mHeartbeatInterval.value())); mPeriodTime = mt_sec; mLocalEndPointID.generate(); @@ -183,7 +183,7 @@ LLCircuitData::~LLCircuitData() std::ostream_iterator<TPACKETID> append(str, " "); str << "MSG: -> " << mHost << "\tABORTING RELIABLE:\t"; std::copy(doomed.begin(), doomed.end(), append); - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } } @@ -203,11 +203,11 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num) std::ostringstream str; str << "MSG: <- " << packetp->mHost << "\tRELIABLE ACKED:\t" << packetp->mPacketID; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } if (packetp->mCallback) { - if (packetp->mTimeout < 0.f) // negative timeout will always return timeout even for successful ack, for debugging + if (packetp->mTimeout < F32Seconds(0.f)) // negative timeout will always return timeout even for successful ack, for debugging { packetp->mCallback(packetp->mCallbackData,LL_ERR_TCP_TIMEOUT); } @@ -231,17 +231,17 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num) if (iter != mFinalRetryPackets.end()) { packetp = iter->second; - // llinfos << "Packet " << packet_num << " removed from the pending list" << llendl; + // LL_INFOS() << "Packet " << packet_num << " removed from the pending list" << LL_ENDL; if(gMessageSystem->mVerboseLog) { std::ostringstream str; str << "MSG: <- " << packetp->mHost << "\tRELIABLE ACKED:\t" << packetp->mPacketID; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } if (packetp->mCallback) { - if (packetp->mTimeout < 0.f) // negative timeout will always return timeout even for successful ack, for debugging + if (packetp->mTimeout < F32Seconds(0.f)) // negative timeout will always return timeout even for successful ack, for debugging { packetp->mCallback(packetp->mCallbackData,LL_ERR_TCP_TIMEOUT); } @@ -268,7 +268,7 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num) -S32 LLCircuitData::resendUnackedPackets(const F64 now) +S32 LLCircuitData::resendUnackedPackets(const F64Seconds now) { S32 resent_packets = 0; LLReliablePacket *packetp; @@ -320,8 +320,8 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now) if (mUnackedPacketBytes > 256000 && !(getPacketsOut() % 1024)) { // Warn if we've got a lot of resends waiting. - llwarns << mHost << " has " << mUnackedPacketBytes - << " bytes of reliable messages waiting" << llendl; + LL_WARNS() << mHost << " has " << mUnackedPacketBytes + << " bytes of reliable messages waiting" << LL_ENDL; } // Stop resending. There are less than 512000 unacked packets. break; @@ -341,7 +341,7 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now) std::ostringstream str; str << "MSG: -> " << packetp->mHost << "\tRESENDING RELIABLE:\t" << packetp->mPacketID; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } packetp->mBuffer[0] |= LL_RESENT_FLAG; // tag packet id as being a resend @@ -355,7 +355,7 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now) // The new method, retry time based on ping if (packetp->mPingBasedRetry) { - packetp->mExpirationTime = now + llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, (LL_RELIABLE_TIMEOUT_FACTOR * getPingDelayAveraged())); + packetp->mExpirationTime = now + llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, F32Seconds(LL_RELIABLE_TIMEOUT_FACTOR * getPingDelayAveraged())); } else { @@ -390,10 +390,10 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now) if (now > packetp->mExpirationTime) { // fail (too many retries) - //llinfos << "Packet " << packetp->mPacketID << " removed from the pending list: exceeded retry limit" << llendl; + //LL_INFOS() << "Packet " << packetp->mPacketID << " removed from the pending list: exceeded retry limit" << LL_ENDL; //if (packetp->mMessageName) //{ - // llinfos << "Packet name " << packetp->mMessageName << llendl; + // LL_INFOS() << "Packet name " << packetp->mMessageName << LL_ENDL; //} gMessageSystem->mFailedResendPackets++; @@ -402,7 +402,7 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now) std::ostringstream str; str << "MSG: -> " << packetp->mHost << "\tABORTING RELIABLE:\t" << packetp->mPacketID; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } if (packetp->mCallback) @@ -427,10 +427,11 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now) } -LLCircuit::LLCircuit(const F32 circuit_heartbeat_interval, const F32 circuit_timeout) : mLastCircuit(NULL), - mHeartbeatInterval(circuit_heartbeat_interval), mHeartbeatTimeout(circuit_timeout) -{ -} +LLCircuit::LLCircuit(const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout) +: mLastCircuit(NULL), + mHeartbeatInterval(circuit_heartbeat_interval), + mHeartbeatTimeout(circuit_timeout) +{} LLCircuit::~LLCircuit() { @@ -445,7 +446,7 @@ LLCircuit::~LLCircuit() LLCircuitData *LLCircuit::addCircuitData(const LLHost &host, TPACKETID in_id) { // This should really validate if one already exists - llinfos << "LLCircuit::addCircuitData for " << host << llendl; + LL_INFOS() << "LLCircuit::addCircuitData for " << host << LL_ENDL; LLCircuitData *tempp = new LLCircuitData(host, in_id, mHeartbeatInterval, mHeartbeatTimeout); mCircuitData.insert(circuit_data_map::value_type(host, tempp)); mPingSet.insert(tempp); @@ -456,7 +457,7 @@ LLCircuitData *LLCircuit::addCircuitData(const LLHost &host, TPACKETID in_id) void LLCircuit::removeCircuitData(const LLHost &host) { - llinfos << "LLCircuit::removeCircuitData for " << host << llendl; + LL_INFOS() << "LLCircuit::removeCircuitData for " << host << LL_ENDL; mLastCircuit = NULL; circuit_data_map::iterator it = mCircuitData.find(host); if(it != mCircuitData.end()) @@ -471,7 +472,7 @@ void LLCircuit::removeCircuitData(const LLHost &host) } else { - llwarns << "Couldn't find entry for next ping in ping set!" << llendl; + LL_WARNS() << "Couldn't find entry for next ping in ping set!" << LL_ENDL; } // Clean up from optimization maps @@ -521,17 +522,17 @@ void LLCircuitData::setAllowTimeout(BOOL allow) // Reset per-period counters if necessary. void LLCircuitData::checkPeriodTime() { - F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(); - F64 period_length = mt_sec - mPeriodTime; + F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds(); + F64Seconds period_length = mt_sec - mPeriodTime; if ( period_length > TARGET_PERIOD_LENGTH) { - F32 bps_in = (F32)(mBytesInThisPeriod * 8.f / period_length); + F32 bps_in = F32Bits(mBytesInThisPeriod).value() / period_length.value(); if (bps_in > mPeakBPSIn) { mPeakBPSIn = bps_in; } - F32 bps_out = (F32)(mBytesOutThisPeriod * 8.f / period_length); + F32 bps_out = F32Bits(mBytesOutThisPeriod).value() / period_length.value(); if (bps_out > mPeakBPSOut) { mPeakBPSOut = bps_out; @@ -539,23 +540,23 @@ void LLCircuitData::checkPeriodTime() mBytesInLastPeriod = mBytesInThisPeriod; mBytesOutLastPeriod = mBytesOutThisPeriod; - mBytesInThisPeriod = 0; - mBytesOutThisPeriod = 0; - mLastPeriodLength = (F32)period_length; + mBytesInThisPeriod = S32Bytes(0); + mBytesOutThisPeriod = S32Bytes(0); + mLastPeriodLength = period_length; mPeriodTime = mt_sec; } } -void LLCircuitData::addBytesIn(S32 bytes) +void LLCircuitData::addBytesIn(S32Bytes bytes) { mBytesIn += bytes; mBytesInThisPeriod += bytes; } -void LLCircuitData::addBytesOut(S32 bytes) +void LLCircuitData::addBytesOut(S32Bytes bytes) { mBytesOut += bytes; mBytesOutThisPeriod += bytes; @@ -584,7 +585,7 @@ void LLCircuitData::addReliablePacket(S32 mSocket, U8 *buf_ptr, S32 buf_len, LLR void LLCircuit::resendUnackedPackets(S32& unacked_list_length, S32& unacked_list_size) { - F64 now = LLMessageSystem::getMessageTimeSeconds(); + F64Seconds now = LLMessageSystem::getMessageTimeSeconds(); unacked_list_length = 0; unacked_list_size = 0; @@ -719,14 +720,14 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) { std::ostringstream str; str << "MSG: <- " << mHost << "\tRECOVERING LOST:\t" << id; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } - // llinfos << "removing potential lost: " << id << llendl; + // LL_INFOS() << "removing potential lost: " << id << LL_ENDL; mPotentialLostPackets.erase(id); } else if (!receive_resent) // don't freak out over out-of-order reliable resends { - U64 time = LLMessageSystem::getMessageTimeUsecs(); + U64Microseconds time = LLMessageSystem::getMessageTimeUsecs(); TPACKETID index = mPacketsInID; S32 gap_count = 0; if ((index < id) && ((id - index) < 16)) @@ -738,10 +739,10 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) std::ostringstream str; str << "MSG: <- " << mHost << "\tPACKET GAP:\t" << index; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } -// llinfos << "adding potential lost: " << index << llendl; +// LL_INFOS() << "adding potential lost: " << index << LL_ENDL; mPotentialLostPackets[index] = time; index++; index = index % LL_MAX_OUT_PACKET_ID; @@ -750,13 +751,13 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) } else { - llinfos << "packet_out_of_order - got packet " << id << " expecting " << index << " from " << mHost << llendl; + LL_INFOS() << "packet_out_of_order - got packet " << id << " expecting " << index << " from " << mHost << LL_ENDL; if(gMessageSystem->mVerboseLog) { std::ostringstream str; str << "MSG: <- " << mHost << "\tPACKET GAP:\t" << id << " expected " << index; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } } @@ -765,11 +766,11 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) if (gap_count > 128) { - llwarns << "Packet loss gap filler running amok!" << llendl; + LL_WARNS() << "Packet loss gap filler running amok!" << LL_ENDL; } else if (gap_count > 16) { - llwarns << "Sustaining large amounts of packet loss!" << llendl; + LL_WARNS() << "Sustaining large amounts of packet loss!" << LL_ENDL; } } @@ -780,7 +781,7 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys) { - F64 cur_time = LLMessageSystem::getMessageTimeSeconds(); + F64Seconds cur_time = LLMessageSystem::getMessageTimeSeconds(); S32 count = mPingSet.size(); S32 cur = 0; @@ -818,7 +819,7 @@ void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys) if (cdp->updateWatchDogTimers(msgsys)) { // Randomize our pings a bit by doing some up to 5% early or late - F64 dt = 0.95f*mHeartbeatInterval + ll_frand(0.1f*mHeartbeatInterval); + F64Seconds dt = 0.95f*mHeartbeatInterval + F32Seconds(ll_frand(0.1f*mHeartbeatInterval.value())); // Remove it, and reinsert it with the new next ping time. // Always remove before changing the sorting key. @@ -846,7 +847,7 @@ void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys) BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) { - F64 cur_time = LLMessageSystem::getMessageTimeSeconds(); + F64Seconds cur_time = LLMessageSystem::getMessageTimeSeconds(); mLastPingSendTime = cur_time; if (!checkCircuitTimeout()) @@ -889,8 +890,8 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) wrapped_final = TRUE; } - //llinfos << mHost << " - unacked count " << mUnackedPackets.size() << llendl; - //llinfos << mHost << " - final count " << mFinalRetryPackets.size() << llendl; + //LL_INFOS() << mHost << " - unacked count " << mUnackedPackets.size() << LL_ENDL; + //LL_INFOS() << mHost << " - final count " << mFinalRetryPackets.size() << LL_ENDL; if (wrapped != wrapped_final) { // One of the "unacked" or "final" lists hasn't wrapped. Whichever one @@ -900,12 +901,12 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) // Hasn't wrapped, so the one on the // unacked packet list is older packet_id = iter->first; - //llinfos << mHost << ": nowrapped unacked" << llendl; + //LL_INFOS() << mHost << ": nowrapped unacked" << LL_ENDL; } else { packet_id = iter_final->first; - //llinfos << mHost << ": nowrapped final" << llendl; + //LL_INFOS() << mHost << ": nowrapped final" << LL_ENDL; } } else @@ -917,7 +918,7 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) // Send the ID of the last packet we sent out. // This will flush all of the destination's // unacked packets, theoretically. - //llinfos << mHost << ": No unacked!" << llendl; + //LL_INFOS() << mHost << ": No unacked!" << LL_ENDL; packet_id = getPacketOutID(); } else @@ -928,7 +929,7 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) // Unacked list has the lowest so far packet_id = iter->first; had_unacked = TRUE; - //llinfos << mHost << ": Unacked" << llendl; + //LL_INFOS() << mHost << ": Unacked" << LL_ENDL; } if (iter_final != mFinalRetryPackets.end()) @@ -938,13 +939,13 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) { // Both had a packet, use the lowest. packet_id = llmin(packet_id, iter_final->first); - //llinfos << mHost << ": Min of unacked/final" << llendl; + //LL_INFOS() << mHost << ": Min of unacked/final" << LL_ENDL; } else { // Only the final had a packet, use it. packet_id = iter_final->first; - //llinfos << mHost << ": Final!" << llendl; + //LL_INFOS() << mHost << ": Final!" << LL_ENDL; } } } @@ -963,12 +964,12 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) // be considered lost LLCircuitData::packet_time_map::iterator it; - U64 timeout = (U64)(1000000.0*llmin(LL_MAX_LOST_TIMEOUT, getPingDelayAveraged() * LL_LOST_TIMEOUT_FACTOR)); + U64Microseconds timeout = llmin(LL_MAX_LOST_TIMEOUT, F32Seconds(getPingDelayAveraged()) * LL_LOST_TIMEOUT_FACTOR); - U64 mt_usec = LLMessageSystem::getMessageTimeUsecs(); + U64Microseconds mt_usec = LLMessageSystem::getMessageTimeUsecs(); for (it = mPotentialLostPackets.begin(); it != mPotentialLostPackets.end(); ) { - U64 delta_t_usec = mt_usec - (*it).second; + U64Microseconds delta_t_usec = mt_usec - (*it).second; if (delta_t_usec > timeout) { // let's call this one a loss! @@ -979,7 +980,7 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys) std::ostringstream str; str << "MSG: <- " << mHost << "\tLOST PACKET:\t" << (*it).first; - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } mPotentialLostPackets.erase(it++); } @@ -999,8 +1000,8 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id) // we want to KEEP all x where oldest_id <= x <= last incoming packet, and delete everything else. - //llinfos << mHost << ": clearing before oldest " << oldest_id << llendl; - //llinfos << "Recent list before: " << mRecentlyReceivedReliablePackets.size() << llendl; + //LL_INFOS() << mHost << ": clearing before oldest " << oldest_id << LL_ENDL; + //LL_INFOS() << "Recent list before: " << mRecentlyReceivedReliablePackets.size() << LL_ENDL; if (oldest_id < mHighestPacketID) { // Clean up everything with a packet ID less than oldest_id. @@ -1014,7 +1015,7 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id) // Do timeout checks on everything with an ID > mHighestPacketID. // This should be empty except for wrapping IDs. Thus, this should be // highly rare. - U64 mt_usec = LLMessageSystem::getMessageTimeUsecs(); + U64Microseconds mt_usec = LLMessageSystem::getMessageTimeUsecs(); packet_time_map::iterator pit; for(pit = mRecentlyReceivedReliablePackets.upper_bound(mHighestPacketID); @@ -1023,14 +1024,14 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id) // Validate that the packet ID seems far enough away if ((pit->first - mHighestPacketID) < 100) { - llwarns << "Probably incorrectly timing out non-wrapped packets!" << llendl; + LL_WARNS() << "Probably incorrectly timing out non-wrapped packets!" << LL_ENDL; } - U64 delta_t_usec = mt_usec - (*pit).second; - F64 delta_t_sec = delta_t_usec * SEC_PER_USEC; + U64Microseconds delta_t_usec = mt_usec - (*pit).second; + F64Seconds delta_t_sec = delta_t_usec; if (delta_t_sec > LL_DUPLICATE_SUPPRESSION_TIMEOUT) { // enough time has elapsed we're not likely to get a duplicate on this one - llinfos << "Clearing " << pit->first << " from recent list" << llendl; + LL_INFOS() << "Clearing " << pit->first << " from recent list" << LL_ENDL; mRecentlyReceivedReliablePackets.erase(pit++); } else @@ -1038,27 +1039,27 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id) ++pit; } } - //llinfos << "Recent list after: " << mRecentlyReceivedReliablePackets.size() << llendl; + //LL_INFOS() << "Recent list after: " << mRecentlyReceivedReliablePackets.size() << LL_ENDL; } BOOL LLCircuitData::checkCircuitTimeout() { - F64 time_since_last_ping = LLMessageSystem::getMessageTimeSeconds() - mLastPingReceivedTime; + F64Seconds time_since_last_ping = LLMessageSystem::getMessageTimeSeconds() - mLastPingReceivedTime; // Nota Bene: This needs to be turned off if you are debugging multiple simulators if (time_since_last_ping > mHeartbeatTimeout) { - llwarns << "LLCircuitData::checkCircuitTimeout for " << mHost << " last ping " << time_since_last_ping << " seconds ago." <<llendl; + LL_WARNS() << "LLCircuitData::checkCircuitTimeout for " << mHost << " last ping " << time_since_last_ping << " seconds ago." <<LL_ENDL; setAlive(FALSE); if (mTimeoutCallback) { - llwarns << "LLCircuitData::checkCircuitTimeout for " << mHost << " calling callback." << llendl; + LL_WARNS() << "LLCircuitData::checkCircuitTimeout for " << mHost << " calling callback." << LL_ENDL; mTimeoutCallback(mHost, mTimeoutUserData); } if (!isAlive()) { // The callback didn't try and resurrect the circuit. We should kill it. - llwarns << "LLCircuitData::checkCircuitTimeout for " << mHost << " still dead, dropping." << llendl; + LL_WARNS() << "LLCircuitData::checkCircuitTimeout for " << mHost << " still dead, dropping." << LL_ENDL; return FALSE; } } @@ -1121,7 +1122,7 @@ void LLCircuit::sendAcks() str << "MSG: -> " << cd->mHost << "\tPACKET ACKS:\t"; std::ostream_iterator<TPACKETID> append(str, " "); std::copy(cd->mAcks.begin(), cd->mAcks.end(), append); - llinfos << str.str() << llendl; + LL_INFOS() << str.str() << LL_ENDL; } // empty out the acks list @@ -1139,40 +1140,40 @@ std::ostream& operator<<(std::ostream& s, LLCircuitData& circuit) F32 age = circuit.mExistenceTimer.getElapsedTimeF32(); using namespace std; - s << "Circuit " << circuit.mHost << " "; - s << circuit.mRemoteID << " "; - s << (circuit.mbAlive ? "Alive" : "Not Alive") << " "; - s << (circuit.mbAllowTimeout ? "Timeout Allowed" : "Timeout Not Allowed"); - s << endl; - - s << " Packets Lost: " << circuit.mPacketsLost; - s << " Measured Ping: " << circuit.mPingDelay; - s << " Averaged Ping: " << circuit.mPingDelayAveraged; - s << endl; - - s << "Global In/Out " << S32(age) << " sec"; - s << " KBytes: " << circuit.mBytesIn / 1024 << "/" << circuit.mBytesOut / 1024; - s << " Kbps: "; - s << S32(circuit.mBytesIn * 8.f / circuit.mExistenceTimer.getElapsedTimeF32() / 1024.f); - s << "/"; - s << S32(circuit.mBytesOut * 8.f / circuit.mExistenceTimer.getElapsedTimeF32() / 1024.f); - s << " Packets: " << circuit.mPacketsIn << "/" << circuit.mPacketsOut; - s << endl; - - s << "Recent In/Out " << S32(circuit.mLastPeriodLength) << " sec"; - s << " KBytes: "; - s << circuit.mBytesInLastPeriod / 1024; - s << "/"; - s << circuit.mBytesOutLastPeriod / 1024; - s << " Kbps: "; - s << S32(circuit.mBytesInLastPeriod * 8.f / circuit.mLastPeriodLength / 1024.f); - s << "/"; - s << S32(circuit.mBytesOutLastPeriod * 8.f / circuit.mLastPeriodLength / 1024.f); - s << " Peak kbps: "; - s << S32(circuit.mPeakBPSIn / 1024.f); - s << "/"; - s << S32(circuit.mPeakBPSOut / 1024.f); - s << endl; + s << "Circuit " << circuit.mHost << " " + << circuit.mRemoteID << " " + << (circuit.mbAlive ? "Alive" : "Not Alive") << " " + << (circuit.mbAllowTimeout ? "Timeout Allowed" : "Timeout Not Allowed") + << endl; + + s << " Packets Lost: " << circuit.mPacketsLost + << " Measured Ping: " << circuit.mPingDelay + << " Averaged Ping: " << circuit.mPingDelayAveraged + << endl; + + s << "Global In/Out " << S32(age) << " sec" + << " KBytes: " << circuit.mBytesIn.valueInUnits<LLUnits::Kilobytes>() << "/" << circuit.mBytesOut.valueInUnits<LLUnits::Kilobytes>() + << " Kbps: " + << S32(circuit.mBytesIn.valueInUnits<LLUnits::Kilobits>() / circuit.mExistenceTimer.getElapsedTimeF32().value()) + << "/" + << S32(circuit.mBytesOut.valueInUnits<LLUnits::Kilobits>() / circuit.mExistenceTimer.getElapsedTimeF32().value()) + << " Packets: " << circuit.mPacketsIn << "/" << circuit.mPacketsOut + << endl; + + s << "Recent In/Out " << circuit.mLastPeriodLength + << " KBytes: " + << circuit.mBytesInLastPeriod.valueInUnits<LLUnits::Kilobytes>() + << "/" + << circuit.mBytesOutLastPeriod.valueInUnits<LLUnits::Kilobytes>() + << " Kbps: " + << (S32)(circuit.mBytesInLastPeriod.valueInUnits<LLUnits::Kilobits>() / circuit.mLastPeriodLength.value()) + << "/" + << (S32)(circuit.mBytesOutLastPeriod.valueInUnits<LLUnits::Kilobits>() / circuit.mLastPeriodLength.value()) + << " Peak kbps: " + << S32(circuit.mPeakBPSIn / 1024.f) + << "/" + << S32(circuit.mPeakBPSOut / 1024.f) + << endl; return s; } @@ -1188,7 +1189,7 @@ void LLCircuitData::dumpResendCountAndReset() { if (mCurrentResendCount) { - llinfos << "Circuit: " << mHost << " resent " << mCurrentResendCount << " packets" << llendl; + LL_INFOS() << "Circuit: " << mHost << " resent " << mCurrentResendCount << " packets" << LL_ENDL; mCurrentResendCount = 0; } } @@ -1256,11 +1257,11 @@ void LLCircuitData::setPacketInID(TPACKETID id) void LLCircuitData::pingTimerStop(const U8 ping_id) { - F64 mt_secs = LLMessageSystem::getMessageTimeSeconds(); + F64Seconds mt_secs = LLMessageSystem::getMessageTimeSeconds(); // Nota Bene: no averaging of ping times until we get a feel for how this works - F64 time = mt_secs - mPingTime; - if (time == 0.0) + F64Seconds time = mt_secs - mPingTime; + if (time == F32Seconds(0.0)) { // Ack, we got our ping response on the same frame! Sigh, let's get a real time otherwise // all of our ping calculations will be skewed. @@ -1276,7 +1277,7 @@ void LLCircuitData::pingTimerStop(const U8 ping_id) delta_ping += 256; } - U32 msec = (U32) ((delta_ping*mHeartbeatInterval + time) * 1000.f); + U32Milliseconds msec = delta_ping*mHeartbeatInterval + time; setPingDelay(msec); mPingsInTransit = delta_ping; @@ -1305,13 +1306,13 @@ U32 LLCircuitData::getPacketsIn() const } -S32 LLCircuitData::getBytesIn() const +S32Bytes LLCircuitData::getBytesIn() const { return mBytesIn; } -S32 LLCircuitData::getBytesOut() const +S32Bytes LLCircuitData::getBytesOut() const { return mBytesOut; } @@ -1353,41 +1354,41 @@ BOOL LLCircuitData::getAllowTimeout() const } -U32 LLCircuitData::getPingDelay() const +U32Milliseconds LLCircuitData::getPingDelay() const { return mPingDelay; } -F32 LLCircuitData::getPingInTransitTime() +F32Milliseconds LLCircuitData::getPingInTransitTime() { // This may be inaccurate in the case of a circuit that was "dead" and then revived, // but only until the first round trip ping is sent - djs - F32 time_since_ping_was_sent = 0; + F32Milliseconds time_since_ping_was_sent(0); if (mPingsInTransit) { - time_since_ping_was_sent = (F32)((mPingsInTransit*mHeartbeatInterval - 1) - + (LLMessageSystem::getMessageTimeSeconds() - mPingTime))*1000.f; + time_since_ping_was_sent = ((mPingsInTransit*mHeartbeatInterval - F32Seconds(1)) + + (LLMessageSystem::getMessageTimeSeconds() - mPingTime)); } return time_since_ping_was_sent; } -void LLCircuitData::setPingDelay(U32 ping) +void LLCircuitData::setPingDelay(U32Milliseconds ping) { mPingDelay = ping; - mPingDelayAveraged = llmax((F32)ping, getPingDelayAveraged()); + mPingDelayAveraged = llmax((F32Milliseconds)ping, getPingDelayAveraged()); mPingDelayAveraged = ((1.f - LL_AVERAGED_PING_ALPHA) * mPingDelayAveraged) - + (LL_AVERAGED_PING_ALPHA * (F32) ping); + + (LL_AVERAGED_PING_ALPHA * (F32Milliseconds) ping); mPingDelayAveraged = llclamp(mPingDelayAveraged, LL_AVERAGED_PING_MIN, LL_AVERAGED_PING_MAX); } -F32 LLCircuitData::getPingDelayAveraged() +F32Milliseconds LLCircuitData::getPingDelayAveraged() { return llmin(llmax(getPingInTransitTime(), mPingDelayAveraged), LL_AVERAGED_PING_MAX); } diff --git a/indra/llmessage/llcircuit.h b/indra/llmessage/llcircuit.h index 430d6358f7..5b109fc218 100755 --- a/indra/llmessage/llcircuit.h +++ b/indra/llmessage/llcircuit.h @@ -34,7 +34,6 @@ #include "llerror.h" #include "lltimer.h" -#include "timing.h" #include "net.h" #include "llhost.h" #include "llpacketack.h" @@ -45,12 +44,14 @@ // Constants // const F32 LL_AVERAGED_PING_ALPHA = 0.2f; // relaxation constant on ping running average -const F32 LL_AVERAGED_PING_MAX = 2000; // msec -const F32 LL_AVERAGED_PING_MIN = 100; // msec // IW: increased to avoid retransmits when a process is slow +const F32Milliseconds LL_AVERAGED_PING_MAX(2000); +const F32Milliseconds LL_AVERAGED_PING_MIN(100); // increased to avoid retransmits when a process is slow -const U32 INITIAL_PING_VALUE_MSEC = 1000; // initial value for the ping delay, or for ping delay for an unknown circuit +const U32Milliseconds INITIAL_PING_VALUE_MSEC(1000); // initial value for the ping delay, or for ping delay for an unknown circuit const TPACKETID LL_MAX_OUT_PACKET_ID = 0x01000000; +const int LL_ERR_CIRCUIT_GONE = -23017; +const int LL_ERR_TCP_TIMEOUT = -23016; // 0 - flags // [1,4] - packetid @@ -76,10 +77,10 @@ class LLCircuitData { public: LLCircuitData(const LLHost &host, TPACKETID in_id, - const F32 circuit_heartbeat_interval, const F32 circuit_timeout); + const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout); ~LLCircuitData(); - S32 resendUnackedPackets(const F64 now); + S32 resendUnackedPackets(const F64Seconds now); void clearDuplicateList(TPACKETID oldest_id); @@ -105,18 +106,18 @@ public: // mLocalEndPointID should only ever be setup in the LLCircuitData constructor const LLUUID& getLocalEndPointID() const { return mLocalEndPointID; } - U32 getPingDelay() const; + U32Milliseconds getPingDelay() const; S32 getPingsInTransit() const { return mPingsInTransit; } // ACCESSORS BOOL isAlive() const; BOOL isBlocked() const; BOOL getAllowTimeout() const; - F32 getPingDelayAveraged(); - F32 getPingInTransitTime(); + F32Milliseconds getPingDelayAveraged(); + F32Milliseconds getPingInTransitTime(); U32 getPacketsIn() const; - S32 getBytesIn() const; - S32 getBytesOut() const; + S32Bytes getBytesIn() const; + S32Bytes getBytesOut() const; U32 getPacketsOut() const; U32 getPacketsLost() const; TPACKETID getPacketOutID() const; @@ -124,10 +125,10 @@ public: F32 getAgeInSeconds() const; S32 getUnackedPacketCount() const { return mUnackedPacketCount; } S32 getUnackedPacketBytes() const { return mUnackedPacketBytes; } - F64 getNextPingSendTime() const { return mNextPingSendTime; } + F64Seconds getNextPingSendTime() const { return mNextPingSendTime; } U32 getLastPacketGap() const { return mLastPacketGap; } LLHost getHost() const { return mHost; } - F64 getLastPacketInTime() const { return mLastPacketInTime; } + F64Seconds getLastPacketInTime() const { return mLastPacketInTime; } LLThrottleGroup &getThrottleGroup() { return mThrottles; } @@ -163,11 +164,11 @@ protected: TPACKETID nextPacketOutID(); void setPacketInID(TPACKETID id); void checkPacketInID(TPACKETID id, BOOL receive_resent); - void setPingDelay(U32 ping); + void setPingDelay(U32Milliseconds ping); BOOL checkCircuitTimeout(); // Return FALSE if the circuit is dead and should be cleaned up - void addBytesIn(S32 bytes); - void addBytesOut(S32 bytes); + void addBytesIn(S32Bytes bytes); + void addBytesOut(S32Bytes bytes); U8 nextPingID() { mLastPingID++; return mLastPingID; } @@ -218,20 +219,20 @@ protected: BOOL mBlocked; // Blocked is true if the circuit is hosed, i.e. far behind on pings // Not sure what the difference between this and mLastPingSendTime is - F64 mPingTime; // Time at which a ping was sent. + F64Seconds mPingTime; // Time at which a ping was sent. - F64 mLastPingSendTime; // Time we last sent a ping - F64 mLastPingReceivedTime; // Time we last received a ping - F64 mNextPingSendTime; // Time to try and send the next ping - S32 mPingsInTransit; // Number of pings in transit - U8 mLastPingID; // ID of the last ping that we sent out + F64Seconds mLastPingSendTime; // Time we last sent a ping + F64Seconds mLastPingReceivedTime; // Time we last received a ping + F64Seconds mNextPingSendTime; // Time to try and send the next ping + S32 mPingsInTransit; // Number of pings in transit + U8 mLastPingID; // ID of the last ping that we sent out // Used for determining the resend time for reliable resends. - U32 mPingDelay; // raw ping delay - F32 mPingDelayAveraged; // averaged ping delay (fast attack/slow decay) + U32Milliseconds mPingDelay; // raw ping delay + F32Milliseconds mPingDelayAveraged; // averaged ping delay (fast attack/slow decay) - typedef std::map<TPACKETID, U64> packet_time_map; + typedef std::map<TPACKETID, U64Microseconds> packet_time_map; packet_time_map mPotentialLostPackets; packet_time_map mRecentlyReceivedReliablePackets; @@ -246,7 +247,7 @@ protected: S32 mUnackedPacketCount; S32 mUnackedPacketBytes; - F64 mLastPacketInTime; // Time of last packet arrival + F64Seconds mLastPacketInTime; // Time of last packet arrival LLUUID mLocalEndPointID; @@ -258,24 +259,24 @@ protected: U32 mPacketsOut; U32 mPacketsIn; S32 mPacketsLost; - S32 mBytesIn; - S32 mBytesOut; - - F32 mLastPeriodLength; // seconds - S32 mBytesInLastPeriod; - S32 mBytesOutLastPeriod; - S32 mBytesInThisPeriod; - S32 mBytesOutThisPeriod; + S32Bytes mBytesIn, + mBytesOut; + + F32Seconds mLastPeriodLength; + S32Bytes mBytesInLastPeriod; + S32Bytes mBytesOutLastPeriod; + S32Bytes mBytesInThisPeriod; + S32Bytes mBytesOutThisPeriod; F32 mPeakBPSIn; // bits per second, max of all period bps F32 mPeakBPSOut; // bits per second, max of all period bps - F64 mPeriodTime; + F64Seconds mPeriodTime; LLTimer mExistenceTimer; // initialized when circuit created, used to track bandwidth numbers S32 mCurrentResendCount; // Number of resent packets since last spam U32 mLastPacketGap; // Gap in sequence number of last packet. - const F32 mHeartbeatInterval; - const F32 mHeartbeatTimeout; + const F32Seconds mHeartbeatInterval; + const F32Seconds mHeartbeatTimeout; }; @@ -285,7 +286,7 @@ class LLCircuit { public: // CREATORS - LLCircuit(const F32 circuit_heartbeat_interval, const F32 circuit_timeout); + LLCircuit(const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout); ~LLCircuit(); // ACCESSORS @@ -340,7 +341,7 @@ protected: mutable LLCircuitData* mLastCircuit; private: - const F32 mHeartbeatInterval; - const F32 mHeartbeatTimeout; + const F32Seconds mHeartbeatInterval; + const F32Seconds mHeartbeatTimeout; }; #endif diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 9e68c68858..147940c983 100755 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -100,7 +100,7 @@ void check_curl_code(CURLcode code) { // linux appears to throw a curl error once per session for a bad initialization // at a pretty random time (when enabling cookies). - llinfos << "curl error detected: " << curl_easy_strerror(code) << llendl; + LL_INFOS() << "curl error detected: " << curl_easy_strerror(code) << LL_ENDL; } } @@ -110,7 +110,7 @@ void check_curl_multi_code(CURLMcode code) { // linux appears to throw a curl error once per session for a bad initialization // at a pretty random time (when enabling cookies). - llinfos << "curl multi error detected: " << curl_multi_strerror(code) << llendl; + LL_INFOS() << "curl multi error detected: " << curl_multi_strerror(code) << LL_ENDL; } } @@ -155,7 +155,7 @@ void LLCurl::Responder::errorWithContent( // virtual void LLCurl::Responder::error(U32 status, const std::string& reason) { - llinfos << mURL << " [" << status << "]: " << reason << llendl; + LL_INFOS() << mURL << " [" << status << "]: " << reason << LL_ENDL; } // virtual @@ -180,7 +180,7 @@ void LLCurl::Responder::completedRaw( const bool emit_errors = false; if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(content, istr, emit_errors)) { - llinfos << "Failed to deserialize LLSD. " << mURL << " [" << status << "]: " << reason << llendl; + LL_INFOS() << "Failed to deserialize LLSD. " << mURL << " [" << status << "]: " << reason << LL_ENDL; content["reason"] = reason; } @@ -248,7 +248,7 @@ void LLCurl::Easy::releaseEasyHandle(CURL* handle) if (!handle) { return ; //handle allocation failed. - //llerrs << "handle cannot be NULL!" << llendl; + //LL_ERRS() << "handle cannot be NULL!" << LL_ENDL; } LLMutexLock lock(sHandleMutexp) ; @@ -270,7 +270,7 @@ void LLCurl::Easy::releaseEasyHandle(CURL* handle) } else { - llerrs << "Invalid handle." << llendl; + LL_ERRS() << "Invalid handle." << LL_ENDL; } } @@ -289,7 +289,7 @@ LLCurl::Easy* LLCurl::Easy::getEasy() if (!easy->mCurlEasyHandle) { // this can happen if we have too many open files (fails in c-ares/ares_init.c) - llwarns << "allocEasyHandle() returned NULL! Easy handles: " << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << llendl; + LL_WARNS() << "allocEasyHandle() returned NULL! Easy handles: " << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << LL_ENDL; delete easy; return NULL; } @@ -555,7 +555,7 @@ LLCurl::Multi::Multi(F32 idle_time_out) mCurlMultiHandle = LLCurl::newMultiHandle(); if (!mCurlMultiHandle) { - llwarns << "curl_multi_init() returned NULL! Easy handles: " << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << llendl; + LL_WARNS() << "curl_multi_init() returned NULL! Easy handles: " << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << LL_ENDL; mCurlMultiHandle = LLCurl::newMultiHandle(); } @@ -830,8 +830,8 @@ S32 LLCurl::Multi::process() else { response = 499; - //*TODO: change to llwarns - llerrs << "cleaned up curl request completed!" << llendl; + //*TODO: change to LL_WARNS() + LL_ERRS() << "cleaned up curl request completed!" << LL_ENDL; } if (response >= 400) { @@ -876,7 +876,7 @@ bool LLCurl::Multi::addEasy(Easy* easy) check_curl_multi_code(mcode); //if (mcode != CURLM_OK) //{ - // llwarns << "Curl Error: " << curl_multi_strerror(mcode) << llendl; + // LL_WARNS() << "Curl Error: " << curl_multi_strerror(mcode) << LL_ENDL; // return false; //} return true; @@ -993,7 +993,7 @@ void LLCurlThread::addMulti(LLCurl::Multi* multi) if (!addRequest(req)) { - llwarns << "curl request added when the thread is quitted" << llendl; + LL_WARNS() << "curl request added when the thread is quitted" << LL_ENDL; } } @@ -1100,7 +1100,7 @@ bool LLCurlRequest::addEasy(LLCurl::Easy* easy) if (mProcessing) { - llerrs << "Posting to a LLCurlRequest instance from within a responder is not allowed (causes DNS timeouts)." << llendl; + LL_ERRS() << "Posting to a LLCurlRequest instance from within a responder is not allowed (causes DNS timeouts)." << LL_ENDL; } bool res = mActiveMulti->addEasy(easy); return res; @@ -1164,7 +1164,7 @@ bool LLCurlRequest::post(const std::string& url, easy->slist_append("Content-Type: application/llsd+xml"); easy->setHeaders(); - lldebugs << "POSTING: " << bytes << " bytes." << llendl; + LL_DEBUGS() << "POSTING: " << bytes << " bytes." << LL_ENDL; bool res = addEasy(easy); return res; } @@ -1192,7 +1192,7 @@ bool LLCurlRequest::post(const std::string& url, easy->slist_append("Content-Type: application/octet-stream"); easy->setHeaders(); - lldebugs << "POSTING: " << bytes << " bytes." << llendl; + LL_DEBUGS() << "POSTING: " << bytes << " bytes." << LL_ENDL; bool res = addEasy(easy); return res; } @@ -1573,7 +1573,7 @@ void LLCurlEasyRequest::sendRequest(const std::string& url) { llassert_always(!mRequestSent); mRequestSent = true; - lldebugs << url << llendl; + LL_DEBUGS() << url << LL_ENDL; if (isValid() && mEasy) { mEasy->setHeaders(); @@ -1781,7 +1781,7 @@ CURLM* LLCurl::newMultiHandle() if(sTotalHandles + 1 > sMaxHandles) { - llwarns << "no more handles available." << llendl ; + LL_WARNS() << "no more handles available." << LL_ENDL ; return NULL ; //failed } sTotalHandles++; @@ -1789,7 +1789,7 @@ CURLM* LLCurl::newMultiHandle() CURLM* ret = curl_multi_init() ; if(!ret) { - llwarns << "curl_multi_init failed." << llendl ; + LL_WARNS() << "curl_multi_init failed." << LL_ENDL ; } return ret ; @@ -1815,7 +1815,7 @@ CURL* LLCurl::newEasyHandle() if(sTotalHandles + 1 > sMaxHandles) { - llwarns << "no more handles available." << llendl ; + LL_WARNS() << "no more handles available." << LL_ENDL ; return NULL ; //failed } sTotalHandles++; @@ -1823,7 +1823,7 @@ CURL* LLCurl::newEasyHandle() CURL* ret = createStandardCurlHandle(); if(!ret) { - llwarns << "failed to create curl handle." << llendl ; + LL_WARNS() << "failed to create curl handle." << LL_ENDL ; } return ret ; @@ -1863,7 +1863,7 @@ CURL* LLCurl::createStandardCurlHandle() sCurlTemplateStandardHandle = curl_easy_init(); if (sCurlTemplateStandardHandle == NULL) { - llwarns << "curl error calling curl_easy_init()" << llendl; + LL_WARNS() << "curl error calling curl_easy_init()" << LL_ENDL; } else { diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h index 90b3f2815d..fc9761ff9f 100755 --- a/indra/llmessage/llcurl.h +++ b/indra/llmessage/llcurl.h @@ -41,7 +41,6 @@ #include "llbuffer.h" #include "lliopipe.h" #include "llsd.h" -#include "llthread.h" #include "llqueuedthread.h" #include "llframetimer.h" #include "llpointer.h" diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp index 3385d7c2e2..3510f93805 100755 --- a/indra/llmessage/lldatapacker.cpp +++ b/indra/llmessage/lldatapacker.cpp @@ -52,13 +52,13 @@ LLDataPacker::LLDataPacker() : mPassFlags(0), mWriteEnabled(FALSE) //virtual void LLDataPacker::reset() { - llerrs << "Using unimplemented datapacker reset!" << llendl; + LL_ERRS() << "Using unimplemented datapacker reset!" << LL_ENDL; } //virtual void LLDataPacker::dumpBufferToLog() { - llerrs << "dumpBufferToLog not implemented for this type!" << llendl; + LL_ERRS() << "dumpBufferToLog not implemented for this type!" << LL_ENDL; } BOOL LLDataPacker::packFixed(const F32 value, const char *name, @@ -108,7 +108,7 @@ BOOL LLDataPacker::packFixed(const F32 value, const char *name, } else { - llerrs << "Using fixed-point packing of " << total_bits << " bits, why?!" << llendl; + LL_ERRS() << "Using fixed-point packing of " << total_bits << " bits, why?!" << LL_ENDL; } return success; } @@ -117,7 +117,7 @@ BOOL LLDataPacker::unpackFixed(F32 &value, const char *name, const BOOL is_signed, const U32 int_bits, const U32 frac_bits) { //BOOL success = TRUE; - //llinfos << "unpackFixed:" << name << " int:" << int_bits << " frac:" << frac_bits << llendl; + //LL_INFOS() << "unpackFixed:" << name << " int:" << int_bits << " frac:" << frac_bits << LL_ENDL; BOOL ok = FALSE; S32 unsigned_bits = int_bits + frac_bits; S32 total_bits = unsigned_bits; @@ -158,10 +158,10 @@ BOOL LLDataPacker::unpackFixed(F32 &value, const char *name, else { fixed_val = 0; - llerrs << "Bad bit count: " << total_bits << llendl; + LL_ERRS() << "Bad bit count: " << total_bits << LL_ENDL; } - //llinfos << "Fixed_val:" << fixed_val << llendl; + //LL_INFOS() << "Fixed_val:" << fixed_val << LL_ENDL; fixed_val /= (F32)(1 << frac_bits); if (is_signed) @@ -169,7 +169,7 @@ BOOL LLDataPacker::unpackFixed(F32 &value, const char *name, fixed_val -= max_val; } value = fixed_val; - //llinfos << "Value: " << value << llendl; + //LL_INFOS() << "Value: " << value << LL_ENDL; return ok; } @@ -239,7 +239,7 @@ BOOL LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char } else { - llwarns << "LLDataPackerBinaryBuffer::unpackBinaryData would unpack invalid data, aborting!" << llendl; + LL_WARNS() << "LLDataPackerBinaryBuffer::unpackBinaryData would unpack invalid data, aborting!" << LL_ENDL; success = FALSE; } return success; @@ -550,7 +550,7 @@ const LLDataPackerBinaryBuffer& LLDataPackerBinaryBuffer::operator=(const LLData if (a.getBufferSize() > getBufferSize()) { // We've got problems, ack! - llerrs << "Trying to do an assignment with not enough room in the target." << llendl; + LL_ERRS() << "Trying to do an assignment with not enough room in the target." << LL_ENDL; } memcpy(mBufferp, a.mBufferp, a.getBufferSize()); /*Flawfinder: ignore*/ return *this; @@ -558,7 +558,7 @@ const LLDataPackerBinaryBuffer& LLDataPackerBinaryBuffer::operator=(const LLData void LLDataPackerBinaryBuffer::dumpBufferToLog() { - llwarns << "Binary Buffer Dump, size: " << mBufferSize << llendl; + LL_WARNS() << "Binary Buffer Dump, size: " << mBufferSize << LL_ENDL; char line_buffer[256]; /*Flawfinder: ignore*/ S32 i; S32 cur_line_pos = 0; @@ -571,13 +571,13 @@ void LLDataPackerBinaryBuffer::dumpBufferToLog() if (cur_line_pos >= 16) { cur_line_pos = 0; - llwarns << "Offset:" << std::hex << cur_line*16 << std::dec << " Data:" << line_buffer << llendl; + LL_WARNS() << "Offset:" << std::hex << cur_line*16 << std::dec << " Data:" << line_buffer << LL_ENDL; cur_line++; } } if (cur_line_pos) { - llwarns << "Offset:" << std::hex << cur_line*16 << std::dec << " Data:" << line_buffer << llendl; + LL_WARNS() << "Offset:" << std::hex << cur_line*16 << std::dec << " Data:" << line_buffer << LL_ENDL; } } @@ -608,7 +608,7 @@ BOOL LLDataPackerAsciiBuffer::packString(const std::string& value, const char *n { // *NOTE: I believe we need to mark a failure bit at this point. numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packString: string truncated: " << value << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packString: string truncated: " << value << LL_ENDL; } mCurBufferp += numCopied; return success; @@ -647,7 +647,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packBinaryData: number truncated: " << size << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryData: number truncated: " << size << LL_ENDL; } mCurBufferp += numCopied; @@ -660,7 +660,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packBinaryData: data truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryData: data truncated: " << LL_ENDL; bBufferFull = TRUE; } mCurBufferp += numCopied; @@ -672,7 +672,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packBinaryData: newline truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryData: newline truncated: " << LL_ENDL; } mCurBufferp += numCopied; } @@ -734,7 +734,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packBinaryDataFixed: data truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryDataFixed: data truncated: " << LL_ENDL; bBufferFull = TRUE; } mCurBufferp += numCopied; @@ -746,7 +746,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packBinaryDataFixed: newline truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryDataFixed: newline truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -813,7 +813,7 @@ BOOL LLDataPackerAsciiBuffer::packU8(const U8 value, const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packU8: val truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packU8: val truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -860,7 +860,7 @@ BOOL LLDataPackerAsciiBuffer::packU16(const U16 value, const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packU16: val truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packU16: val truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -907,7 +907,7 @@ BOOL LLDataPackerAsciiBuffer::packU32(const U32 value, const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packU32: val truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packU32: val truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -951,7 +951,7 @@ BOOL LLDataPackerAsciiBuffer::packS32(const S32 value, const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packS32: val truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packS32: val truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -995,7 +995,7 @@ BOOL LLDataPackerAsciiBuffer::packF32(const F32 value, const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packF32: val truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packF32: val truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1039,7 +1039,7 @@ BOOL LLDataPackerAsciiBuffer::packColor4(const LLColor4 &value, const char *name if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packColor4: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packColor4: truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1082,7 +1082,7 @@ BOOL LLDataPackerAsciiBuffer::packColor4U(const LLColor4U &value, const char *na if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packColor4U: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packColor4U: truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1132,7 +1132,7 @@ BOOL LLDataPackerAsciiBuffer::packVector2(const LLVector2 &value, const char *na if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packVector2: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packVector2: truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1176,7 +1176,7 @@ BOOL LLDataPackerAsciiBuffer::packVector3(const LLVector3 &value, const char *na if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packVector3: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packVector3: truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1219,7 +1219,7 @@ BOOL LLDataPackerAsciiBuffer::packVector4(const LLVector4 &value, const char *na if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packVector4: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packVector4: truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1266,7 +1266,7 @@ BOOL LLDataPackerAsciiBuffer::packUUID(const LLUUID &value, const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::packUUID: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::packUUID: truncated: " << LL_ENDL; success = FALSE; } mCurBufferp += numCopied; @@ -1292,7 +1292,7 @@ BOOL LLDataPackerAsciiBuffer::unpackUUID(LLUUID &value, const char *name) void LLDataPackerAsciiBuffer::dump() { - llinfos << "Buffer: " << mBufferp << llendl; + LL_INFOS() << "Buffer: " << mBufferp << LL_ENDL; } void LLDataPackerAsciiBuffer::writeIndentedName(const char *name) @@ -1318,7 +1318,7 @@ void LLDataPackerAsciiBuffer::writeIndentedName(const char *name) if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize()) { numCopied = getBufferSize()-getCurrentSize(); - llwarns << "LLDataPackerAsciiBuffer::writeIndentedName: truncated: " << llendl; + LL_WARNS() << "LLDataPackerAsciiBuffer::writeIndentedName: truncated: " << LL_ENDL; } mCurBufferp += numCopied; @@ -1347,7 +1347,7 @@ BOOL LLDataPackerAsciiBuffer::getValueStr(const char *name, char *out_value, S32 if (strcmp(keyword, name)) { - llwarns << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << llendl; + LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL; return FALSE; } } @@ -1904,7 +1904,7 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v fpos_t last_pos; if (0 != fgetpos(mFP, &last_pos)) // 0==success for fgetpos { - llwarns << "Data packer failed to fgetpos" << llendl; + LL_WARNS() << "Data packer failed to fgetpos" << LL_ENDL; return FALSE; } @@ -1917,13 +1917,13 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v if (!keyword[0]) { - llwarns << "Data packer could not get the keyword!" << llendl; + LL_WARNS() << "Data packer could not get the keyword!" << LL_ENDL; fsetpos(mFP, &last_pos); return FALSE; } if (strcmp(keyword, name)) { - llwarns << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << llendl; + LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL; fsetpos(mFP, &last_pos); return FALSE; } @@ -1941,12 +1941,12 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v sscanf(buffer, "%511s %511[^\n]", keyword, value); /* Flawfinder: ignore */ if (!keyword[0]) { - llwarns << "Data packer could not get the keyword!" << llendl; + LL_WARNS() << "Data packer could not get the keyword!" << LL_ENDL; return FALSE; } if (strcmp(keyword, name)) { - llwarns << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << llendl; + LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL; return FALSE; } diff --git a/indra/llmessage/lldatapacker.h b/indra/llmessage/lldatapacker.h index b0a638c16e..5140f56c01 100755 --- a/indra/llmessage/lldatapacker.h +++ b/indra/llmessage/lldatapacker.h @@ -170,6 +170,7 @@ public: S32 getBufferSize() const { return mBufferSize; } const U8* getBuffer() const { return mBufferp; } void reset() { mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != NULL); } + void shift(S32 offset) { reset(); mCurBufferp += offset;} void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = FALSE; } void assignBuffer(U8 *bufferp, S32 size) { @@ -199,8 +200,8 @@ inline BOOL LLDataPackerBinaryBuffer::verifyLength(const S32 data_size, const ch { if (mWriteEnabled && (mCurBufferp - mBufferp) > mBufferSize - data_size) { - llwarns << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << llendl; - llwarns << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << llendl; + LL_WARNS() << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << LL_ENDL; + LL_WARNS() << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << LL_ENDL; return FALSE; } @@ -320,8 +321,8 @@ inline BOOL LLDataPackerAsciiBuffer::verifyLength(const S32 data_size, const cha { if (mWriteEnabled && (mCurBufferp - mBufferp) > mBufferSize - data_size) { - llwarns << "Buffer overflow in AsciiBuffer length verify, field name " << name << "!" << llendl; - llwarns << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << llendl; + LL_WARNS() << "Buffer overflow in AsciiBuffer length verify, field name " << name << "!" << LL_ENDL; + LL_WARNS() << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << LL_ENDL; return FALSE; } diff --git a/indra/llmessage/lldispatcher.cpp b/indra/llmessage/lldispatcher.cpp index b2dc414a68..c40fe0d389 100755 --- a/indra/llmessage/lldispatcher.cpp +++ b/indra/llmessage/lldispatcher.cpp @@ -29,6 +29,7 @@ #include "lldispatcher.h" #include <algorithm> +#include <iterator> #include "llstl.h" #include "message.h" @@ -75,7 +76,7 @@ bool LLDispatcher::dispatch( LLDispatchHandler* func = (*it).second; return (*func)(this, name, invoice, strings); } - llwarns << "Unable to find handler for Generic message: " << name << llendl; + LL_WARNS() << "Unable to find handler for Generic message: " << name << LL_ENDL; return false; } diff --git a/indra/llmessage/llextendedstatus.h b/indra/llmessage/llextendedstatus.h new file mode 100755 index 0000000000..8ce173d1ff --- /dev/null +++ b/indra/llmessage/llextendedstatus.h @@ -0,0 +1,67 @@ +/** + * @file llextendedstatus.h + * @date August 2007 + * @brief extended status codes for curl/vfs/resident asset storage and delivery + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLEXTENDEDSTATUS_H +#define LL_LLEXTENDEDSTATUS_H + + +typedef S32 LLExtStat; + + +// Status provider groups - Top bits indicate which status type it is +// Zero is common status code (next section) +const LLExtStat LL_EXSTAT_CURL_RESULT = 1L<<30; // serviced by curl - use 1L if we really implement the below +const LLExtStat LL_EXSTAT_RES_RESULT = 2L<<30; // serviced by resident copy +const LLExtStat LL_EXSTAT_VFS_RESULT = 3L<<30; // serviced by vfs + + +// Common Status Codes +// +const LLExtStat LL_EXSTAT_NONE = 0x00000; // No extra info here - sorry! +const LLExtStat LL_EXSTAT_NULL_UUID = 0x10001; // null asset ID +const LLExtStat LL_EXSTAT_NO_UPSTREAM = 0x10002; // attempt to upload without a valid upstream method/provider +const LLExtStat LL_EXSTAT_REQUEST_DROPPED = 0x10003; // request was dropped unserviced +const LLExtStat LL_EXSTAT_NONEXISTENT_FILE = 0x10004; // trying to upload a file that doesn't exist +const LLExtStat LL_EXSTAT_BLOCKED_FILE = 0x10005; // trying to upload a file that we can't open + + +// curl status codes: +// +// Mask off LL_EXSTAT_CURL_RESULT for original result and +// see: libraries/include/curl/curl.h + + +// Memory-Resident status codes: +// None at present + + +// VFS status codes: +const LLExtStat LL_EXSTAT_VFS_CACHED = LL_EXSTAT_VFS_RESULT | 0x0001; +const LLExtStat LL_EXSTAT_VFS_CORRUPT = LL_EXSTAT_VFS_RESULT | 0x0002; + + +#endif // LL_LLEXTENDEDSTATUS_H diff --git a/indra/llmessage/llfiltersd2xmlrpc.cpp b/indra/llmessage/llfiltersd2xmlrpc.cpp index e0ca056a5f..d3e195789b 100755 --- a/indra/llmessage/llfiltersd2xmlrpc.cpp +++ b/indra/llmessage/llfiltersd2xmlrpc.cpp @@ -80,6 +80,7 @@ #include "llbuffer.h" #include "llbufferstream.h" +#include "llfasttimer.h" #include "llmemorystream.h" #include "llsd.h" #include "llsdserialize.h" @@ -163,12 +164,12 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) case LLSD::TypeMap: { #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(map) BEGIN" << llendl; + LL_INFOS() << "streamOut(map) BEGIN" << LL_ENDL; #endif ostr << "<struct>"; if(ostr.fail()) { - llinfos << "STREAM FAILURE writing struct" << llendl; + LL_INFOS() << "STREAM FAILURE writing struct" << LL_ENDL; } LLSD::map_const_iterator it = sd.beginMap(); LLSD::map_const_iterator end = sd.endMap(); @@ -179,21 +180,21 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) streamOut(ostr, (*it).second); if(ostr.fail()) { - llinfos << "STREAM FAILURE writing '" << (*it).first - << "' with sd type " << (*it).second.type() << llendl; + LL_INFOS() << "STREAM FAILURE writing '" << (*it).first + << "' with sd type " << (*it).second.type() << LL_ENDL; } ostr << "</member>"; } ostr << "</struct>"; #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(map) END" << llendl; + LL_INFOS() << "streamOut(map) END" << LL_ENDL; #endif break; } case LLSD::TypeArray: { #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(array) BEGIN" << llendl; + LL_INFOS() << "streamOut(array) BEGIN" << LL_ENDL; #endif ostr << "<array><data>"; LLSD::array_const_iterator it = sd.beginArray(); @@ -203,12 +204,12 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) streamOut(ostr, *it); if(ostr.fail()) { - llinfos << "STREAM FAILURE writing array element sd type " - << (*it).type() << llendl; + LL_INFOS() << "STREAM FAILURE writing array element sd type " + << (*it).type() << LL_ENDL; } } #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(array) END" << llendl; + LL_INFOS() << "streamOut(array) END" << LL_ENDL; #endif ostr << "</data></array>"; break; @@ -217,31 +218,31 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) // treat undefined as a bool with a false value. case LLSD::TypeBoolean: #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(bool)" << llendl; + LL_INFOS() << "streamOut(bool)" << LL_ENDL; #endif ostr << "<boolean>" << (sd.asBoolean() ? "1" : "0") << "</boolean>"; break; case LLSD::TypeInteger: #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(int)" << llendl; + LL_INFOS() << "streamOut(int)" << LL_ENDL; #endif ostr << "<i4>" << sd.asInteger() << "</i4>"; break; case LLSD::TypeReal: #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(real)" << llendl; + LL_INFOS() << "streamOut(real)" << LL_ENDL; #endif ostr << "<double>" << sd.asReal() << "</double>"; break; case LLSD::TypeString: #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(string)" << llendl; + LL_INFOS() << "streamOut(string)" << LL_ENDL; #endif ostr << "<string>" << xml_escape_string(sd.asString()) << "</string>"; break; case LLSD::TypeUUID: #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(uuid)" << llendl; + LL_INFOS() << "streamOut(uuid)" << LL_ENDL; #endif // serialize it as a string ostr << "<string>" << sd.asString() << "</string>"; @@ -249,7 +250,7 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) case LLSD::TypeURI: { #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(uri)" << llendl; + LL_INFOS() << "streamOut(uri)" << LL_ENDL; #endif // serialize it as a string ostr << "<string>" << xml_escape_string(sd.asString()) << "</string>"; @@ -258,7 +259,7 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) case LLSD::TypeBinary: { #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(binary)" << llendl; + LL_INFOS() << "streamOut(binary)" << LL_ENDL; #endif // this is pretty inefficient, but we'll deal with that // problem when it becomes one. @@ -281,15 +282,15 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) } case LLSD::TypeDate: #if LL_SPEW_STREAM_OUT_DEBUGGING - llinfos << "streamOut(date)" << llendl; + LL_INFOS() << "streamOut(date)" << LL_ENDL; #endif // no need to escape this since it will be alpha-numeric. ostr << "<dateTime.iso8601>" << sd.asString() << "</dateTime.iso8601>"; break; default: // unhandled type - llwarns << "Unhandled structured data type: " << sd.type() - << llendl; + LL_WARNS() << "Unhandled structured data type: " << sd.type() + << LL_ENDL; break; } ostr << "</value>"; @@ -308,7 +309,7 @@ LLFilterSD2XMLRPCResponse::~LLFilterSD2XMLRPCResponse() } -static LLFastTimer::DeclareTimer FTM_PROCESS_SD2XMLRPC_RESPONSE("SD2XMLRPC Response"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_SD2XMLRPC_RESPONSE("SD2XMLRPC Response"); // virtual LLIOPipe::EStatus LLFilterSD2XMLRPCResponse::process_impl( const LLChannelDescriptors& channels, @@ -317,7 +318,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCResponse::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_SD2XMLRPC_RESPONSE); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_SD2XMLRPC_RESPONSE); PUMP_DEBUG; // This pipe does not work if it does not have everyting. This @@ -360,7 +361,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCResponse::process_impl( } else { - llwarns << "Unable to determine the type of LLSD response." << llendl; + LL_WARNS() << "Unable to determine the type of LLSD response." << LL_ENDL; } PUMP_DEBUG; return rv; @@ -385,7 +386,7 @@ LLFilterSD2XMLRPCRequest::~LLFilterSD2XMLRPCRequest() { } -static LLFastTimer::DeclareTimer FTM_PROCESS_SD2XMLRPC_REQUEST("S22XMLRPC Request"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_SD2XMLRPC_REQUEST("S22XMLRPC Request"); // virtual LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl( @@ -395,14 +396,14 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_SD2XMLRPC_REQUEST); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_SD2XMLRPC_REQUEST); // This pipe does not work if it does not have everyting. This // could be addressed by making a stream parser for llsd which // handled partial information. PUMP_DEBUG; if(!eos) { - llinfos << "!eos" << llendl; + LL_INFOS() << "!eos" << LL_ENDL; return STATUS_BREAK; } @@ -412,7 +413,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl( LLSDSerialize::fromNotation(sd, stream, buffer->count(channels.in())); if(stream.fail()) { - llinfos << "STREAM FAILURE reading structure data." << llendl; + LL_INFOS() << "STREAM FAILURE reading structure data." << LL_ENDL; } PUMP_DEBUG; @@ -434,7 +435,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl( } if(method.empty()) { - llwarns << "SD -> XML Request no method found." << llendl; + LL_WARNS() << "SD -> XML Request no method found." << LL_ENDL; return STATUS_ERROR; } @@ -445,13 +446,13 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl( ostream.precision(DEFAULT_PRECISION); if(ostream.fail()) { - llinfos << "STREAM FAILURE setting precision" << llendl; + LL_INFOS() << "STREAM FAILURE setting precision" << LL_ENDL; } ostream << XML_HEADER << XMLRPC_REQUEST_HEADER_1 << xml_escape_string(method) << XMLRPC_REQUEST_HEADER_2; if(ostream.fail()) { - llinfos << "STREAM FAILURE writing method headers" << llendl; + LL_INFOS() << "STREAM FAILURE writing method headers" << LL_ENDL; } switch(param_sd.type()) { @@ -518,7 +519,7 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value) break; } case xmlrpc_type_boolean: - //lldebugs << "stream_out() bool" << llendl; + //LL_DEBUGS() << "stream_out() bool" << LL_ENDL; ostr << " " << (XMLRPC_GetValueBoolean(value) ? "true" : "false"); break; case xmlrpc_type_datetime: @@ -526,23 +527,23 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value) break; case xmlrpc_type_double: ostr << " r" << XMLRPC_GetValueDouble(value); - //lldebugs << "stream_out() double" << XMLRPC_GetValueDouble(value) - // << llendl; + //LL_DEBUGS() << "stream_out() double" << XMLRPC_GetValueDouble(value) + // << LL_ENDL; break; case xmlrpc_type_int: ostr << " i" << XMLRPC_GetValueInt(value); - //lldebugs << "stream_out() integer:" << XMLRPC_GetValueInt(value) - // << llendl; + //LL_DEBUGS() << "stream_out() integer:" << XMLRPC_GetValueInt(value) + // << LL_ENDL; break; case xmlrpc_type_string: - //lldebugs << "stream_out() string: " << str << llendl; + //LL_DEBUGS() << "stream_out() string: " << str << LL_ENDL; ostr << " s(" << XMLRPC_GetValueStringLen(value) << ")'" << XMLRPC_GetValueString(value) << "'"; break; case xmlrpc_type_array: // vector case xmlrpc_type_mixed: // vector { - //lldebugs << "stream_out() array" << llendl; + //LL_DEBUGS() << "stream_out() array" << LL_ENDL; ostr << " ["; U32 needs_comma = 0; XMLRPC_VALUE current = XMLRPC_VectorRewind(value); @@ -557,7 +558,7 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value) } case xmlrpc_type_struct: // still vector { - //lldebugs << "stream_out() struct" << llendl; + //LL_DEBUGS() << "stream_out() struct" << LL_ENDL; ostr << " {"; std::string name; U32 needs_comma = 0; @@ -577,7 +578,7 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value) case xmlrpc_type_none: default: status = LLIOPipe::STATUS_ERROR; - llwarns << "Found an empty xmlrpc type.." << llendl; + LL_WARNS() << "Found an empty xmlrpc type.." << LL_ENDL; // not much we can do here... break; }; @@ -592,7 +593,7 @@ LLFilterXMLRPCResponse2LLSD::~LLFilterXMLRPCResponse2LLSD() { } -static LLFastTimer::DeclareTimer FTM_PROCESS_XMLRPC2LLSD_RESPONSE("XMLRPC2LLSD Response"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_XMLRPC2LLSD_RESPONSE("XMLRPC2LLSD Response"); LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl( const LLChannelDescriptors& channels, @@ -601,7 +602,7 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_XMLRPC2LLSD_RESPONSE); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_XMLRPC2LLSD_RESPONSE); PUMP_DEBUG; if(!eos) return STATUS_BREAK; @@ -617,7 +618,7 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl( buf[bytes] = '\0'; buffer->readAfter(channels.in(), NULL, (U8*)buf, bytes); - //lldebugs << "xmlrpc response: " << buf << llendl; + //LL_DEBUGS() << "xmlrpc response: " << buf << LL_ENDL; PUMP_DEBUG; XMLRPC_REQUEST response = XMLRPC_REQUEST_FromXML( @@ -626,7 +627,7 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl( NULL); if(!response) { - llwarns << "XML -> SD Response unable to parse xml." << llendl; + LL_WARNS() << "XML -> SD Response unable to parse xml." << LL_ENDL; delete[] buf; return STATUS_ERROR; } @@ -678,7 +679,7 @@ LLFilterXMLRPCRequest2LLSD::~LLFilterXMLRPCRequest2LLSD() { } -static LLFastTimer::DeclareTimer FTM_PROCESS_XMLRPC2LLSD_REQUEST("XMLRPC2LLSD Request"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_XMLRPC2LLSD_REQUEST("XMLRPC2LLSD Request"); LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, @@ -686,7 +687,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_XMLRPC2LLSD_REQUEST); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_XMLRPC2LLSD_REQUEST); PUMP_DEBUG; if(!eos) return STATUS_BREAK; if(!buffer) return STATUS_ERROR; @@ -701,7 +702,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl( buf[bytes] = '\0'; buffer->readAfter(channels.in(), NULL, (U8*)buf, bytes); - //lldebugs << "xmlrpc request: " << buf << llendl; + //LL_DEBUGS() << "xmlrpc request: " << buf << LL_ENDL; // Check the value in the buffer. XMLRPC_REQUEST_FromXML will report a error code 4 if // values that are less than 0x20 are passed to it, except @@ -728,7 +729,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl( NULL); if(!request) { - llwarns << "XML -> SD Request process parse error." << llendl; + LL_WARNS() << "XML -> SD Request process parse error." << LL_ENDL; delete[] buf; return STATUS_ERROR; } diff --git a/indra/llmessage/llhost.cpp b/indra/llmessage/llhost.cpp index 61a84de8e3..63c15f0d5e 100755 --- a/indra/llmessage/llhost.cpp +++ b/indra/llmessage/llhost.cpp @@ -84,18 +84,18 @@ std::string LLHost::getHostName() const hostent* he; if (INVALID_HOST_IP_ADDRESS == mIP) { - llwarns << "LLHost::getHostName() : Invalid IP address" << llendl; + LL_WARNS() << "LLHost::getHostName() : Invalid IP address" << LL_ENDL; return std::string(); } he = gethostbyaddr((char *)&mIP, sizeof(mIP), AF_INET); if (!he) { #if LL_WINDOWS - llwarns << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: " - << WSAGetLastError() << llendl; + LL_WARNS() << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: " + << WSAGetLastError() << LL_ENDL; #else - llwarns << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: " - << h_errno << llendl; + LL_WARNS() << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: " + << h_errno << LL_ENDL; #endif return std::string(); } @@ -136,17 +136,17 @@ BOOL LLHost::setHostByName(const std::string& hostname) switch(error_number) { case TRY_AGAIN: // XXX how to handle this case? - llwarns << "LLHost::setAddress(): try again" << llendl; + LL_WARNS() << "LLHost::setAddress(): try again" << LL_ENDL; break; case HOST_NOT_FOUND: case NO_ADDRESS: // NO_DATA - llwarns << "LLHost::setAddress(): host not found" << llendl; + LL_WARNS() << "LLHost::setAddress(): host not found" << LL_ENDL; break; case NO_RECOVERY: - llwarns << "LLHost::setAddress(): unrecoverable error" << llendl; + LL_WARNS() << "LLHost::setAddress(): unrecoverable error" << LL_ENDL; break; default: - llwarns << "LLHost::setAddress(): unknown error - " << error_number << llendl; + LL_WARNS() << "LLHost::setAddress(): unknown error - " << error_number << LL_ENDL; break; } return FALSE; diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp index 7dcf160c9b..095da6f0f9 100755 --- a/indra/llmessage/llhttpassetstorage.cpp +++ b/indra/llmessage/llhttpassetstorage.cpp @@ -36,6 +36,7 @@ #include "llproxy.h" #include "llvfile.h" #include "llvfs.h" +#include "llxfer.h" #ifdef LL_STANDALONE # include <zlib.h> @@ -43,6 +44,8 @@ # include "zlib/zlib.h" #endif +const char* const LOCAL_ASSET_URL_FORMAT = "http://%s:12041/asset"; + const U32 MAX_RUNNING_REQUESTS = 1; const F32 MAX_PROCESSING_TIME = 0.005f; const S32 CURL_XFER_BUFFER_SIZE = 65536; @@ -273,7 +276,7 @@ void LLHTTPAssetRequest::setupCurlHandle() } else { - llerrs << "LLHTTPAssetRequest::setupCurlHandle - No asset storage associated with this request!" << llendl; + LL_ERRS() << "LLHTTPAssetRequest::setupCurlHandle - No asset storage associated with this request!" << LL_ENDL; } } @@ -287,7 +290,7 @@ void LLHTTPAssetRequest::cleanupCurlHandle() } else { - llerrs << "LLHTTPAssetRequest::~LLHTTPAssetRequest - No asset storage associated with this request!" << llendl; + LL_ERRS() << "LLHTTPAssetRequest::~LLHTTPAssetRequest - No asset storage associated with this request!" << LL_ENDL; } mCurlHandle = NULL; } @@ -309,7 +312,7 @@ void LLHTTPAssetRequest::prepareCompressedUpload() if (r != Z_OK) { - llerrs << "LLHTTPAssetRequest::prepareCompressedUpload defalateInit2() failed" << llendl; + LL_ERRS() << "LLHTTPAssetRequest::prepareCompressedUpload defalateInit2() failed" << LL_ENDL; } mZInitialized = true; @@ -324,10 +327,10 @@ void LLHTTPAssetRequest::finishCompressedUpload() { if (mZInitialized) { - llinfos << "LLHTTPAssetRequest::finishCompressedUpload: " + LL_INFOS() << "LLHTTPAssetRequest::finishCompressedUpload: " << "read " << mZStream.total_in << " byte asset file, " << "uploaded " << mZStream.total_out << " byte compressed asset" - << llendl; + << LL_ENDL; deflateEnd(&mZStream); delete[] mZInputBuffer; @@ -365,8 +368,8 @@ size_t LLHTTPAssetRequest::readCompressedData(void* data, size_t size) { if (r < 0) { - llwarns << "LLHTTPAssetRequest::readCompressedData: deflate returned error code " - << (S32) r << llendl; + LL_WARNS() << "LLHTTPAssetRequest::readCompressedData: deflate returned error code " + << (S32) r << LL_ENDL; } break; } @@ -453,7 +456,7 @@ void LLHTTPAssetStorage::storeAssetData( bool store_local, const LLUUID& requesting_agent_id, bool user_waiting, - F64 timeout) + F64Seconds timeout) { if (mVFS->getExists(uuid, type)) // VFS treats nonexistant and zero-length identically { @@ -493,7 +496,7 @@ void LLHTTPAssetStorage::storeAssetData( } else { - llwarns << "AssetStorage: attempt to upload non-existent vfile " << uuid << ":" << LLAssetType::lookup(type) << llendl; + LL_WARNS() << "AssetStorage: attempt to upload non-existent vfile " << uuid << ":" << LLAssetType::lookup(type) << LL_ENDL; if (callback) { // LLAssetStorage metric: Zero size VFS @@ -513,9 +516,9 @@ void LLHTTPAssetStorage::storeAssetData( bool temp_file, bool is_priority, bool user_waiting, - F64 timeout) + F64Seconds timeout) { - llinfos << "LLAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << llendl; + LL_INFOS() << "LLAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << LL_ENDL; LLLegacyAssetRequest *legacy = new LLLegacyAssetRequest; @@ -685,15 +688,15 @@ bool LLHTTPAssetStorage::deletePendingRequest(LLAssetStorage::ERequestType rt, } - llinfos << "Asset " << getRequestName(rt) << " request for " + LL_INFOS() << "Asset " << getRequestName(rt) << " request for " << asset_id << "." << LLAssetType::lookup(asset_type) << " removed from curl and placed at the end of the pending queue." - << llendl; + << LL_ENDL; } else { - llwarns << "Unable to find pending " << getRequestName(rt) << " request for " - << asset_id << "." << LLAssetType::lookup(asset_type) << llendl; + LL_WARNS() << "Unable to find pending " << getRequestName(rt) << " request for " + << asset_id << "." << LLAssetType::lookup(asset_type) << LL_ENDL; } } delete req; @@ -800,7 +803,7 @@ void LLHTTPAssetStorage::checkForTimeouts() } else { - llinfos << "Requesting " << new_req->mURLBuffer << llendl; + LL_INFOS() << "Requesting " << new_req->mURLBuffer << LL_ENDL; } } @@ -864,10 +867,10 @@ void LLHTTPAssetStorage::checkForTimeouts() // Get the uncompressed file size. LLVFile file(mVFS,new_req->getUUID(),new_req->getType()); S32 size = file.getSize(); - llinfos << "Requesting PUT " << new_req->mURLBuffer << ", asset size: " << size << " bytes" << llendl; + LL_INFOS() << "Requesting PUT " << new_req->mURLBuffer << ", asset size: " << size << " bytes" << LL_ENDL; if (size == 0) { - llwarns << "Rejecting zero size PUT request!" << llendl; + LL_WARNS() << "Rejecting zero size PUT request!" << LL_ENDL; new_req->cleanupCurlHandle(); deletePendingRequest(RT_UPLOAD, new_req->getType(), new_req->getUUID()); } @@ -913,12 +916,12 @@ void LLHTTPAssetStorage::checkForTimeouts() // Get the uncompressed file size. S32 size = file.getSize(); - llinfos << "TAT: LLHTTPAssetStorage::checkForTimeouts() : pending local!" - << " Requesting PUT " << new_req->mURLBuffer << ", asset size: " << size << " bytes" << llendl; + LL_INFOS() << "TAT: LLHTTPAssetStorage::checkForTimeouts() : pending local!" + << " Requesting PUT " << new_req->mURLBuffer << ", asset size: " << size << " bytes" << LL_ENDL; if (size == 0) { - llwarns << "Rejecting zero size PUT request!" << llendl; + LL_WARNS() << "Rejecting zero size PUT request!" << LL_ENDL; new_req->cleanupCurlHandle(); deletePendingRequest(RT_UPLOAD, new_req->getType(), new_req->getUUID()); } @@ -955,7 +958,7 @@ void LLHTTPAssetStorage::checkForTimeouts() || curl_result == HTTP_PUT_OK || curl_result == HTTP_NO_CONTENT)) { - llinfos << "Success uploading " << req->getUUID() << " to " << req->mURLBuffer << llendl; + LL_INFOS() << "Success uploading " << req->getUUID() << " to " << req->mURLBuffer << LL_ENDL; if (RT_LOCALUPLOAD == req->mRequestType) { addTempAssetData(req->getUUID(), req->mRequestingAgentID, mHostName); @@ -966,8 +969,8 @@ void LLHTTPAssetStorage::checkForTimeouts() curl_result == HTTP_SERVER_BAD_GATEWAY || curl_result == HTTP_SERVER_TEMP_UNAVAILABLE) { - llwarns << "Re-requesting upload for " << req->getUUID() << ". Received upload error to " << req->mURLBuffer << - " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << llendl; + LL_WARNS() << "Re-requesting upload for " << req->getUUID() << ". Received upload error to " << req->mURLBuffer << + " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << LL_ENDL; ////HACK (probably) I am sick of this getting requeued and driving me mad. //if (req->mIsUserWaiting) @@ -977,8 +980,8 @@ void LLHTTPAssetStorage::checkForTimeouts() } else { - llwarns << "Failure uploading " << req->getUUID() << " to " << req->mURLBuffer << - " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << llendl; + LL_WARNS() << "Failure uploading " << req->getUUID() << " to " << req->mURLBuffer << + " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << LL_ENDL; xfer_result = LL_ERR_ASSET_REQUEST_FAILED; } @@ -1000,7 +1003,7 @@ void LLHTTPAssetStorage::checkForTimeouts() { if (req->mVFile && req->mVFile->getSize() > 0) { - llinfos << "Success downloading " << req->mURLBuffer << ", size " << req->mVFile->getSize() << llendl; + LL_INFOS() << "Success downloading " << req->mURLBuffer << ", size " << req->mVFile->getSize() << LL_ENDL; req->mVFile->rename(req->getUUID(), req->getType()); } @@ -1008,15 +1011,15 @@ void LLHTTPAssetStorage::checkForTimeouts() { // *TODO: if this actually indicates a bad asset on the server // (not certain at this point), then delete it - llwarns << "Found " << req->mURLBuffer << " to be zero size" << llendl; + LL_WARNS() << "Found " << req->mURLBuffer << " to be zero size" << LL_ENDL; xfer_result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE; } } else { // KLW - TAT See if an avatar owns this texture, and if so request re-upload. - llwarns << "Failure downloading " << req->mURLBuffer << - " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << llendl; + LL_WARNS() << "Failure downloading " << req->mURLBuffer << + " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << LL_ENDL; xfer_result = (curl_result == HTTP_MISSING) ? LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE : LL_ERR_ASSET_REQUEST_FAILED; @@ -1061,7 +1064,7 @@ void LLHTTPAssetStorage::bumpTimedOutUploads() { bool user_waiting=FALSE; - F64 mt_secs = LLMessageSystem::getMessageTimeSeconds(); + F64Seconds mt_secs = LLMessageSystem::getMessageTimeSeconds(); if (mPendingUploads.size()) { @@ -1088,10 +1091,10 @@ void LLHTTPAssetStorage::bumpTimedOutUploads() if ( req->mTimeout < (mt_secs - req->mTime) ) { - llwarns << "Asset upload request timed out for " + LL_WARNS() << "Asset upload request timed out for " << req->getUUID() << "." << LLAssetType::lookup(req->getType()) - << ", bumping to the back of the line!" << llendl; + << ", bumping to the back of the line!" << LL_ENDL; deletePendingRequest(RT_UPLOAD, req->getType(), req->getUUID()); } @@ -1103,7 +1106,7 @@ size_t LLHTTPAssetStorage::curlDownCallback(void *data, size_t size, size_t nmem { if (!gAssetStorage) { - llwarns << "Missing gAssetStorage, aborting curl download callback!" << llendl; + LL_WARNS() << "Missing gAssetStorage, aborting curl download callback!" << LL_ENDL; return 0; } S32 bytes = (S32)(size * nmemb); @@ -1133,7 +1136,7 @@ size_t LLHTTPAssetStorage::curlUpCallback(void *data, size_t size, size_t nmemb, { if (!gAssetStorage) { - llwarns << "Missing gAssetStorage, aborting curl download callback!" << llendl; + LL_WARNS() << "Missing gAssetStorage, aborting curl download callback!" << LL_ENDL; return 0; } CURL *curl_handle = (CURL *)user_data; @@ -1168,12 +1171,12 @@ S32 LLHTTPAssetStorage::getURLToFile(const LLUUID& uuid, LLAssetType::EType asse { // *NOTE: There is no guarantee that the uuid and the asset_type match // - not that it matters. - Doug - lldebugs << "LLHTTPAssetStorage::getURLToFile() - " << url << llendl; + LL_DEBUGS() << "LLHTTPAssetStorage::getURLToFile() - " << url << LL_ENDL; FILE *fp = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/ if (! fp) { - llwarns << "Failed to open " << filename << " for writing" << llendl; + LL_WARNS() << "Failed to open " << filename << " for writing" << LL_ENDL; return LL_ERR_ASSET_REQUEST_FAILED; } @@ -1187,7 +1190,7 @@ S32 LLHTTPAssetStorage::getURLToFile(const LLUUID& uuid, LLAssetType::EType asse curl_easy_setopt(req.mCurlHandle, CURLOPT_WRITEDATA, req.mCurlHandle); curl_multi_add_handle(mCurlMultiHandle, req.mCurlHandle); - llinfos << "Requesting as file " << req.mURLBuffer << llendl; + LL_INFOS() << "Requesting as file " << req.mURLBuffer << LL_ENDL; // braindead curl loop int queue_length; @@ -1212,7 +1215,7 @@ S32 LLHTTPAssetStorage::getURLToFile(const LLUUID& uuid, LLAssetType::EType asse } else if (timeout.hasExpired()) { - llwarns << "Request for " << url << " has timed out." << llendl; + LL_WARNS() << "Request for " << url << " has timed out." << LL_ENDL; success = false; xfer_result = LL_ERR_ASSET_REQUEST_FAILED; break; @@ -1230,19 +1233,19 @@ S32 LLHTTPAssetStorage::getURLToFile(const LLUUID& uuid, LLAssetType::EType asse if (size > 0) { // everything seems to be in order - llinfos << "Success downloading " << req.mURLBuffer << " to file, size " << size << llendl; + LL_INFOS() << "Success downloading " << req.mURLBuffer << " to file, size " << size << LL_ENDL; } else { - llwarns << "Found " << req.mURLBuffer << " to be zero size" << llendl; + LL_WARNS() << "Found " << req.mURLBuffer << " to be zero size" << LL_ENDL; xfer_result = LL_ERR_ASSET_REQUEST_FAILED; } } else { xfer_result = curl_result == HTTP_MISSING ? LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE : LL_ERR_ASSET_REQUEST_FAILED; - llinfos << "Failure downloading " << req.mURLBuffer << - " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << llendl; + LL_INFOS() << "Failure downloading " << req.mURLBuffer << + " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << LL_ENDL; } } @@ -1264,7 +1267,7 @@ size_t LLHTTPAssetStorage::curlFileDownCallback(void *data, size_t size, size_t if (! req->mFP) { - llwarns << "Missing mFP, aborting curl file download callback!" << llendl; + LL_WARNS() << "Missing mFP, aborting curl file download callback!" << LL_ENDL; return 0; } @@ -1311,7 +1314,7 @@ void LLHTTPAssetStorage::addRunningRequest(ERequestType rt, LLHTTPAssetRequest* } else { - llerrs << "LLHTTPAssetStorage::addRunningRequest - Request is not an upload OR download, this is bad!" << llendl; + LL_ERRS() << "LLHTTPAssetStorage::addRunningRequest - Request is not an upload OR download, this is bad!" << LL_ENDL; } } @@ -1324,7 +1327,7 @@ void LLHTTPAssetStorage::removeRunningRequest(ERequestType rt, LLHTTPAssetReques } else { - llerrs << "LLHTTPAssetStorage::removeRunningRequest - Destroyed request is not an upload OR download, this is bad!" << llendl; + LL_ERRS() << "LLHTTPAssetStorage::removeRunningRequest - Destroyed request is not an upload OR download, this is bad!" << LL_ENDL; } } @@ -1333,7 +1336,7 @@ void LLHTTPAssetStorage::addTempAssetData(const LLUUID& asset_id, const LLUUID& { if (agent_id.isNull() || asset_id.isNull()) { - llwarns << "TAT: addTempAssetData bad id's asset_id: " << asset_id << " agent_id: " << agent_id << llendl; + LL_WARNS() << "TAT: addTempAssetData bad id's asset_id: " << asset_id << " agent_id: " << agent_id << LL_ENDL; return; } @@ -1434,26 +1437,26 @@ void LLHTTPAssetStorage::dumpTempAssetData(const LLUUID& avatar_id) const if (avatar_id.isNull() || avatar_id == temp_asset_data.mAgentID) { - llinfos << "TAT: dump agent " << temp_asset_data.mAgentID + LL_INFOS() << "TAT: dump agent " << temp_asset_data.mAgentID << " texture " << temp_asset_data.mAssetID << " host " << temp_asset_data.mHostName - << llendl; + << LL_ENDL; count++; } } if (avatar_id.isNull()) { - llinfos << "TAT: dumped " << count << " entries for all avatars" << llendl; + LL_INFOS() << "TAT: dumped " << count << " entries for all avatars" << LL_ENDL; } else { - llinfos << "TAT: dumped " << count << " entries for avatar " << avatar_id << llendl; + LL_INFOS() << "TAT: dumped " << count << " entries for avatar " << avatar_id << LL_ENDL; } } void LLHTTPAssetStorage::clearTempAssetData() { - llinfos << "TAT: Clearing temp asset data map" << llendl; + LL_INFOS() << "TAT: Clearing temp asset data map" << LL_ENDL; mTempAssets.clear(); } diff --git a/indra/llmessage/llhttpassetstorage.h b/indra/llmessage/llhttpassetstorage.h index f743ccf0ac..783e95cac6 100755 --- a/indra/llmessage/llhttpassetstorage.h +++ b/indra/llmessage/llhttpassetstorage.h @@ -69,7 +69,7 @@ public: bool store_local = false, const LLUUID& requesting_agent_id = LLUUID::null, bool user_waiting=FALSE, - F64 timeout=LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT); virtual void storeAssetData( const std::string& filename, @@ -80,7 +80,7 @@ public: bool temp_file, bool is_priority, bool user_waiting=FALSE, - F64 timeout=LL_ASSET_STORAGE_TIMEOUT); + F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT); virtual LLSD getPendingDetails(ERequestType rt, LLAssetType::EType asset_type, diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 11648717ad..31a499b370 100755 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -247,8 +247,8 @@ static void request( req->setSSLVerifyCallback(LLHTTPClient::getCertVerifyCallback(), (void *)req); - lldebugs << LLURLRequest::actionAsVerb(method) << " " << url << " " - << headers << llendl; + LL_DEBUGS() << LLURLRequest::actionAsVerb(method) << " " << url << " " + << headers << LL_ENDL; // Insert custom headers if the caller sent any if (headers.isMap()) @@ -275,7 +275,7 @@ static void request( req->useProxy(false); } header << iter->first << ": " << iter->second.asString() ; - lldebugs << "header = " << header.str() << llendl; + LL_DEBUGS() << "header = " << header.str() << LL_ENDL; req->addHeader(header.str().c_str()); } } @@ -443,7 +443,7 @@ static LLSD blocking_request( const F32 timeout = 5 ) { - lldebugs << "blockingRequest of " << url << llendl; + LL_DEBUGS() << "blockingRequest of " << url << LL_ENDL; char curl_error_buffer[CURL_ERROR_SIZE] = "\0"; CURL* curlp = LLCurl::newEasyHandle(); llassert_always(curlp != NULL) ; @@ -474,7 +474,7 @@ static LLSD blocking_request( { std::ostringstream header; header << iter->first << ": " << iter->second.asString() ; - lldebugs << "header = " << header.str() << llendl; + LL_DEBUGS() << "header = " << header.str() << LL_ENDL; headers_list = curl_slist_append(headers_list, header.str().c_str()); } } @@ -503,12 +503,12 @@ static LLSD blocking_request( } // * Do the action using curl, handle results - lldebugs << "HTTP body: " << body_str << llendl; + LL_DEBUGS() << "HTTP body: " << body_str << LL_ENDL; headers_list = curl_slist_append(headers_list, "Accept: application/llsd+xml"); CURLcode curl_result = curl_easy_setopt(curlp, CURLOPT_HTTPHEADER, headers_list); if ( curl_result != CURLE_OK ) { - llinfos << "Curl is hosed - can't add headers" << llendl; + LL_INFOS() << "Curl is hosed - can't add headers" << LL_ENDL; } LLSD response = LLSD::emptyMap(); @@ -520,19 +520,19 @@ static LLSD blocking_request( if ( http_status != 404 && (http_status != 200 || curl_success != 0) ) { // We expect 404s, don't spam for them. - llwarns << "CURL REQ URL: " << url << llendl; - llwarns << "CURL REQ METHOD TYPE: " << method << llendl; - llwarns << "CURL REQ HEADERS: " << headers.asString() << llendl; - llwarns << "CURL REQ BODY: " << body_str << llendl; - llwarns << "CURL HTTP_STATUS: " << http_status << llendl; - llwarns << "CURL ERROR: " << curl_error_buffer << llendl; - llwarns << "CURL ERROR BODY: " << http_buffer.asString() << llendl; + LL_WARNS() << "CURL REQ URL: " << url << LL_ENDL; + LL_WARNS() << "CURL REQ METHOD TYPE: " << method << LL_ENDL; + LL_WARNS() << "CURL REQ HEADERS: " << headers.asString() << LL_ENDL; + LL_WARNS() << "CURL REQ BODY: " << body_str << LL_ENDL; + LL_WARNS() << "CURL HTTP_STATUS: " << http_status << LL_ENDL; + LL_WARNS() << "CURL ERROR: " << curl_error_buffer << LL_ENDL; + LL_WARNS() << "CURL ERROR BODY: " << http_buffer.asString() << LL_ENDL; response["body"] = http_buffer.asString(); } else { response["body"] = http_buffer.asLLSD(); - lldebugs << "CURL response: " << http_buffer.asString() << llendl; + LL_DEBUGS() << "CURL response: " << http_buffer.asString() << LL_ENDL; } if(headers_list) diff --git a/indra/llmessage/llhttpnode.cpp b/indra/llmessage/llhttpnode.cpp index f6ccb5bdda..f1f4a95005 100755 --- a/indra/llmessage/llhttpnode.cpp +++ b/indra/llmessage/llhttpnode.cpp @@ -172,7 +172,7 @@ LLSD LLHTTPNode::simpleDel(const LLSD&) const // virtual void LLHTTPNode::options(ResponsePtr response, const LLSD& context) const { - //llinfos << "options context: " << context << llendl; + //LL_INFOS() << "options context: " << context << LL_ENDL; // default implementation constructs an url to the documentation. std::string host( @@ -238,10 +238,10 @@ const LLHTTPNode* LLHTTPNode::traverse( LLHTTPNode* child = node->getChild(*iter, context); if(!child) { - lldebugs << "LLHTTPNode::traverse: Couldn't find '" << *iter << "'" << llendl; + LL_DEBUGS() << "LLHTTPNode::traverse: Couldn't find '" << *iter << "'" << LL_ENDL; break; } - lldebugs << "LLHTTPNode::traverse: Found '" << *iter << "'" << llendl; + LL_DEBUGS() << "LLHTTPNode::traverse: Found '" << *iter << "'" << LL_ENDL; node = child; } @@ -275,8 +275,8 @@ void LLHTTPNode::addNode(const std::string& path, LLHTTPNode* nodeToAdd) if (iter == end) { - llwarns << "LLHTTPNode::addNode: already a node that handles " - << path << llendl; + LL_WARNS() << "LLHTTPNode::addNode: already a node that handles " + << path << LL_ENDL; return; } diff --git a/indra/llmessage/llhttpsender.cpp b/indra/llmessage/llhttpsender.cpp index d0bd343db6..5363088d79 100755 --- a/indra/llmessage/llhttpsender.cpp +++ b/indra/llmessage/llhttpsender.cpp @@ -54,14 +54,14 @@ void LLHTTPSender::send(const LLHost& host, const std::string& name, // Default implementation inserts sender, message and sends HTTP POST std::ostringstream stream; stream << "http://" << host << "/trusted-message/" << name; - llinfos << "LLHTTPSender::send: POST to " << stream.str() << llendl; + LL_INFOS() << "LLHTTPSender::send: POST to " << stream.str() << LL_ENDL; LLHTTPClient::post(stream.str(), body, response); } //static void LLHTTPSender::setSender(const LLHost& host, LLHTTPSender* sender) { - llinfos << "LLHTTPSender::setSender " << host << llendl; + LL_INFOS() << "LLHTTPSender::setSender " << host << LL_ENDL; senderMap[host] = sender; } diff --git a/indra/llmessage/llinstantmessage.cpp b/indra/llmessage/llinstantmessage.cpp index b0275c161b..b7f3e6e4f7 100755 --- a/indra/llmessage/llinstantmessage.cpp +++ b/indra/llmessage/llinstantmessage.cpp @@ -111,7 +111,7 @@ LLIMInfo::~LLIMInfo() void LLIMInfo::packInstantMessage(LLMessageSystem* msg) const { - lldebugs << "LLIMInfo::packInstantMessage()" << llendl; + LL_DEBUGS() << "LLIMInfo::packInstantMessage()" << LL_ENDL; msg->newMessageFast(_PREHASH_ImprovedInstantMessage); packMessageBlock(msg); } @@ -161,7 +161,7 @@ void pack_instant_message( const U8* binary_bucket, S32 binary_bucket_size) { - lldebugs << "pack_instant_message()" << llendl; + LL_DEBUGS() << "pack_instant_message()" << LL_ENDL; msg->newMessageFast(_PREHASH_ImprovedInstantMessage); pack_instant_message_block( msg, @@ -228,7 +228,7 @@ void pack_instant_message_block( if (num_written < 0 || num_written >= MTUBYTES) { num_written = MTUBYTES - 1; - llwarns << "pack_instant_message_block: message truncated: " << message << llendl; + LL_WARNS() << "pack_instant_message_block: message truncated: " << message << LL_ENDL; } bytes_left -= num_written; diff --git a/indra/llmessage/lliobuffer.cpp b/indra/llmessage/lliobuffer.cpp index ed00e230ac..bbd7b8777d 100755 --- a/indra/llmessage/lliobuffer.cpp +++ b/indra/llmessage/lliobuffer.cpp @@ -109,6 +109,6 @@ LLIOPipe::EStatus LLIOBuffer::process_impl( LLPumpIO* pump) { // no-op (I think) - llwarns << "You are using an LLIOBuffer which is deprecated." << llendl; + LL_WARNS() << "You are using an LLIOBuffer which is deprecated." << LL_ENDL; return STATUS_OK; } diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp index 1236fc8b71..23813c6edb 100755 --- a/indra/llmessage/lliohttpserver.cpp +++ b/indra/llmessage/lliohttpserver.cpp @@ -33,6 +33,7 @@ #include "llapr.h" #include "llbuffer.h" #include "llbufferstream.h" +#include "llfasttimer.h" #include "llhttpnode.h" #include "lliopipe.h" #include "lliosocket.h" @@ -138,11 +139,11 @@ private: LLSD mHeaders; }; -static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_PIPE("HTTP Pipe"); -static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_GET("HTTP Get"); -static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_PUT("HTTP Put"); -static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_POST("HTTP Post"); -static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_DELETE("HTTP Delete"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_PIPE("HTTP Pipe"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_GET("HTTP Get"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_PUT("HTTP Put"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_POST("HTTP Post"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_DELETE("HTTP Delete"); LLIOPipe::EStatus LLHTTPPipe::process_impl( const LLChannelDescriptors& channels, @@ -151,9 +152,9 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_HTTP_PIPE); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_PIPE); PUMP_DEBUG; - lldebugs << "LLSDHTTPServer::process_impl" << llendl; + LL_DEBUGS() << "LLSDHTTPServer::process_impl" << LL_ENDL; // Once we have all the data, We need to read the sd on // the the in channel, and respond on the out channel @@ -180,12 +181,12 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl( std::string verb = context[CONTEXT_REQUEST][CONTEXT_VERB]; if(verb == HTTP_VERB_GET) { - LLFastTimer _(FTM_PROCESS_HTTP_GET); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_GET); mNode.get(LLHTTPNode::ResponsePtr(mResponse), context); } else if(verb == HTTP_VERB_PUT) { - LLFastTimer _(FTM_PROCESS_HTTP_PUT); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_PUT); LLSD input; if (mNode.getContentType() == LLHTTPNode::CONTENT_TYPE_LLSD) { @@ -201,7 +202,7 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl( } else if(verb == HTTP_VERB_POST) { - LLFastTimer _(FTM_PROCESS_HTTP_POST); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_POST); LLSD input; if (mNode.getContentType() == LLHTTPNode::CONTENT_TYPE_LLSD) { @@ -217,7 +218,7 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl( } else if(verb == HTTP_VERB_DELETE) { - LLFastTimer _(FTM_PROCESS_HTTP_DELETE); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_DELETE); mNode.del(LLHTTPNode::ResponsePtr(mResponse), context); } else if(verb == HTTP_VERB_OPTIONS) @@ -244,15 +245,15 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl( // Log all HTTP transactions. // TODO: Add a way to log these to their own file instead of indra.log // It is just too spammy to be in indra.log. - lldebugs << verb << " " << context[CONTEXT_REQUEST]["path"].asString() + LL_DEBUGS() << verb << " " << context[CONTEXT_REQUEST]["path"].asString() << " " << mStatusCode << " " << mStatusMessage << " " << delta - << "s" << llendl; + << "s" << LL_ENDL; // Log Internal Server Errors //if(mStatusCode == 500) //{ - // llwarns << "LLHTTPPipe::process_impl:500:Internal Server Error" - // << llendl; + // LL_WARNS() << "LLHTTPPipe::process_impl:500:Internal Server Error" + // << LL_ENDL; //} } @@ -301,8 +302,8 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl( return STATUS_DONE; } default: - llwarns << "LLHTTPPipe::process_impl: unexpected state " - << mState << llendl; + LL_WARNS() << "LLHTTPPipe::process_impl: unexpected state " + << mState << LL_ENDL; return STATUS_BREAK; } @@ -331,7 +332,7 @@ void LLHTTPPipe::Response::result(const LLSD& r) { if(! mPipe) { - llwarns << "LLHTTPPipe::Response::result: NULL pipe" << llendl; + LL_WARNS() << "LLHTTPPipe::Response::result: NULL pipe" << LL_ENDL; return; } @@ -347,7 +348,7 @@ void LLHTTPPipe::Response::extendedResult(S32 code, const std::string& body, con { if(! mPipe) { - llwarns << "LLHTTPPipe::Response::status: NULL pipe" << llendl; + LL_WARNS() << "LLHTTPPipe::Response::status: NULL pipe" << LL_ENDL; return; } @@ -363,7 +364,7 @@ void LLHTTPPipe::Response::status(S32 code, const std::string& message) { if(! mPipe) { - llwarns << "LLHTTPPipe::Response::status: NULL pipe" << llendl; + LL_WARNS() << "LLHTTPPipe::Response::status: NULL pipe" << LL_ENDL; return; } @@ -434,7 +435,7 @@ protected: * LLHTTPResponseHeader */ -static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_HEADER("HTTP Header"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_HEADER("HTTP Header"); // virtual LLIOPipe::EStatus LLHTTPResponseHeader::process_impl( @@ -444,7 +445,7 @@ LLIOPipe::EStatus LLHTTPResponseHeader::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_HTTP_HEADER); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_HEADER); PUMP_DEBUG; if(eos) { @@ -594,7 +595,7 @@ LLHTTPResponder::LLHTTPResponder(const LLHTTPNode& tree, const LLSD& ctx) : // virtual LLHTTPResponder::~LLHTTPResponder() { - //lldebugs << "destroying LLHTTPResponder" << llendl; + //LL_DEBUGS() << "destroying LLHTTPResponder" << LL_ENDL; } bool LLHTTPResponder::readHeaderLine( @@ -611,7 +612,7 @@ bool LLHTTPResponder::readHeaderLine( { if(len) { - lldebugs << "readLine failed - too long maybe?" << llendl; + LL_DEBUGS() << "readLine failed - too long maybe?" << LL_ENDL; markBad(channels, buffer); } return false; @@ -634,7 +635,7 @@ void LLHTTPResponder::markBad( << "</body>\n</html>\n"; } -static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_RESPONDER("HTTP Responder"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_RESPONDER("HTTP Responder"); // virtual LLIOPipe::EStatus LLHTTPResponder::process_impl( @@ -644,7 +645,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_HTTP_RESPONDER); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_RESPONDER); PUMP_DEBUG; LLIOPipe::EStatus status = STATUS_OK; @@ -667,8 +668,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( { memcpy(buf, (*seg_iter).data(), (*seg_iter).size()); /*Flawfinder: ignore*/ buf[(*seg_iter).size()] = '\0'; - llinfos << (*seg_iter).getChannel() << ": " << buf - << llendl; + LL_INFOS() << (*seg_iter).getChannel() << ": " << buf + << LL_ENDL; ++seg_iter; } } @@ -694,10 +695,10 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( header >> mAbsPathAndQuery; header >> mVersion; - lldebugs << "http request: " + LL_DEBUGS() << "http request: " << mVerb << " " << mAbsPathAndQuery - << " " << mVersion << llendl; + << " " << mVersion << LL_ENDL; std::string::size_type delimiter = mAbsPathAndQuery.find('?'); @@ -727,7 +728,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( { read_next_line = false; parse_all = false; - lldebugs << "unknown http verb: " << mVerb << llendl; + LL_DEBUGS() << "unknown http verb: " << mVerb << LL_ENDL; markBad(channels, buffer); } } @@ -762,7 +763,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( if(NULL == pos_colon) { keep_parsing = false; - lldebugs << "bad header: " << buf << llendl; + LL_DEBUGS() << "bad header: " << buf << LL_ENDL; markBad(channels, buffer); break; } @@ -773,7 +774,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( LLStringUtil::toLower(name); if("content-length" == name) { - lldebugs << "Content-Length: " << value << llendl; + LL_DEBUGS() << "Content-Length: " << value << LL_ENDL; mContentLength = atoi(value.c_str()); } else @@ -810,8 +811,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( const LLHTTPNode* node = mRootNode.traverse(mPath, context); if(node) { - //llinfos << "LLHTTPResponder::process_impl found node for " - // << mAbsPathAndQuery << llendl; + //LL_INFOS() << "LLHTTPResponder::process_impl found node for " + // << mAbsPathAndQuery << LL_ENDL; // Copy everything after mLast read to the out. LLBufferArray::segment_iterator_t seg_iter; @@ -831,8 +832,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( { memcpy(buf, (*seg_iter).data(), (*seg_iter).size()); /*Flawfinder: ignore*/ buf[(*seg_iter).size()] = '\0'; - llinfos << (*seg_iter).getChannel() << ": " << buf - << llendl; + LL_INFOS() << (*seg_iter).getChannel() << ": " << buf + << LL_ENDL; ++seg_iter; } #endif @@ -858,7 +859,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( = node->getProtocolHandler(); if (protocolHandler) { - lldebugs << "HTTP context: " << context << llendl; + LL_DEBUGS() << "HTTP context: " << context << LL_ENDL; protocolHandler->build(chain, context); } else @@ -917,8 +918,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( } else { - llwarns << "LLHTTPResponder::process_impl didn't find a node for " - << mAbsPathAndQuery << llendl; + LL_WARNS() << "LLHTTPResponder::process_impl didn't find a node for " + << mAbsPathAndQuery << LL_ENDL; LLBufferStream str(channels, buffer.get()); mState = STATE_SHORT_CIRCUIT; str << HTTP_VERSION_STR << " 404 Not Found\r\n\r\n<html>\n" @@ -971,7 +972,7 @@ LLHTTPNode& LLIOHTTPServer::create( port); if(!socket) { - llerrs << "Unable to initialize socket" << llendl; + LL_ERRS() << "Unable to initialize socket" << LL_ENDL; } LLHTTPResponseFactory* factory = new LLHTTPResponseFactory; diff --git a/indra/llmessage/lliopipe.cpp b/indra/llmessage/lliopipe.cpp index 8f827f7a30..4676a9a8f0 100755 --- a/indra/llmessage/lliopipe.cpp +++ b/indra/llmessage/lliopipe.cpp @@ -72,7 +72,7 @@ LLIOPipe::LLIOPipe() : LLIOPipe::~LLIOPipe() { - //lldebugs << "destroying LLIOPipe" << llendl; + //LL_DEBUGS() << "destroying LLIOPipe" << LL_ENDL; } //virtual diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h index cbd17b5a3d..9a0a427efd 100755 --- a/indra/llmessage/lliopipe.h +++ b/indra/llmessage/lliopipe.h @@ -31,6 +31,7 @@ #include <boost/intrusive_ptr.hpp> #include <boost/shared_ptr.hpp> +#include "llwin32headerslean.h" #include "apr_poll.h" #include "llsd.h" diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp index 2043bae5e7..4b8d1b44f6 100755 --- a/indra/llmessage/lliosocket.cpp +++ b/indra/llmessage/lliosocket.cpp @@ -32,6 +32,7 @@ #include "llapr.h" #include "llbuffer.h" +#include "llfasttimer.h" #include "llhost.h" #include "llpumpio.h" @@ -73,7 +74,7 @@ void ll_debug_socket(const char* msg, apr_socket_t* apr_sock) #if LL_DEBUG_SOCKET_FILE_DESCRIPTORS if(!apr_sock) { - lldebugs << "Socket -- " << (msg?msg:"") << ": no socket." << llendl; + LL_DEBUGS() << "Socket -- " << (msg?msg:"") << ": no socket." << LL_ENDL; return; } // *TODO: Why doesn't this work? @@ -81,13 +82,13 @@ void ll_debug_socket(const char* msg, apr_socket_t* apr_sock) int os_sock; if(APR_SUCCESS == apr_os_sock_get(&os_sock, apr_sock)) { - lldebugs << "Socket -- " << (msg?msg:"") << " on fd " << os_sock - << " at " << apr_sock << llendl; + LL_DEBUGS() << "Socket -- " << (msg?msg:"") << " on fd " << os_sock + << " at " << apr_sock << LL_ENDL; } else { - lldebugs << "Socket -- " << (msg?msg:"") << " no fd " - << " at " << apr_sock << llendl; + LL_DEBUGS() << "Socket -- " << (msg?msg:"") << " no fd " + << " at " << apr_sock << LL_ENDL; } #endif } @@ -165,13 +166,13 @@ LLSocket::ptr_t LLSocket::create(apr_pool_t* pool, EType type, U16 port) rv.reset(); return rv; } - lldebugs << "Bound " << ((DATAGRAM_UDP == type) ? "udp" : "tcp") - << " socket to port: " << sa->port << llendl; + LL_DEBUGS() << "Bound " << ((DATAGRAM_UDP == type) ? "udp" : "tcp") + << " socket to port: " << sa->port << LL_ENDL; if(STREAM_TCP == type) { // If it's a stream based socket, we need to tell the OS // to keep a queue of incoming connections for ACCEPT. - lldebugs << "Setting listen state for socket." << llendl; + LL_DEBUGS() << "Setting listen state for socket." << LL_ENDL; status = apr_socket_listen( socket, LL_DEFAULT_LISTEN_BACKLOG); @@ -290,10 +291,10 @@ LLIOSocketReader::LLIOSocketReader(LLSocket::ptr_t socket) : LLIOSocketReader::~LLIOSocketReader() { - //lldebugs << "Destroying LLIOSocketReader" << llendl; + //LL_DEBUGS() << "Destroying LLIOSocketReader" << LL_ENDL; } -static LLFastTimer::DeclareTimer FTM_PROCESS_SOCKET_READER("Socket Reader"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_SOCKET_READER("Socket Reader"); // virtual LLIOPipe::EStatus LLIOSocketReader::process_impl( @@ -303,7 +304,7 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_SOCKET_READER); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_SOCKET_READER); PUMP_DEBUG; if(!mSource) return STATUS_PRECONDITION_NOT_MET; if(!mInitialized) @@ -315,8 +316,8 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl( if(pump) { PUMP_DEBUG; - lldebugs << "Initializing poll descriptor for LLIOSocketReader." - << llendl; + LL_DEBUGS() << "Initializing poll descriptor for LLIOSocketReader." + << LL_ENDL; apr_pollfd_t poll_fd; poll_fd.p = NULL; poll_fd.desc_type = APR_POLL_SOCKET; @@ -343,7 +344,7 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl( status = apr_socket_recv(mSource->getSocket(), read_buf, &len); buffer->append(channels.out(), (U8*)read_buf, len); } while((APR_SUCCESS == status) && (READ_BUFFER_SIZE == len)); - lldebugs << "socket read status: " << status << llendl; + LL_DEBUGS() << "socket read status: " << status << LL_ENDL; LLIOPipe::EStatus rv = STATUS_OK; PUMP_DEBUG; @@ -390,10 +391,10 @@ LLIOSocketWriter::LLIOSocketWriter(LLSocket::ptr_t socket) : LLIOSocketWriter::~LLIOSocketWriter() { - //lldebugs << "Destroying LLIOSocketWriter" << llendl; + //LL_DEBUGS() << "Destroying LLIOSocketWriter" << LL_ENDL; } -static LLFastTimer::DeclareTimer FTM_PROCESS_SOCKET_WRITER("Socket Writer"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_SOCKET_WRITER("Socket Writer"); // virtual LLIOPipe::EStatus LLIOSocketWriter::process_impl( const LLChannelDescriptors& channels, @@ -402,7 +403,7 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_SOCKET_WRITER); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_SOCKET_WRITER); PUMP_DEBUG; if(!mDestination) return STATUS_PRECONDITION_NOT_MET; if(!mInitialized) @@ -414,8 +415,8 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl( if(pump) { PUMP_DEBUG; - lldebugs << "Initializing poll descriptor for LLIOSocketWriter." - << llendl; + LL_DEBUGS() << "Initializing poll descriptor for LLIOSocketWriter." + << LL_ENDL; apr_pollfd_t poll_fd; poll_fd.p = NULL; poll_fd.desc_type = APR_POLL_SOCKET; @@ -541,7 +542,7 @@ LLIOServerSocket::LLIOServerSocket( LLIOServerSocket::~LLIOServerSocket() { - //lldebugs << "Destroying LLIOServerSocket" << llendl; + //LL_DEBUGS() << "Destroying LLIOServerSocket" << LL_ENDL; } void LLIOServerSocket::setResponseTimeout(F32 timeout_secs) @@ -549,7 +550,7 @@ void LLIOServerSocket::setResponseTimeout(F32 timeout_secs) mResponseTimeout = timeout_secs; } -static LLFastTimer::DeclareTimer FTM_PROCESS_SERVER_SOCKET("Server Socket"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_SERVER_SOCKET("Server Socket"); // virtual LLIOPipe::EStatus LLIOServerSocket::process_impl( const LLChannelDescriptors& channels, @@ -558,11 +559,11 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_SERVER_SOCKET); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_SERVER_SOCKET); PUMP_DEBUG; if(!pump) { - llwarns << "Need a pump for server socket." << llendl; + LL_WARNS() << "Need a pump for server socket." << LL_ENDL; return STATUS_ERROR; } if(!mInitialized) @@ -571,8 +572,8 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( // This segment sets up the pump so that we do not call // process again until we have an incoming read, aka connect() // from a remote host. - lldebugs << "Initializing poll descriptor for LLIOServerSocket." - << llendl; + LL_DEBUGS() << "Initializing poll descriptor for LLIOServerSocket." + << LL_ENDL; apr_pollfd_t poll_fd; poll_fd.p = NULL; poll_fd.desc_type = APR_POLL_SOCKET; @@ -587,7 +588,7 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( // we are initialized, and told to process, so we must have a // socket waiting for a connection. - lldebugs << "accepting socket" << llendl; + LL_DEBUGS() << "accepting socket" << LL_ENDL; PUMP_DEBUG; apr_pool_t* new_pool = NULL; @@ -632,12 +633,12 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( } else { - llwarns << "Unable to build reactor to socket." << llendl; + LL_WARNS() << "Unable to build reactor to socket." << LL_ENDL; } } else { - llwarns << "Unable to create linden socket." << llendl; + LL_WARNS() << "Unable to create linden socket." << LL_ENDL; } PUMP_DEBUG; @@ -677,7 +678,7 @@ LLIODataSocket::LLIODataSocket( if(ll_apr_warn_status(status)) return; if(sa->port) { - lldebugs << "Bound datagram socket to port: " << sa->port << llendl; + LL_DEBUGS() << "Bound datagram socket to port: " << sa->port << LL_ENDL; mPort = sa->port; } else diff --git a/indra/llmessage/lliosocket.h b/indra/llmessage/lliosocket.h index be0f7dfcc6..ec998552d0 100755 --- a/indra/llmessage/lliosocket.h +++ b/indra/llmessage/lliosocket.h @@ -38,6 +38,7 @@ */ #include "lliopipe.h" +#include "llwin32headerslean.h" #include "apr_pools.h" #include "apr_network_io.h" #include "llchainio.h" diff --git a/indra/llmessage/llioutil.cpp b/indra/llmessage/llioutil.cpp index 8c50fd5069..b8443c0600 100755 --- a/indra/llmessage/llioutil.cpp +++ b/indra/llmessage/llioutil.cpp @@ -28,6 +28,7 @@ #include "linden_common.h" #include "llioutil.h" +#include "llfasttimer.h" /** * LLIOFlush @@ -44,7 +45,7 @@ LLIOPipe::EStatus LLIOFlush::process_impl( } -static LLFastTimer::DeclareTimer FTM_PROCESS_SLEEP("IO Sleep"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_SLEEP("IO Sleep"); /** * @class LLIOSleep */ @@ -55,7 +56,7 @@ LLIOPipe::EStatus LLIOSleep::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_SLEEP); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_SLEEP); if(mSeconds > 0.0) { if(pump) pump->sleepChain(mSeconds); @@ -65,7 +66,7 @@ LLIOPipe::EStatus LLIOSleep::process_impl( return STATUS_DONE; } -static LLFastTimer::DeclareTimer FTM_PROCESS_ADD_CHAIN("Add Chain"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_ADD_CHAIN("Add Chain"); /** * @class LLIOAddChain */ @@ -76,7 +77,7 @@ LLIOPipe::EStatus LLIOAddChain::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_ADD_CHAIN); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_ADD_CHAIN); pump->addChain(mChain, mTimeout); return STATUS_DONE; } diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp index 08b31e9c7a..134154aa6c 100755 --- a/indra/llmessage/llmail.cpp +++ b/indra/llmessage/llmail.cpp @@ -29,12 +29,7 @@ #include "llmail.h" // APR on Windows needs full windows headers -#ifdef LL_WINDOWS -# undef WIN32_LEAN_AND_MEAN -# include <winsock2.h> -# include <windows.h> -#endif - +#include "llwin32headers.h" #include <string> #include <sstream> @@ -199,16 +194,16 @@ std::string LLMail::buildSMTPTransaction( { if(!from_address || !to_address) { - llinfos << "send_mail build_smtp_transaction reject: missing to and/or" - << " from address." << llendl; + LL_INFOS() << "send_mail build_smtp_transaction reject: missing to and/or" + << " from address." << LL_ENDL; return std::string(); } if(!valid_subject_chars(subject)) { - llinfos << "send_mail build_smtp_transaction reject: bad subject header: " + LL_INFOS() << "send_mail build_smtp_transaction reject: bad subject header: " << "to=<" << to_address << ">, from=<" << from_address << ">" - << llendl; + << LL_ENDL; return std::string(); } std::ostringstream from_fmt; @@ -265,8 +260,8 @@ bool LLMail::send( { if(!from_address || !to_address) { - llinfos << "send_mail reject: missing to and/or from address." - << llendl; + LL_INFOS() << "send_mail reject: missing to and/or from address." + << LL_ENDL; return false; } @@ -303,26 +298,26 @@ bool LLMail::send( if(!gMailEnabled) { - llinfos << "send_mail reject: mail system is disabled: to=<" + LL_INFOS() << "send_mail reject: mail system is disabled: to=<" << to_address << ">, from=<" << from_address - << ">" << llendl; + << ">" << LL_ENDL; // Any future interface to SMTP should return this as an // error. --mark return true; } if(!gSockAddr) { - llwarns << "send_mail reject: mail system not initialized: to=<" + LL_WARNS() << "send_mail reject: mail system not initialized: to=<" << to_address << ">, from=<" << from_address - << ">" << llendl; + << ">" << LL_ENDL; return false; } if(!connect_smtp()) { - llwarns << "send_mail reject: SMTP connect failure: to=<" + LL_WARNS() << "send_mail reject: SMTP connect failure: to=<" << to_address << ">, from=<" << from_address - << ">" << llendl; + << ">" << LL_ENDL; return false; } @@ -338,27 +333,27 @@ bool LLMail::send( disconnect_smtp(); if(ll_apr_warn_status(status)) { - llwarns << "send_mail socket failure: unable to write " + LL_WARNS() << "send_mail socket failure: unable to write " << "to=<" << to_address << ">, from=<" << from_address << ">" << ", bytes=" << original_size - << ", sent=" << send_size << llendl; + << ", sent=" << send_size << LL_ENDL; return false; } if(send_size >= LL_MAX_KNOWN_GOOD_MAIL_SIZE) { - llwarns << "send_mail message has been shown to fail in testing " + LL_WARNS() << "send_mail message has been shown to fail in testing " << "when sending messages larger than " << LL_MAX_KNOWN_GOOD_MAIL_SIZE - << " bytes. The next log about success is potentially a lie." << llendl; + << " bytes. The next log about success is potentially a lie." << LL_ENDL; } - lldebugs << "send_mail success: " + LL_DEBUGS() << "send_mail success: " << "to=<" << to_address << ">, from=<" << from_address << ">" << ", bytes=" << original_size - << ", sent=" << send_size << llendl; + << ", sent=" << send_size << LL_ENDL; #if LL_LOG_ENTIRE_MAIL_MESSAGE_ON_SEND - llinfos << rfc2822_msg.str() << llendl; + LL_INFOS() << rfc2822_msg.str() << LL_ENDL; #endif return true; } diff --git a/indra/llmessage/llmessageconfig.cpp b/indra/llmessage/llmessageconfig.cpp index 539efc65f8..f8b2c8f5a6 100755 --- a/indra/llmessage/llmessageconfig.cpp +++ b/indra/llmessage/llmessageconfig.cpp @@ -145,9 +145,9 @@ void LLMessageConfigFile::loadMessages(const LLSD& data) std::ostringstream out; LLSDXMLFormatter *formatter = new LLSDXMLFormatter; formatter->format(mMessages, out); - llinfos << "loading ... " << out.str() + LL_INFOS() << "loading ... " << out.str() << " LLMessageConfigFile::loadMessages loaded " - << mMessages.size() << " messages" << llendl; + << mMessages.size() << " messages" << LL_ENDL; #endif } @@ -182,7 +182,7 @@ void LLMessageConfigFile::loadMessageBans(const LLSD& data) bool LLMessageConfigFile::isCapBanned(const std::string& cap_name) const { - lldebugs << "mCapBans is " << LLSDNotationStreamer(mCapBans) << llendl; + LL_DEBUGS() << "mCapBans is " << LLSDNotationStreamer(mCapBans) << LL_ENDL; return mCapBans[cap_name]; } @@ -268,7 +268,7 @@ bool LLMessageConfig::isValidMessage(const std::string& msg_name) { if (sServerName.empty()) { - llerrs << "LLMessageConfig::initClass() not called" << llendl; + LL_ERRS() << "LLMessageConfig::initClass() not called" << LL_ENDL; } LLMessageConfigFile& file = LLMessageConfigFile::instance(); return file.mMessages.has(msg_name); @@ -294,8 +294,8 @@ LLSD LLMessageConfig::getConfigForMessage(const std::string& msg_name) { if (sServerName.empty()) { - llerrs << "LLMessageConfig::isMessageTrusted(name) before" - << " LLMessageConfig::initClass()" << llendl; + LL_ERRS() << "LLMessageConfig::isMessageTrusted(name) before" + << " LLMessageConfig::initClass()" << LL_ENDL; } LLMessageConfigFile& file = LLMessageConfigFile::instance(); // LLSD for the CamelCase message name diff --git a/indra/llmessage/llmessagetemplate.cpp b/indra/llmessage/llmessagetemplate.cpp index d64123ad62..c4c7e66703 100755 --- a/indra/llmessage/llmessagetemplate.cpp +++ b/indra/llmessage/llmessagetemplate.cpp @@ -39,8 +39,8 @@ void LLMsgVarData::addData(const void *data, S32 size, EMsgVariableType type, S3 { if (mType != type) { - llwarns << "Type mismatch in LLMsgVarData::addData for " << mName - << llendl; + LL_WARNS() << "Type mismatch in LLMsgVarData::addData for " << mName + << LL_ENDL; } } if(size) @@ -181,12 +181,12 @@ void LLMessageTemplate::banUdp() }; if (mDeprecation != MD_DEPRECATED) { - llinfos << "Setting " << mName << " to UDPBlackListed was " << deprecation[mDeprecation] << llendl; + LL_INFOS() << "Setting " << mName << " to UDPBlackListed was " << deprecation[mDeprecation] << LL_ENDL; mDeprecation = MD_UDPBLACKLISTED; } else { - llinfos << mName << " is already more deprecated than UDPBlackListed" << llendl; + LL_INFOS() << mName << " is already more deprecated than UDPBlackListed" << LL_ENDL; } } diff --git a/indra/llmessage/llmessagetemplate.h b/indra/llmessage/llmessagetemplate.h index 005a49cedf..a44e16fc3a 100755 --- a/indra/llmessage/llmessagetemplate.h +++ b/indra/llmessage/llmessagetemplate.h @@ -27,9 +27,9 @@ #ifndef LL_LLMESSAGETEMPLATE_H #define LL_LLMESSAGETEMPLATE_H -#include "lldarray.h" #include "message.h" // TODO: babbage: Remove... #include "llstl.h" +#include "llindexedvector.h" class LLMsgVarData { @@ -102,7 +102,7 @@ public: } S32 mBlockNumber; - typedef LLDynamicArrayIndexed<LLMsgVarData, const char *, 8> msg_var_data_map_t; + typedef LLIndexedVector<LLMsgVarData, const char *, 8> msg_var_data_map_t; msg_var_data_map_t mMemberVarData; char *mName; S32 mTotalSize; @@ -194,7 +194,7 @@ public: LLMessageVariable** varp = &mMemberVariables[name]; if (*varp != NULL) { - llerrs << name << " has already been used as a variable name!" << llendl; + LL_ERRS() << name << " has already been used as a variable name!" << LL_ENDL; } *varp = new LLMessageVariable(name, type, size); if (((*varp)->getType() != MVT_VARIABLE) @@ -226,7 +226,7 @@ public: friend std::ostream& operator<<(std::ostream& s, LLMessageBlock &msg); - typedef LLDynamicArrayIndexed<LLMessageVariable*, const char *, 8> message_variable_map_t; + typedef LLIndexedVector<LLMessageVariable*, const char *, 8> message_variable_map_t; message_variable_map_t mMemberVariables; char *mName; EMsgBlockType mType; @@ -302,8 +302,8 @@ public: LLMessageBlock** member_blockp = &mMemberBlocks[blockp->mName]; if (*member_blockp != NULL) { - llerrs << "Block " << blockp->mName - << "has already been used as a block name!" << llendl; + LL_ERRS() << "Block " << blockp->mName + << "has already been used as a block name!" << LL_ENDL; } *member_blockp = blockp; if ( (mTotalSize != -1) @@ -392,7 +392,7 @@ public: } public: - typedef LLDynamicArrayIndexed<LLMessageBlock*, char*, 8> message_block_map_t; + typedef LLIndexedVector<LLMessageBlock*, char*, 8> message_block_map_t; message_block_map_t mMemberBlocks; char *mName; EMsgFrequency mFrequency; diff --git a/indra/llmessage/llmessagetemplateparser.cpp b/indra/llmessage/llmessagetemplateparser.cpp index b0f19df47c..1f7c09dbe5 100755 --- a/indra/llmessage/llmessagetemplateparser.cpp +++ b/indra/llmessage/llmessagetemplateparser.cpp @@ -165,13 +165,13 @@ BOOL b_check_token(const char *token, const char *regexp) if (current_checker == -1) { - llerrs << "Invalid regular expression value!" << llendl; + LL_ERRS() << "Invalid regular expression value!" << LL_ENDL; return FALSE; } if (current_checker == 9999) { - llerrs << "Regular expression can't start with *!" << llendl; + LL_ERRS() << "Regular expression can't start with *!" << LL_ENDL; return FALSE; } @@ -179,7 +179,7 @@ BOOL b_check_token(const char *token, const char *regexp) { if (current_checker == -1) { - llerrs << "Input exceeds regular expression!\nDid you forget a *?" << llendl; + LL_ERRS() << "Input exceeds regular expression!\nDid you forget a *?" << LL_ENDL; return FALSE; } @@ -204,7 +204,7 @@ BOOL b_variable_ok(const char *token) { if (!b_check_token(token, "fv*")) { - llwarns << "Token '" << token << "' isn't a variable!" << llendl; + LL_WARNS() << "Token '" << token << "' isn't a variable!" << LL_ENDL; return FALSE; } return TRUE; @@ -215,7 +215,7 @@ BOOL b_integer_ok(const char *token) { if (!b_check_token(token, "sd*")) { - llwarns << "Token isn't an integer!" << llendl; + LL_WARNS() << "Token isn't an integer!" << LL_ENDL; return FALSE; } return TRUE; @@ -226,7 +226,7 @@ BOOL b_positive_integer_ok(const char *token) { if (!b_check_token(token, "d*")) { - llwarns << "Token isn't an integer!" << llendl; + LL_WARNS() << "Token isn't an integer!" << LL_ENDL; return FALSE; } return TRUE; @@ -359,13 +359,13 @@ void LLTemplateTokenizer::error(std::string message) const { if(atEOF()) { - llerrs << "Unexpected end of file: " << message << llendl; + LL_ERRS() << "Unexpected end of file: " << message << LL_ENDL; } else { - llerrs << "Problem parsing message template at line " + LL_ERRS() << "Problem parsing message template at line " << line() << ", with token '" << get() << "' : " - << message << llendl; + << message << LL_ENDL; } } @@ -383,12 +383,12 @@ LLTemplateParser::LLTemplateParser(LLTemplateTokenizer & tokens): std::string vers_string = tokens.next(); mVersion = (F32)atof(vers_string.c_str()); - llinfos << "### Message template version " << mVersion << " ###" << llendl; + LL_INFOS() << "### Message template version " << mVersion << " ###" << LL_ENDL; } else { - llerrs << "Version must be first in the message template, found " - << tokens.next() << llendl; + LL_ERRS() << "Version must be first in the message template, found " + << tokens.next() << LL_ENDL; } while(LLMessageTemplate * templatep = parseMessage(tokens)) @@ -405,8 +405,8 @@ LLTemplateParser::LLTemplateParser(LLTemplateTokenizer & tokens): if(!tokens.wantEOF()) { - llerrs << "Expected end of template or a message, instead found: " - << tokens.next() << " at " << tokens.line() << llendl; + LL_ERRS() << "Expected end of template or a message, instead found: " + << tokens.next() << " at " << tokens.line() << LL_ENDL; } } @@ -441,7 +441,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) // is name a legit C variable name if (!b_variable_ok(template_name.c_str())) { - llerrs << "Not legit variable name: " << template_name << " at " << tokens.line() << llendl; + LL_ERRS() << "Not legit variable name: " << template_name << " at " << tokens.line() << LL_ENDL; } // ok, now get Frequency ("High", "Medium", or "Low") @@ -461,7 +461,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) } else { - llerrs << "Expected frequency, got " << freq_string << " at " << tokens.line() << llendl; + LL_ERRS() << "Expected frequency, got " << freq_string << " at " << tokens.line() << LL_ENDL; } // TODO more explicit checking here pls @@ -477,7 +477,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) message_number = (255 << 24) | (255 << 16) | message_number; break; default: - llerrs << "Unknown frequency enum: " << frequency << llendl; + LL_ERRS() << "Unknown frequency enum: " << frequency << LL_ENDL; } templatep = new LLMessageTemplate( @@ -497,7 +497,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) } else { - llerrs << "Bad trust " << trust << " at " << tokens.line() << llendl; + LL_ERRS() << "Bad trust " << trust << " at " << tokens.line() << LL_ENDL; } // get encoding @@ -512,7 +512,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) } else { - llerrs << "Bad encoding " << encoding << " at " << tokens.line() << llendl; + LL_ERRS() << "Bad encoding " << encoding << " at " << tokens.line() << LL_ENDL; } // get deprecation @@ -544,8 +544,8 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens) if(!tokens.want("}")) { - llerrs << "Expecting closing } for message " << template_name - << " at " << tokens.line() << llendl; + LL_ERRS() << "Expecting closing } for message " << template_name + << " at " << tokens.line() << LL_ENDL; } return templatep; } @@ -566,8 +566,8 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens) // is name a legit C variable name if (!b_variable_ok(block_name.c_str())) { - llerrs << "not a legal block name: " << block_name - << " at " << tokens.line() << llendl; + LL_ERRS() << "not a legal block name: " << block_name + << " at " << tokens.line() << LL_ENDL; } // now, block type ("Single", "Multiple", or "Variable") @@ -586,8 +586,8 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens) // is it a legal integer if (!b_positive_integer_ok(repeats.c_str())) { - llerrs << "not a legal integer for block multiple count: " - << repeats << " at " << tokens.line() << llendl; + LL_ERRS() << "not a legal integer for block multiple count: " + << repeats << " at " << tokens.line() << LL_ENDL; } // ok, we can create a block @@ -602,8 +602,8 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens) } else { - llerrs << "bad block type: " << block_type - << " at " << tokens.line() << llendl; + LL_ERRS() << "bad block type: " << block_type + << " at " << tokens.line() << LL_ENDL; } @@ -617,8 +617,8 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens) if(!tokens.want("}")) { - llerrs << "Expecting closing } for block " << block_name - << " at " << tokens.line() << llendl; + LL_ERRS() << "Expecting closing } for block " << block_name + << " at " << tokens.line() << LL_ENDL; } return blockp; @@ -637,8 +637,8 @@ LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens if (!b_variable_ok(var_name.c_str())) { - llerrs << "Not a legit variable name: " << var_name - << " at " << tokens.line() << llendl; + LL_ERRS() << "Not a legit variable name: " << var_name + << " at " << tokens.line() << LL_ENDL; } std::string var_type = tokens.next(); @@ -721,8 +721,8 @@ LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens if (!b_positive_integer_ok(variable_size.c_str())) { - llerrs << "not a legal integer variable size: " << variable_size - << " at " << tokens.line() << llendl; + LL_ERRS() << "not a legal integer variable size: " << variable_size + << " at " << tokens.line() << LL_ENDL; } EMsgVariableType type_enum; @@ -737,8 +737,8 @@ LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens else { type_enum = MVT_FIXED; // removes a warning - llerrs << "bad variable type: " << var_type - << " at " << tokens.line() << llendl; + LL_ERRS() << "bad variable type: " << var_type + << " at " << tokens.line() << LL_ENDL; } varp = new LLMessageVariable( @@ -748,14 +748,14 @@ LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens } else { - llerrs << "bad variable type:" << var_type - << " at " << tokens.line() << llendl; + LL_ERRS() << "bad variable type:" << var_type + << " at " << tokens.line() << LL_ENDL; } if(!tokens.want("}")) { - llerrs << "Expecting closing } for variable " << var_name - << " at " << tokens.line() << llendl; + LL_ERRS() << "Expecting closing } for variable " << var_name + << " at " << tokens.line() << LL_ENDL; } return varp; } diff --git a/indra/llmessage/llnamevalue.cpp b/indra/llmessage/llnamevalue.cpp index d799403029..c51883ee3d 100755 --- a/indra/llmessage/llnamevalue.cpp +++ b/indra/llmessage/llnamevalue.cpp @@ -33,7 +33,7 @@ #include "u64.h" #include "llstring.h" -#include "string_table.h" +#include "llstringtable.h" // Anonymous enumeration to provide constants in this file. // *NOTE: These values may be used in sscanf statements below as their @@ -209,7 +209,7 @@ void LLNameValue::init(const char *name, const char *data, const char *type, con } else { - llwarns << "Unknown name value type string " << mStringType << " for " << mName << llendl; + LL_WARNS() << "Unknown name value type string " << mStringType << " for " << mName << LL_ENDL; mType = NVT_NULL; } @@ -261,8 +261,8 @@ void LLNameValue::init(const char *name, const char *data, const char *type, con } else { - llwarns << "LLNameValue::init() - unknown sendto field " - << nvsendto << " for NV " << mName << llendl; + LL_WARNS() << "LLNameValue::init() - unknown sendto field " + << nvsendto << " for NV " << mName << LL_ENDL; mSendto = NVS_NULL; mStringSendto = mNVNameTable->addString("S"); } @@ -332,7 +332,7 @@ LLNameValue::LLNameValue(const char *name, const char *type, const char *nvclass else { mType = NVT_NULL; - llinfos << "Unknown name-value type " << mStringType << llendl; + LL_INFOS() << "Unknown name-value type " << mStringType << LL_ENDL; } // Nota Bene: Whatever global structure manages this should have these in the name table already! @@ -580,7 +580,7 @@ char *LLNameValue::getString() } else { - llerrs << mName << " not a string!" << llendl; + LL_ERRS() << mName << " not a string!" << LL_ENDL; return NULL; } } @@ -593,7 +593,7 @@ const char *LLNameValue::getAsset() const } else { - llerrs << mName << " not an asset!" << llendl; + LL_ERRS() << mName << " not an asset!" << LL_ENDL; return NULL; } } @@ -606,7 +606,7 @@ F32 *LLNameValue::getF32() } else { - llerrs << mName << " not a F32!" << llendl; + LL_ERRS() << mName << " not a F32!" << LL_ENDL; return NULL; } } @@ -619,7 +619,7 @@ S32 *LLNameValue::getS32() } else { - llerrs << mName << " not a S32!" << llendl; + LL_ERRS() << mName << " not a S32!" << LL_ENDL; return NULL; } } @@ -632,7 +632,7 @@ U32 *LLNameValue::getU32() } else { - llerrs << mName << " not a U32!" << llendl; + LL_ERRS() << mName << " not a U32!" << LL_ENDL; return NULL; } } @@ -645,7 +645,7 @@ U64 *LLNameValue::getU64() } else { - llerrs << mName << " not a U64!" << llendl; + LL_ERRS() << mName << " not a U64!" << LL_ENDL; return NULL; } } @@ -658,7 +658,7 @@ void LLNameValue::getVec3(LLVector3 &vec) } else { - llerrs << mName << " not a Vec3!" << llendl; + LL_ERRS() << mName << " not a Vec3!" << LL_ENDL; } } @@ -670,7 +670,7 @@ LLVector3 *LLNameValue::getVec3() } else { - llerrs << mName << " not a Vec3!" << llendl; + LL_ERRS() << mName << " not a Vec3!" << LL_ENDL; return NULL; } } @@ -726,7 +726,7 @@ LLNameValue &LLNameValue::operator=(const LLNameValue &a) *mNameValueReference.u64 = *a.mNameValueReference.u64; break; default: - llerrs << "Unknown Name value type " << (U32)a.mType << llendl; + LL_ERRS() << "Unknown Name value type " << (U32)a.mType << LL_ENDL; break; } @@ -865,7 +865,7 @@ void LLNameValue::setU32(const U32 a) *mNameValueReference.f32 = (F32)a; break; default: - llerrs << "NameValue: Trying to set U32 into a " << mStringType << ", unknown conversion" << llendl; + LL_ERRS() << "NameValue: Trying to set U32 into a " << mStringType << ", unknown conversion" << LL_ENDL; break; } return; @@ -883,7 +883,7 @@ void LLNameValue::setVec3(const LLVector3 &a) *mNameValueReference.vec3 = a; break; default: - llerrs << "NameValue: Trying to set LLVector3 into a " << mStringType << ", unknown conversion" << llendl; + LL_ERRS() << "NameValue: Trying to set LLVector3 into a " << mStringType << ", unknown conversion" << LL_ENDL; break; } return; @@ -895,7 +895,7 @@ std::string LLNameValue::printNameValue() const std::string buffer; buffer = llformat("%s %s %s %s ", mName, mStringType, mStringClass, mStringSendto); buffer += printData(); -// llinfos << "Name Value Length: " << buffer.size() + 1 << llendl; +// LL_INFOS() << "Name Value Length: " << buffer.size() + 1 << LL_ENDL; return buffer; } @@ -928,7 +928,7 @@ std::string LLNameValue::printData() const buffer = llformat( "%f, %f, %f", mNameValueReference.vec3->mV[VX], mNameValueReference.vec3->mV[VY], mNameValueReference.vec3->mV[VZ]); break; default: - llerrs << "Trying to print unknown NameValue type " << mStringType << llendl; + LL_ERRS() << "Trying to print unknown NameValue type " << mStringType << LL_ENDL; break; } return buffer; @@ -962,7 +962,7 @@ std::ostream& operator<<(std::ostream& s, const LLNameValue &a) s << *(a.mNameValueReference.vec3); break; default: - llerrs << "Trying to print unknown NameValue type " << a.mStringType << llendl; + LL_ERRS() << "Trying to print unknown NameValue type " << a.mStringType << LL_ENDL; break; } return s; diff --git a/indra/llmessage/llnamevalue.h b/indra/llmessage/llnamevalue.h index 273de475f8..f8b556b5fe 100755 --- a/indra/llmessage/llnamevalue.h +++ b/indra/llmessage/llnamevalue.h @@ -41,7 +41,7 @@ // SitObject STRING // SitPosition VEC3 -#include "string_table.h" +#include "llstringtable.h" #include "llmath.h" #include "v3math.h" #include "lldbstrings.h" diff --git a/indra/llmessage/llpacketack.cpp b/indra/llmessage/llpacketack.cpp index f08d3404ea..c3c022c297 100755 --- a/indra/llmessage/llpacketack.cpp +++ b/indra/llmessage/llpacketack.cpp @@ -50,7 +50,7 @@ LLReliablePacket::LLReliablePacket( mHost = params->mHost; mRetries = params->mRetries; mPingBasedRetry = params->mPingBasedRetry; - mTimeout = params->mTimeout; + mTimeout = F32Seconds(params->mTimeout); mCallback = params->mCallback; mCallbackData = params->mCallbackData; mMessageName = params->mMessageName; @@ -59,13 +59,13 @@ LLReliablePacket::LLReliablePacket( { mRetries = 0; mPingBasedRetry = TRUE; - mTimeout = 0.f; + mTimeout = F32Seconds(0.f); mCallback = NULL; mCallbackData = NULL; mMessageName = NULL; } - mExpirationTime = (F64)((S64)totalTime())/1000000.0 + mTimeout; + mExpirationTime = (F64Seconds)totalTime() + mTimeout; mPacketID = ntohl(*((U32*)(&buf_ptr[PHL_PACKET_ID]))); mSocket = socket; diff --git a/indra/llmessage/llpacketack.h b/indra/llmessage/llpacketack.h index 2ef3c48e44..f0ed923f19 100755 --- a/indra/llmessage/llpacketack.h +++ b/indra/llmessage/llpacketack.h @@ -28,6 +28,7 @@ #define LL_LLPACKETACK_H #include "llhost.h" +#include "llunits.h" class LLReliablePacketParams { @@ -35,7 +36,7 @@ public: LLHost mHost; S32 mRetries; BOOL mPingBasedRetry; - F32 mTimeout; + F32Seconds mTimeout; void (*mCallback)(void **,S32); void** mCallbackData; char* mMessageName; @@ -53,7 +54,7 @@ public: mHost.invalidate(); mRetries = 0; mPingBasedRetry = TRUE; - mTimeout = 0.f; + mTimeout = F32Seconds(0.f); mCallback = NULL; mCallbackData = NULL; mMessageName = NULL; @@ -63,7 +64,7 @@ public: const LLHost& host, S32 retries, BOOL ping_based_retry, - F32 timeout, + F32Seconds timeout, void (*callback)(void**,S32), void** callback_data, char* name) { @@ -98,7 +99,7 @@ protected: LLHost mHost; S32 mRetries; BOOL mPingBasedRetry; - F32 mTimeout; + F32Seconds mTimeout; void (*mCallback)(void**,S32); void** mCallbackData; char* mMessageName; @@ -108,7 +109,7 @@ protected: TPACKETID mPacketID; - F64 mExpirationTime; + F64Seconds mExpirationTime; }; #endif diff --git a/indra/llmessage/llpacketbuffer.cpp b/indra/llmessage/llpacketbuffer.cpp index e69631eb3b..ccf991b1a7 100755 --- a/indra/llmessage/llpacketbuffer.cpp +++ b/indra/llmessage/llpacketbuffer.cpp @@ -29,7 +29,7 @@ #include "llpacketbuffer.h" #include "net.h" -#include "timing.h" +#include "lltimer.h" #include "llhost.h" /////////////////////////////////////////////////////////// @@ -41,7 +41,7 @@ LLPacketBuffer::LLPacketBuffer(const LLHost &host, const char *datap, const S32 if (size > NET_BUFFER_SIZE) { - llerrs << "Sending packet > " << NET_BUFFER_SIZE << " of size " << size << llendl; + LL_ERRS() << "Sending packet > " << NET_BUFFER_SIZE << " of size " << size << LL_ENDL; } else { diff --git a/indra/llmessage/llpacketring.cpp b/indra/llmessage/llpacketring.cpp index fc6e9c5193..687212ea10 100755 --- a/indra/llmessage/llpacketring.cpp +++ b/indra/llmessage/llpacketring.cpp @@ -41,7 +41,6 @@ #include "llproxy.h" #include "llrand.h" #include "message.h" -#include "timing.h" #include "u64.h" /////////////////////////////////////////////////////////// @@ -196,7 +195,7 @@ S32 LLPacketRing::receivePacket (S32 socket, char *datap) if (mInBufferLength + packetp->getSize() > mMaxBufferLength) { // Toss it. - llwarns << "Throwing away packet, overflowing buffer" << llendl; + LL_WARNS() << "Throwing away packet, overflowing buffer" << LL_ENDL; delete packetp; packetp = NULL; } @@ -324,7 +323,7 @@ BOOL LLPacketRing::sendPacket(int h_socket, char * send_buffer, S32 buf_size, LL { // Nuke this packet, we overflowed the buffer. // Toss it. - llwarns << "Throwing away outbound packet, overflowing buffer" << llendl; + LL_WARNS() << "Throwing away outbound packet, overflowing buffer" << LL_ENDL; } else { @@ -332,7 +331,7 @@ BOOL LLPacketRing::sendPacket(int h_socket, char * send_buffer, S32 buf_size, LL if ((mOutBufferLength > 4192) && queue_timer.getElapsedTimeF32() > 1.f) { // Add it to the queue - llinfos << "Outbound packet queue " << mOutBufferLength << " bytes" << llendl; + LL_INFOS() << "Outbound packet queue " << mOutBufferLength << " bytes" << LL_ENDL; queue_timer.reset(); } packetp = new LLPacketBuffer(host, send_buffer, buf_size); diff --git a/indra/llmessage/llproxy.cpp b/indra/llmessage/llproxy.cpp index 9988fcd9c0..9b8d19cc3e 100755 --- a/indra/llmessage/llproxy.cpp +++ b/indra/llmessage/llproxy.cpp @@ -57,13 +57,15 @@ LLProxy::LLProxy(): mAuthMethodSelected(METHOD_NOAUTH), mSocksUsername(), mSocksPassword() -{ -} +{} LLProxy::~LLProxy() { - stopSOCKSProxy(); - disableHTTPProxy(); + if (ll_apr_is_initialized()) + { + stopSOCKSProxy(); + disableHTTPProxy(); + } } /** diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index 0623e99f0a..506ccc98a4 100755 --- a/indra/llmessage/llpumpio.cpp +++ b/indra/llmessage/llpumpio.cpp @@ -34,6 +34,7 @@ #include "apr_poll.h" #include "llapr.h" +#include "llfasttimer.h" #include "llstl.h" // These should not be enabled in production, but they can be @@ -81,7 +82,7 @@ void ll_debug_poll_fd(const char* msg, const apr_pollfd_t* poll) #if LL_DEBUG_POLL_FILE_DESCRIPTORS if(!poll) { - lldebugs << "Poll -- " << (msg?msg:"") << ": no pollfd." << llendl; + LL_DEBUGS() << "Poll -- " << (msg?msg:"") << ": no pollfd." << LL_ENDL; return; } if(poll->desc.s) @@ -89,13 +90,13 @@ void ll_debug_poll_fd(const char* msg, const apr_pollfd_t* poll) apr_os_sock_t os_sock; if(APR_SUCCESS == apr_os_sock_get(&os_sock, poll->desc.s)) { - lldebugs << "Poll -- " << (msg?msg:"") << " on fd " << os_sock - << " at " << poll->desc.s << llendl; + LL_DEBUGS() << "Poll -- " << (msg?msg:"") << " on fd " << os_sock + << " at " << poll->desc.s << LL_ENDL; } else { - lldebugs << "Poll -- " << (msg?msg:"") << " no fd " - << " at " << poll->desc.s << llendl; + LL_DEBUGS() << "Poll -- " << (msg?msg:"") << " no fd " + << " at " << poll->desc.s << LL_ENDL; } } else if(poll->desc.f) @@ -103,18 +104,18 @@ void ll_debug_poll_fd(const char* msg, const apr_pollfd_t* poll) apr_os_file_t os_file; if(APR_SUCCESS == apr_os_file_get(&os_file, poll->desc.f)) { - lldebugs << "Poll -- " << (msg?msg:"") << " on fd " << os_file - << " at " << poll->desc.f << llendl; + LL_DEBUGS() << "Poll -- " << (msg?msg:"") << " on fd " << os_file + << " at " << poll->desc.f << LL_ENDL; } else { - lldebugs << "Poll -- " << (msg?msg:"") << " no fd " - << " at " << poll->desc.f << llendl; + LL_DEBUGS() << "Poll -- " << (msg?msg:"") << " no fd " + << " at " << poll->desc.f << LL_ENDL; } } else { - lldebugs << "Poll -- " << (msg?msg:"") << ": no descriptor." << llendl; + LL_DEBUGS() << "Poll -- " << (msg?msg:"") << ": no descriptor." << LL_ENDL; } #endif } @@ -203,10 +204,10 @@ bool LLPumpIO::addChain(const chain_t& chain, F32 timeout, bool has_curl_request info.mData->setThreaded(has_curl_request); LLLinkInfo link; #if LL_DEBUG_PIPE_TYPE_IN_PUMP - lldebugs << "LLPumpIO::addChain() " << chain[0] << " '" - << typeid(*(chain[0])).name() << "'" << llendl; + LL_DEBUGS() << "LLPumpIO::addChain() " << chain[0] << " '" + << typeid(*(chain[0])).name() << "'" << LL_ENDL; #else - lldebugs << "LLPumpIO::addChain() " << chain[0] <<llendl; + LL_DEBUGS() << "LLPumpIO::addChain() " << chain[0] <<LL_ENDL; #endif chain_t::const_iterator it = chain.begin(); chain_t::const_iterator end = chain.end(); @@ -237,10 +238,10 @@ bool LLPumpIO::addChain( LLScopedLock lock(mChainsMutex); #endif #if LL_DEBUG_PIPE_TYPE_IN_PUMP - lldebugs << "LLPumpIO::addChain() " << links[0].mPipe << " '" - << typeid(*(links[0].mPipe)).name() << "'" << llendl; + LL_DEBUGS() << "LLPumpIO::addChain() " << links[0].mPipe << " '" + << typeid(*(links[0].mPipe)).name() << "'" << LL_ENDL; #else - lldebugs << "LLPumpIO::addChain() " << links[0].mPipe << llendl; + LL_DEBUGS() << "LLPumpIO::addChain() " << links[0].mPipe << LL_ENDL; #endif LLChainInfo info; info.setTimeoutSeconds(timeout); @@ -306,12 +307,12 @@ bool LLPumpIO::setConditional(LLIOPipe* pipe, const apr_pollfd_t* poll) if(!pipe) return false; ll_debug_poll_fd("Set conditional", poll); - lldebugs << "Setting conditionals (" << (poll ? events_2_string(poll->reqevents) :"null") + LL_DEBUGS() << "Setting conditionals (" << (poll ? events_2_string(poll->reqevents) :"null") << ") " #if LL_DEBUG_PIPE_TYPE_IN_PUMP << "on pipe " << typeid(*pipe).name() #endif - << " at " << pipe << llendl; + << " at " << pipe << LL_ENDL; // remove any matching poll file descriptors for this pipe. LLIOPipe::ptr_t pipe_ptr(pipe); @@ -430,8 +431,8 @@ void LLPumpIO::pump() pump(DEFAULT_POLL_TIMEOUT); } -static LLFastTimer::DeclareTimer FTM_PUMP_IO("Pump IO"); -static LLFastTimer::DeclareTimer FTM_PUMP_POLL("Pump Poll"); +static LLTrace::BlockTimerStatHandle FTM_PUMP_IO("Pump IO"); +static LLTrace::BlockTimerStatHandle FTM_PUMP_POLL("Pump Poll"); LLPumpIO::current_chain_t LLPumpIO::removeRunningChain(LLPumpIO::current_chain_t& run_chain) { @@ -445,8 +446,8 @@ LLPumpIO::current_chain_t LLPumpIO::removeRunningChain(LLPumpIO::current_chain_t //timeout is in microseconds void LLPumpIO::pump(const S32& poll_timeout) { - LLFastTimer t1(FTM_PUMP_IO); - //llinfos << "LLPumpIO::pump()" << llendl; + LL_RECORD_BLOCK_TIME(FTM_PUMP_IO); + //LL_INFOS() << "LLPumpIO::pump()" << LL_ENDL; // Run any pending runners. mRunner.run(); @@ -474,7 +475,7 @@ void LLPumpIO::pump(const S32& poll_timeout) if(!mPendingChains.empty()) { PUMP_DEBUG; - //lldebugs << "Pushing " << mPendingChains.size() << "." << llendl; + //LL_DEBUGS() << "Pushing " << mPendingChains.size() << "." << LL_ENDL; std::copy( mPendingChains.begin(), mPendingChains.end(), @@ -522,11 +523,11 @@ void LLPumpIO::pump(const S32& poll_timeout) if(mPollset) { PUMP_DEBUG; - //llinfos << "polling" << llendl; + //LL_INFOS() << "polling" << LL_ENDL; S32 count = 0; S32 client_id = 0; { - LLFastTimer _(FTM_PUMP_POLL); + LL_RECORD_BLOCK_TIME(FTM_PUMP_POLL); apr_pollset_poll(mPollset, poll_timeout, &count, &poll_fd); } PUMP_DEBUG; @@ -544,7 +545,7 @@ void LLPumpIO::pump(const S32& poll_timeout) signal_client_t::iterator not_signalled = signalled_client.end(); // Process everything as appropriate - //lldebugs << "Running chain count: " << mRunningChains.size() << llendl; + //LL_DEBUGS() << "Running chain count: " << mRunningChains.size() << LL_ENDL; running_chains_t::iterator run_chain = mRunningChains.begin(); bool process_this_chain = false; while( run_chain != mRunningChains.end() ) @@ -564,9 +565,9 @@ void LLPumpIO::pump(const S32& poll_timeout) && (*run_chain).mTimer.hasExpired()) { PUMP_DEBUG; - llinfos << "Error handler forgot to reset timeout. " + LL_INFOS() << "Error handler forgot to reset timeout. " << "Resetting to " << DEFAULT_CHAIN_EXPIRY_SECS - << " seconds." << llendl; + << " seconds." << LL_ENDL; (*run_chain).setTimeoutSeconds(DEFAULT_CHAIN_EXPIRY_SECS); } } @@ -576,15 +577,15 @@ void LLPumpIO::pump(const S32& poll_timeout) // it timed out and no one handled it, so we need to // retire the chain #if LL_DEBUG_PIPE_TYPE_IN_PUMP - lldebugs << "Removing chain " + LL_DEBUGS() << "Removing chain " << (*run_chain).mChainLinks[0].mPipe << " '" << typeid(*((*run_chain).mChainLinks[0].mPipe)).name() - << "' because it timed out." << llendl; + << "' because it timed out." << LL_ENDL; #else -// lldebugs << "Removing chain " +// LL_DEBUGS() << "Removing chain " // << (*run_chain).mChainLinks[0].mPipe -// << " because we reached the end." << llendl; +// << " because we reached the end." << LL_ENDL; #endif run_chain = removeRunningChain(run_chain); continue; @@ -609,12 +610,12 @@ void LLPumpIO::pump(const S32& poll_timeout) { // if there are no conditionals, just process this chain. process_this_chain = true; - //lldebugs << "no conditionals - processing" << llendl; + //LL_DEBUGS() << "no conditionals - processing" << LL_ENDL; } else { PUMP_DEBUG; - //lldebugs << "checking conditionals" << llendl; + //LL_DEBUGS() << "checking conditionals" << LL_ENDL; // Check if this run chain was signalled. If any file // descriptor is ready for something, then go ahead and // process this chian. @@ -654,7 +655,7 @@ void LLPumpIO::pump(const S32& poll_timeout) error_status = LLIOPipe::STATUS_ERROR; if(handleChainError(*run_chain, error_status)) break; ll_debug_poll_fd("Removing pipe", poll); - llwarns << "Removing pipe " + LL_WARNS() << "Removing pipe " << (*run_chain).mChainLinks[0].mPipe << " '" #if LL_DEBUG_PIPE_TYPE_IN_PUMP @@ -663,7 +664,7 @@ void LLPumpIO::pump(const S32& poll_timeout) #endif << "' because: " << events_2_string(poll->rtnevents) - << llendl; + << LL_ENDL; (*run_chain).mHead = (*run_chain).mChainLinks.end(); break; } @@ -691,13 +692,13 @@ void LLPumpIO::pump(const S32& poll_timeout) if((*run_chain).mHead == (*run_chain).mChainLinks.end()) { #if LL_DEBUG_PIPE_TYPE_IN_PUMP - lldebugs << "Removing chain " << (*run_chain).mChainLinks[0].mPipe + LL_DEBUGS() << "Removing chain " << (*run_chain).mChainLinks[0].mPipe << " '" << typeid(*((*run_chain).mChainLinks[0].mPipe)).name() - << "' because we reached the end." << llendl; + << "' because we reached the end." << LL_ENDL; #else -// lldebugs << "Removing chain " << (*run_chain).mChainLinks[0].mPipe -// << " because we reached the end." << llendl; +// LL_DEBUGS() << "Removing chain " << (*run_chain).mChainLinks[0].mPipe +// << " because we reached the end." << LL_ENDL; #endif PUMP_DEBUG; @@ -773,11 +774,11 @@ bool LLPumpIO::respond( return true; } -static LLFastTimer::DeclareTimer FTM_PUMP_CALLBACK_CHAIN("Chain"); +static LLTrace::BlockTimerStatHandle FTM_PUMP_CALLBACK_CHAIN("Chain"); void LLPumpIO::callback() { - //llinfos << "LLPumpIO::callback()" << llendl; + //LL_INFOS() << "LLPumpIO::callback()" << LL_ENDL; if(true) { #if LL_THREADS_APR @@ -795,7 +796,7 @@ void LLPumpIO::callback() callbacks_t::iterator end = mCallbacks.end(); for(; it != end; ++it) { - LLFastTimer t(FTM_PUMP_CALLBACK_CHAIN); + LL_RECORD_BLOCK_TIME(FTM_PUMP_CALLBACK_CHAIN); // it's always the first and last time for respone chains (*it).mHead = (*it).mChainLinks.begin(); (*it).mInit = true; @@ -846,7 +847,7 @@ void LLPumpIO::cleanup() mCallbackMutex = NULL; if(mPollset) { -// lldebugs << "cleaning up pollset" << llendl; +// LL_DEBUGS() << "cleaning up pollset" << LL_ENDL; apr_pollset_destroy(mPollset); mPollset = NULL; } @@ -860,10 +861,10 @@ void LLPumpIO::cleanup() void LLPumpIO::rebuildPollset() { -// lldebugs << "LLPumpIO::rebuildPollset()" << llendl; +// LL_DEBUGS() << "LLPumpIO::rebuildPollset()" << LL_ENDL; if(mPollset) { - //lldebugs << "destroying pollset" << llendl; + //LL_DEBUGS() << "destroying pollset" << LL_ENDL; apr_pollset_destroy(mPollset); mPollset = NULL; } @@ -874,7 +875,7 @@ void LLPumpIO::rebuildPollset() { size += (*run_it).mDescriptors.size(); } - //lldebugs << "found " << size << " descriptors." << llendl; + //LL_DEBUGS() << "found " << size << " descriptors." << LL_ENDL; if(size) { // Recycle the memory pool @@ -921,10 +922,10 @@ void LLPumpIO::processChain(LLChainInfo& chain) { #if LL_DEBUG_PROCESS_LINK #if LL_DEBUG_PIPE_TYPE_IN_PUMP - llinfos << "Processing " << typeid(*((*it).mPipe)).name() << "." - << llendl; + LL_INFOS() << "Processing " << typeid(*((*it).mPipe)).name() << "." + << LL_ENDL; #else - llinfos << "Processing link " << (*it).mPipe << "." << llendl; + LL_INFOS() << "Processing link " << (*it).mPipe << "." << LL_ENDL; #endif #endif #if LL_DEBUG_SPEW_BUFFER_CHANNEL_IN @@ -941,15 +942,15 @@ void LLPumpIO::processChain(LLChainInfo& chain) (U8*)buf, bytes); buf[bytes] = '\0'; - llinfos << "CHANNEL IN(" << (*it).mChannels.in() << "): " - << buf << llendl; + LL_INFOS() << "CHANNEL IN(" << (*it).mChannels.in() << "): " + << buf << LL_ENDL; delete[] buf; buf = NULL; } else { - llinfos << "CHANNEL IN(" << (*it).mChannels.in()<< "): (null)" - << llendl; + LL_INFOS() << "CHANNEL IN(" << (*it).mChannels.in()<< "): (null)" + << LL_ENDL; } } #endif @@ -974,15 +975,15 @@ void LLPumpIO::processChain(LLChainInfo& chain) (U8*)buf, bytes); buf[bytes] = '\0'; - llinfos << "CHANNEL OUT(" << (*it).mChannels.out()<< "): " - << buf << llendl; + LL_INFOS() << "CHANNEL OUT(" << (*it).mChannels.out()<< "): " + << buf << LL_ENDL; delete[] buf; buf = NULL; } else { - llinfos << "CHANNEL OUT(" << (*it).mChannels.out()<< "): (null)" - << llendl; + LL_INFOS() << "CHANNEL OUT(" << (*it).mChannels.out()<< "): (null)" + << LL_ENDL; } } #endif @@ -992,11 +993,11 @@ void LLPumpIO::processChain(LLChainInfo& chain) // below. if(LLIOPipe::isSuccess(status)) { - llinfos << "Pipe returned: '" + LL_INFOS() << "Pipe returned: '" #if LL_DEBUG_PIPE_TYPE_IN_PUMP << typeid(*((*it).mPipe)).name() << "':'" #endif - << LLIOPipe::lookupStatusString(status) << "'" << llendl; + << LLIOPipe::lookupStatusString(status) << "'" << LL_ENDL; } #endif @@ -1036,12 +1037,12 @@ void LLPumpIO::processChain(LLChainInfo& chain) PUMP_DEBUG; if(LLIOPipe::isError(status)) { - llinfos << "Pump generated pipe err: '" + LL_INFOS() << "Pump generated pipe err: '" #if LL_DEBUG_PIPE_TYPE_IN_PUMP << typeid(*((*it).mPipe)).name() << "':'" #endif << LLIOPipe::lookupStatusString(status) - << "'" << llendl; + << "'" << LL_ENDL; #if LL_DEBUG_SPEW_BUFFER_CHANNEL_IN_ON_ERROR if(chain.mData) { @@ -1058,18 +1059,18 @@ void LLPumpIO::processChain(LLChainInfo& chain) (U8*)buf, bytes); buf[bytes] = '\0'; - llinfos << "Input After Error: " << buf << llendl; + LL_INFOS() << "Input After Error: " << buf << LL_ENDL; delete[] buf; buf = NULL; } else { - llinfos << "Input After Error: (null)" << llendl; + LL_INFOS() << "Input After Error: (null)" << LL_ENDL; } } else { - llinfos << "Input After Error: (null)" << llendl; + LL_INFOS() << "Input After Error: (null)" << LL_ENDL; } #endif keep_going = false; @@ -1081,8 +1082,8 @@ void LLPumpIO::processChain(LLChainInfo& chain) } else { - llinfos << "Unhandled status code: " << status << ":" - << LLIOPipe::lookupStatusString(status) << llendl; + LL_INFOS() << "Unhandled status code: " << status << ":" + << LLIOPipe::lookupStatusString(status) << LL_ENDL; } break; } @@ -1129,8 +1130,8 @@ bool LLPumpIO::handleChainError( do { #if LL_DEBUG_PIPE_TYPE_IN_PUMP - lldebugs << "Passing error to " << typeid(*((*rit).mPipe)).name() - << "." << llendl; + LL_DEBUGS() << "Passing error to " << typeid(*((*rit).mPipe)).name() + << "." << LL_ENDL; #endif error = (*rit).mPipe->handleError(error, this); switch(error) @@ -1144,8 +1145,8 @@ bool LLPumpIO::handleChainError( case LLIOPipe::STATUS_BREAK: case LLIOPipe::STATUS_NEED_PROCESS: #if LL_DEBUG_PIPE_TYPE_IN_PUMP - lldebugs << "Pipe " << typeid(*((*rit).mPipe)).name() - << " returned code to stop error handler." << llendl; + LL_DEBUGS() << "Pipe " << typeid(*((*rit).mPipe)).name() + << " returned code to stop error handler." << LL_ENDL; #endif keep_going = false; break; @@ -1155,8 +1156,8 @@ bool LLPumpIO::handleChainError( default: if(LLIOPipe::isSuccess(error)) { - llinfos << "Unhandled status code: " << error << ":" - << LLIOPipe::lookupStatusString(error) << llendl; + LL_INFOS() << "Unhandled status code: " << error << ":" + << LLIOPipe::lookupStatusString(error) << LL_ENDL; error = LLIOPipe::STATUS_ERROR; keep_going = false; } diff --git a/indra/llmessage/llregionhandle.h b/indra/llmessage/llregionhandle.h index c77794e4b8..e3ddd46acd 100755 --- a/indra/llmessage/llregionhandle.h +++ b/indra/llmessage/llregionhandle.h @@ -68,7 +68,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl U32 x_int, y_int; if (x_pos < 0.f) { -// llwarns << "to_region_handle:Clamping negative x position " << x_pos << " to zero!" << llendl; +// LL_WARNS() << "to_region_handle:Clamping negative x position " << x_pos << " to zero!" << LL_ENDL; return FALSE; } else @@ -77,7 +77,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl } if (y_pos < 0.f) { -// llwarns << "to_region_handle:Clamping negative y position " << y_pos << " to zero!" << llendl; +// LL_WARNS() << "to_region_handle:Clamping negative y position " << y_pos << " to zero!" << LL_ENDL; return FALSE; } else diff --git a/indra/llmessage/llregionpresenceverifier.cpp b/indra/llmessage/llregionpresenceverifier.cpp index 932cbf375e..e6ed37028a 100755 --- a/indra/llmessage/llregionpresenceverifier.cpp +++ b/indra/llmessage/llregionpresenceverifier.cpp @@ -74,7 +74,7 @@ void LLRegionPresenceVerifier::RegionResponder::result(const LLSD& content) LLHost destination(host, port); LLUUID id = content["region_id"]; - lldebugs << "Verifying " << destination.getString() << " is region " << id << llendl; + LL_DEBUGS() << "Verifying " << destination.getString() << " is region " << id << LL_ENDL; std::stringstream uri; uri << "http://" << destination.getString() << "/state/basic/"; @@ -110,8 +110,8 @@ void LLRegionPresenceVerifier::VerifiedDestinationResponder::result(const LLSD& LLUUID actual_region_id = content["region_id"]; LLUUID expected_region_id = mContent["region_id"]; - lldebugs << "Actual region: " << content << llendl; - lldebugs << "Expected region: " << mContent << llendl; + LL_DEBUGS() << "Actual region: " << content << LL_ENDL; + LL_DEBUGS() << "Expected region: " << mContent << LL_ENDL; if (mSharedData->checkValidity(content) && (actual_region_id == expected_region_id)) @@ -124,7 +124,7 @@ void LLRegionPresenceVerifier::VerifiedDestinationResponder::result(const LLSD& } else { - llwarns << "Simulator verification failed. Region: " << mUri << llendl; + LL_WARNS() << "Simulator verification failed. Region: " << mUri << LL_ENDL; mSharedData->onRegionVerificationFailed(); } } @@ -133,8 +133,8 @@ void LLRegionPresenceVerifier::VerifiedDestinationResponder::retry() { LLSD headers; headers["Cache-Control"] = "no-cache, max-age=0"; - llinfos << "Requesting region information, get uncached for region " - << mUri << llendl; + LL_INFOS() << "Requesting region information, get uncached for region " + << mUri << LL_ENDL; --mRetryCount; mSharedData->getHttpClient().get(mUri, new RegionResponder(mUri, mSharedData, mRetryCount), headers); } @@ -147,7 +147,7 @@ void LLRegionPresenceVerifier::VerifiedDestinationResponder::error(U32 status, c } else { - llwarns << "Failed to contact simulator for verification. Region: " << mUri << llendl; + LL_WARNS() << "Failed to contact simulator for verification. Region: " << mUri << LL_ENDL; mSharedData->onRegionVerificationFailed(); } } diff --git a/indra/llmessage/llsdappservices.cpp b/indra/llmessage/llsdappservices.cpp index 8bab91b0c0..4103ece33a 100755 --- a/indra/llmessage/llsdappservices.cpp +++ b/indra/llmessage/llsdappservices.cpp @@ -119,8 +119,8 @@ public: virtual bool validate(const std::string& name, LLSD& context) const { - //llinfos << "validate: " << name << ", " - // << LLSDOStreamer<LLSDNotationFormatter>(context) << llendl; + //LL_INFOS() << "validate: " << name << ", " + // << LLSDOStreamer<LLSDNotationFormatter>(context) << LL_ENDL; if((std::string("PUT") == context["request"]["verb"].asString()) && !name.empty()) { return true; @@ -257,8 +257,8 @@ public: virtual bool validate(const std::string& name, LLSD& context) const { - llinfos << "LLHTTPLiveConfigSingleService::validate(" << name - << ")" << llendl; + LL_INFOS() << "LLHTTPLiveConfigSingleService::validate(" << name + << ")" << LL_ENDL; LLSD option = LLApp::instance()->getOption(name); if(option.isDefined()) return true; else return false; diff --git a/indra/llmessage/llsdmessage.cpp b/indra/llmessage/llsdmessage.cpp index 1c93c12d99..1d0904e3f1 100755 --- a/indra/llmessage/llsdmessage.cpp +++ b/indra/llmessage/llsdmessage.cpp @@ -128,7 +128,7 @@ void LLSDMessage::EventResponder::errorWithContent(U32 status, const std::string } else // default error handling { - // convention seems to be to use llinfos, but that seems a bit casual? + // convention seems to be to use LL_INFOS(), but that seems a bit casual? LL_WARNS("LLSDMessage::EventResponder") << "'" << mMessage << "' to '" << mTarget << "' failed with code " << status << ": " << reason << '\n' diff --git a/indra/llmessage/llsdmessagebuilder.cpp b/indra/llmessage/llsdmessagebuilder.cpp index 615221e0ad..49456c71ed 100755 --- a/indra/llmessage/llsdmessagebuilder.cpp +++ b/indra/llmessage/llsdmessagebuilder.cpp @@ -91,7 +91,7 @@ void LLSDMessageBuilder::nextBlock(const char* blockname) } else { - llerrs << "existing block not array" << llendl; + LL_ERRS() << "existing block not array" << LL_ENDL; } } @@ -380,7 +380,7 @@ void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data) break; default: - llwarns << "Unknown type in conversion of message to LLSD" << llendl; + LL_WARNS() << "Unknown type in conversion of message to LLSD" << LL_ENDL; break; } } @@ -391,7 +391,7 @@ void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data) void LLSDMessageBuilder::copyFromLLSD(const LLSD& msg) { mCurrentMessage = msg; - lldebugs << LLSDNotationStreamer(mCurrentMessage) << llendl; + LL_DEBUGS() << LLSDNotationStreamer(mCurrentMessage) << LL_ENDL; } const LLSD& LLSDMessageBuilder::getMessage() const diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp index a6fccd2a56..b729ebafa9 100755 --- a/indra/llmessage/llsdmessagereader.cpp +++ b/indra/llmessage/llsdmessagereader.cpp @@ -53,16 +53,16 @@ LLSDMessageReader::~LLSDMessageReader() LLSD getLLSD(const LLSD& input, const char* block, const char* var, S32 blocknum) { - // babbage: log error to llerrs if variable not found to mimic + // babbage: log error to LL_ERRS() if variable not found to mimic // LLTemplateMessageReader::getData behaviour if(NULL == block) { - llerrs << "NULL block name" << llendl; + LL_ERRS() << "NULL block name" << LL_ENDL; return LLSD(); } if(NULL == var) { - llerrs << "NULL var name" << llendl; + LL_ERRS() << "NULL var name" << LL_ENDL; return LLSD(); } if(! input[block].isArray()) @@ -70,7 +70,7 @@ LLSD getLLSD(const LLSD& input, const char* block, const char* var, S32 blocknum // NOTE: babbage: need to return default for missing blocks to allow // backwards/forwards compatibility - handlers must cope with default // values. - llwarns << "block " << block << " not found" << llendl; + LL_WARNS() << "block " << block << " not found" << LL_ENDL; return LLSD(); } @@ -80,7 +80,7 @@ LLSD getLLSD(const LLSD& input, const char* block, const char* var, S32 blocknum // NOTE: babbage: need to return default for missing vars to allow // backwards/forwards compatibility - handlers must cope with default // values. - llwarns << "var " << var << " not found" << llendl; + LL_WARNS() << "var " << var << " not found" << LL_ENDL; } return result; } @@ -238,7 +238,7 @@ void LLSDMessageReader::getString(const char *block, const char *var, { if(buffer_size <= 0) { - llwarns << "buffer_size <= 0" << llendl; + LL_WARNS() << "buffer_size <= 0" << LL_ENDL; return; } std::string data = getLLSD(mMessage, block, var, blocknum); diff --git a/indra/llmessage/llsdrpcclient.cpp b/indra/llmessage/llsdrpcclient.cpp index fcda0e81a3..eb773ceb3a 100755 --- a/indra/llmessage/llsdrpcclient.cpp +++ b/indra/llmessage/llsdrpcclient.cpp @@ -30,6 +30,7 @@ #include "llsdrpcclient.h" #include "llbufferstream.h" +#include "llfasttimer.h" #include "llfiltersd2xmlrpc.h" #include "llpumpio.h" #include "llsd.h" @@ -78,7 +79,7 @@ bool LLSDRPCResponse::extractResponse(const LLSD& sd) return rv; } -static LLFastTimer::DeclareTimer FTM_SDRPC_RESPONSE("SDRPC Response"); +static LLTrace::BlockTimerStatHandle FTM_SDRPC_RESPONSE("SDRPC Response"); // virtual LLIOPipe::EStatus LLSDRPCResponse::process_impl( @@ -88,7 +89,7 @@ LLIOPipe::EStatus LLSDRPCResponse::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_SDRPC_RESPONSE); + LL_RECORD_BLOCK_TIME(FTM_SDRPC_RESPONSE); PUMP_DEBUG; if(mIsError) { @@ -128,8 +129,8 @@ bool LLSDRPCClient::call( LLSDRPCResponse* response, EPassBackQueue queue) { - //llinfos << "RPC: " << uri << "." << method << "(" << *parameter << ")" - // << llendl; + //LL_INFOS() << "RPC: " << uri << "." << method << "(" << *parameter << ")" + // << LL_ENDL; if(method.empty() || !response) { return false; @@ -154,8 +155,8 @@ bool LLSDRPCClient::call( LLSDRPCResponse* response, EPassBackQueue queue) { - //llinfos << "RPC: " << uri << "." << method << "(" << parameter << ")" - // << llendl; + //LL_INFOS() << "RPC: " << uri << "." << method << "(" << parameter << ")" + // << LL_ENDL; if(method.empty() || parameter.empty() || !response) { return false; @@ -172,7 +173,7 @@ bool LLSDRPCClient::call( return true; } -static LLFastTimer::DeclareTimer FTM_PROCESS_SDRPC_CLIENT("SDRPC Client"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_SDRPC_CLIENT("SDRPC Client"); // virtual LLIOPipe::EStatus LLSDRPCClient::process_impl( @@ -182,7 +183,7 @@ LLIOPipe::EStatus LLSDRPCClient::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_SDRPC_CLIENT); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_SDRPC_CLIENT); PUMP_DEBUG; if((STATE_NONE == mState) || (!pump)) { @@ -195,7 +196,7 @@ LLIOPipe::EStatus LLSDRPCClient::process_impl( case STATE_READY: { PUMP_DEBUG; -// lldebugs << "LLSDRPCClient::process_impl STATE_READY" << llendl; +// LL_DEBUGS() << "LLSDRPCClient::process_impl STATE_READY" << LL_ENDL; buffer->append( channels.out(), (U8*)mRequest.c_str(), @@ -208,8 +209,8 @@ LLIOPipe::EStatus LLSDRPCClient::process_impl( { PUMP_DEBUG; // The input channel has the sd response in it. - //lldebugs << "LLSDRPCClient::process_impl STATE_WAITING_FOR_RESPONSE" - // << llendl; + //LL_DEBUGS() << "LLSDRPCClient::process_impl STATE_WAITING_FOR_RESPONSE" + // << LL_ENDL; LLBufferStream resp(channels, buffer.get()); LLSD sd; LLSDSerialize::fromNotation(sd, resp, buffer->count(channels.in())); @@ -236,7 +237,7 @@ LLIOPipe::EStatus LLSDRPCClient::process_impl( case STATE_DONE: default: PUMP_DEBUG; - llinfos << "invalid state to process" << llendl; + LL_INFOS() << "invalid state to process" << LL_ENDL; rv = STATUS_ERROR; break; } diff --git a/indra/llmessage/llsdrpcclient.h b/indra/llmessage/llsdrpcclient.h index 0cecf4f688..8eb7a08620 100755 --- a/indra/llmessage/llsdrpcclient.h +++ b/indra/llmessage/llsdrpcclient.h @@ -239,11 +239,11 @@ public: LLSDRPCClientFactory(const std::string& fixed_url) : mURL(fixed_url) {} virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const { - lldebugs << "LLSDRPCClientFactory::build" << llendl; + LL_DEBUGS() << "LLSDRPCClientFactory::build" << LL_ENDL; LLURLRequest* http(new LLURLRequest(LLURLRequest::HTTP_POST)); if(!http->isValid()) { - llwarns << "Creating LLURLRequest failed." << llendl ; + LL_WARNS() << "Creating LLURLRequest failed." << LL_ENDL ; delete http; return false; } @@ -289,12 +289,12 @@ public: LLXMLSDRPCClientFactory(const std::string& fixed_url) : mURL(fixed_url) {} virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const { - lldebugs << "LLXMLSDRPCClientFactory::build" << llendl; + LL_DEBUGS() << "LLXMLSDRPCClientFactory::build" << LL_ENDL; LLURLRequest* http(new LLURLRequest(LLURLRequest::HTTP_POST)); if(!http->isValid()) { - llwarns << "Creating LLURLRequest failed." << llendl ; + LL_WARNS() << "Creating LLURLRequest failed." << LL_ENDL ; delete http; return false ; } diff --git a/indra/llmessage/llsdrpcserver.cpp b/indra/llmessage/llsdrpcserver.cpp index f26ee52f71..c3ed19889e 100755 --- a/indra/llmessage/llsdrpcserver.cpp +++ b/indra/llmessage/llsdrpcserver.cpp @@ -31,6 +31,7 @@ #include "llbuffer.h" #include "llbufferstream.h" +#include "llfasttimer.h" #include "llpumpio.h" #include "llsdserialize.h" #include "llstl.h" @@ -94,7 +95,7 @@ void LLSDRPCServer::clearLock() } } -static LLFastTimer::DeclareTimer FTM_PROCESS_SDRPC_SERVER("SDRPC Server"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_SDRPC_SERVER("SDRPC Server"); // virtual LLIOPipe::EStatus LLSDRPCServer::process_impl( @@ -104,9 +105,9 @@ LLIOPipe::EStatus LLSDRPCServer::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_SDRPC_SERVER); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_SDRPC_SERVER); PUMP_DEBUG; -// lldebugs << "LLSDRPCServer::process_impl" << llendl; +// LL_DEBUGS() << "LLSDRPCServer::process_impl" << LL_ENDL; // Once we have all the data, We need to read the sd on // the the in channel, and respond on the out channel if(!eos) return STATUS_BREAK; @@ -131,10 +132,10 @@ LLIOPipe::EStatus LLSDRPCServer::process_impl( return STATUS_DONE; case STATE_DONE: -// lldebugs << "STATE_DONE" << llendl; +// LL_DEBUGS() << "STATE_DONE" << LL_ENDL; break; case STATE_CALLBACK: -// lldebugs << "STATE_CALLBACK" << llendl; +// LL_DEBUGS() << "STATE_CALLBACK" << LL_ENDL; PUMP_DEBUG; method_name = mRequest[LLSDRPC_METHOD_SD_NAME].asString(); if(!method_name.empty() && mRequest.has(LLSDRPC_PARAMETER_SD_NAME)) @@ -168,7 +169,7 @@ LLIOPipe::EStatus LLSDRPCServer::process_impl( mState = STATE_DONE; break; case STATE_NONE: -// lldebugs << "STATE_NONE" << llendl; +// LL_DEBUGS() << "STATE_NONE" << LL_ENDL; default: { // First time we got here - process the SD request, and call @@ -316,7 +317,7 @@ void LLSDRPCServer::buildFault( { LLBufferStream ostr(channels, data); ostr << FAULT_PART_1 << code << FAULT_PART_2 << msg << FAULT_PART_3; - llinfos << "LLSDRPCServer::buildFault: " << code << ", " << msg << llendl; + LL_INFOS() << "LLSDRPCServer::buildFault: " << code << ", " << msg << LL_ENDL; } // static @@ -333,6 +334,6 @@ void LLSDRPCServer::buildResponse( std::ostringstream debug_ostr; debug_ostr << "LLSDRPCServer::buildResponse: "; LLSDSerialize::toNotation(response, debug_ostr); - llinfos << debug_ostr.str() << llendl; + LL_INFOS() << debug_ostr.str() << LL_ENDL; #endif } diff --git a/indra/llmessage/llsdrpcserver.h b/indra/llmessage/llsdrpcserver.h index 9e56e4ea46..415bd31c26 100755 --- a/indra/llmessage/llsdrpcserver.h +++ b/indra/llmessage/llsdrpcserver.h @@ -323,7 +323,7 @@ class LLSDRPCServerFactory : public LLChainIOFactory public: virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const { - lldebugs << "LLXMLSDRPCServerFactory::build" << llendl; + LL_DEBUGS() << "LLXMLSDRPCServerFactory::build" << LL_ENDL; chain.push_back(LLIOPipe::ptr_t(new Server)); return true; } @@ -341,7 +341,7 @@ class LLXMLRPCServerFactory : public LLChainIOFactory public: virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const { - lldebugs << "LLXMLSDRPCServerFactory::build" << llendl; + LL_DEBUGS() << "LLXMLSDRPCServerFactory::build" << LL_ENDL; chain.push_back(LLIOPipe::ptr_t(new LLFilterXMLRPCRequest2LLSD)); chain.push_back(LLIOPipe::ptr_t(new Server)); chain.push_back(LLIOPipe::ptr_t(new LLFilterSD2XMLRPCResponse)); diff --git a/indra/llmessage/llservice.cpp b/indra/llmessage/llservice.cpp index dbec92c221..ddcc13d969 100755 --- a/indra/llmessage/llservice.cpp +++ b/indra/llmessage/llservice.cpp @@ -41,7 +41,7 @@ LLService::~LLService() // static bool LLService::registerCreator(const std::string& name, creator_t fn) { - llinfos << "LLService::registerCreator(" << name << ")" << llendl; + LL_INFOS() << "LLService::registerCreator(" << name << ")" << LL_ENDL; if(name.empty()) { return false; @@ -64,7 +64,7 @@ LLIOPipe* LLService::activate( { if(name.empty()) { - llinfos << "LLService::activate - no service specified." << llendl; + LL_INFOS() << "LLService::activate - no service specified." << LL_ENDL; return NULL; } creators_t::iterator it = sCreatorFunctors.find(name); @@ -79,15 +79,15 @@ LLIOPipe* LLService::activate( { // empty out the chain, because failed service creation // should just discard this stuff. - llwarns << "LLService::activate - unable to build chain: " << name - << llendl; + LL_WARNS() << "LLService::activate - unable to build chain: " << name + << LL_ENDL; chain.clear(); } } else { - llwarns << "LLService::activate - unable find factory: " << name - << llendl; + LL_WARNS() << "LLService::activate - unable find factory: " << name + << LL_ENDL; } return rv; } diff --git a/indra/llmessage/llservicebuilder.cpp b/indra/llmessage/llservicebuilder.cpp index b9aef3d0ba..392e7f1091 100755 --- a/indra/llmessage/llservicebuilder.cpp +++ b/indra/llmessage/llservicebuilder.cpp @@ -50,11 +50,11 @@ void LLServiceBuilder::loadServiceDefinitionsFromFile( std::string service_name = (*array_itr)["name"].asString(); createServiceDefinition(service_name, service_llsd); } - llinfos << "loaded config file: " << service_filename << llendl; + LL_INFOS() << "loaded config file: " << service_filename << LL_ENDL; } else { - llwarns << "unable to find config file: " << service_filename << llendl; + LL_WARNS() << "unable to find config file: " << service_filename << LL_ENDL; } } @@ -119,7 +119,7 @@ std::string LLServiceBuilder::buildServiceURI(const std::string& service_name) c } else { - llwarns << "Cannot find service " << service_name << llendl; + LL_WARNS() << "Cannot find service " << service_name << LL_ENDL; } return service_url.str(); } @@ -204,9 +204,9 @@ std::string russ_format(const std::string& format_str, const LLSD& context) } else { - llwarns << "Unknown key: " << key << " in option map: " + LL_WARNS() << "Unknown key: " << key << " in option map: " << LLSDOStreamer<LLSDNotationFormatter>(context) - << llendl; + << LL_ENDL; keep_looping = false; } break; @@ -220,8 +220,8 @@ std::string russ_format(const std::string& format_str, const LLSD& context) } break; default: - llinfos << "Unknown directive: " << *(deepest_node + 1) - << llendl; + LL_INFOS() << "Unknown directive: " << *(deepest_node + 1) + << LL_ENDL; keep_looping = false; break; } @@ -229,8 +229,8 @@ std::string russ_format(const std::string& format_str, const LLSD& context) } if (service_url.find('{') != std::string::npos) { - llwarns << "Constructed a likely bogus service URL: " << service_url - << llendl; + LL_WARNS() << "Constructed a likely bogus service URL: " << service_url + << LL_ENDL; } return service_url; } diff --git a/indra/llmessage/lltemplatemessagebuilder.cpp b/indra/llmessage/lltemplatemessagebuilder.cpp index 9e8eb48460..8d7c4c0282 100755 --- a/indra/llmessage/lltemplatemessagebuilder.cpp +++ b/indra/llmessage/lltemplatemessagebuilder.cpp @@ -81,7 +81,7 @@ void LLTemplateMessageBuilder::newMessage(const char *name) if (msg_template->getDeprecation() != MD_NOTDEPRECATED) { - llwarns << "Sending deprecated message " << namep << llendl; + LL_WARNS() << "Sending deprecated message " << namep << LL_ENDL; } LLMessageTemplate::message_block_map_t::const_iterator iter; @@ -96,7 +96,7 @@ void LLTemplateMessageBuilder::newMessage(const char *name) } else { - llerrs << "newMessage - Message " << name << " not registered" << llendl; + LL_ERRS() << "newMessage - Message " << name << " not registered" << LL_ENDL; } } @@ -125,7 +125,7 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname) if (!mCurrentSMessageTemplate) { - llerrs << "newMessage not called prior to setBlock" << llendl; + LL_ERRS() << "newMessage not called prior to setBlock" << LL_ENDL; return; } @@ -133,8 +133,8 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname) const LLMessageBlock* template_data = mCurrentSMessageTemplate->getBlock(bnamep); if (!template_data) { - llerrs << "LLTemplateMessageBuilder::nextBlock " << bnamep - << " not a block in " << mCurrentSMessageTemplate->mName << llendl; + LL_ERRS() << "LLTemplateMessageBuilder::nextBlock " << bnamep + << " not a block in " << mCurrentSMessageTemplate->mName << LL_ENDL; return; } @@ -164,8 +164,8 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname) // if the block is type MBT_SINGLE this is bad! if (template_data->mType == MBT_SINGLE) { - llerrs << "LLTemplateMessageBuilder::nextBlock called multiple times" - << " for " << bnamep << " but is type MBT_SINGLE" << llendl; + LL_ERRS() << "LLTemplateMessageBuilder::nextBlock called multiple times" + << " for " << bnamep << " but is type MBT_SINGLE" << LL_ENDL; return; } @@ -175,10 +175,10 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname) if ( (template_data->mType == MBT_MULTIPLE) &&(mCurrentSDataBlock->mBlockNumber == template_data->mNumber)) { - llerrs << "LLTemplateMessageBuilder::nextBlock called " + LL_ERRS() << "LLTemplateMessageBuilder::nextBlock called " << mCurrentSDataBlock->mBlockNumber << " times for " << bnamep << " exceeding " << template_data->mNumber - << " specified in type MBT_MULTIPLE." << llendl; + << " specified in type MBT_MULTIPLE." << LL_ENDL; return; } @@ -191,8 +191,8 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname) if (block_data->mBlockNumber > MAX_BLOCKS) { - llerrs << "Trying to pack too many blocks into MBT_VARIABLE type " - << "(limited to " << MAX_BLOCKS << ")" << llendl; + LL_ERRS() << "Trying to pack too many blocks into MBT_VARIABLE type " + << "(limited to " << MAX_BLOCKS << ")" << LL_ENDL; } // create new name @@ -263,11 +263,11 @@ BOOL LLTemplateMessageBuilder::removeLastBlock() if (num_blocks <= 1) { // we just blew away the last one, so return FALSE - llwarns << "not blowing away the only block of message " + LL_WARNS() << "not blowing away the only block of message " << mCurrentSMessageName << ". Block: " << block_name << ". Number: " << num_blocks - << llendl; + << LL_ENDL; return FALSE; } else @@ -290,14 +290,14 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM // do we have a current message? if (!mCurrentSMessageTemplate) { - llerrs << "newMessage not called prior to addData" << llendl; + LL_ERRS() << "newMessage not called prior to addData" << LL_ENDL; return; } // do we have a current block? if (!mCurrentSDataBlock) { - llerrs << "setBlock not called prior to addData" << llendl; + LL_ERRS() << "setBlock not called prior to addData" << LL_ENDL; return; } @@ -305,7 +305,7 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM const LLMessageVariable* var_data = mCurrentSMessageTemplate->getBlock(mCurrentSBlockName)->getVariable(vnamep); if (!var_data || !var_data->getName()) { - llerrs << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << llendl; + LL_ERRS() << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << LL_ENDL; return; } @@ -316,9 +316,9 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM if ((var_data->getSize() == 1) && (size > 255)) { - llwarns << "Field " << varname << " is a Variable 1 but program " + LL_WARNS() << "Field " << varname << " is a Variable 1 but program " << "attempted to stuff more than 255 bytes in " - << "(" << size << "). Clamping size and truncating data." << llendl; + << "(" << size << "). Clamping size and truncating data." << LL_ENDL; size = 255; char *truncate = (char *)data; truncate[254] = 0; // array size is 255 but the last element index is 254 @@ -332,8 +332,8 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM { if (size != var_data->getSize()) { - llerrs << varname << " is type MVT_FIXED but request size " << size << " doesn't match template size " - << var_data->getSize() << llendl; + LL_ERRS() << varname << " is type MVT_FIXED but request size " << size << " doesn't match template size " + << var_data->getSize() << LL_ENDL; return; } // alright, smash it in @@ -350,14 +350,14 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM // do we have a current message? if (!mCurrentSMessageTemplate) { - llerrs << "newMessage not called prior to addData" << llendl; + LL_ERRS() << "newMessage not called prior to addData" << LL_ENDL; return; } // do we have a current block? if (!mCurrentSDataBlock) { - llerrs << "setBlock not called prior to addData" << llendl; + LL_ERRS() << "setBlock not called prior to addData" << LL_ENDL; return; } @@ -365,7 +365,7 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM const LLMessageVariable* var_data = mCurrentSMessageTemplate->getBlock(mCurrentSBlockName)->getVariable(vnamep); if (!var_data->getName()) { - llerrs << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << llendl; + LL_ERRS() << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << LL_ENDL; return; } @@ -373,7 +373,7 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM if (var_data->getType() == MVT_VARIABLE) { // nope - llerrs << vnamep << " is type MVT_VARIABLE. Call using addData(name, data, size)" << llendl; + LL_ERRS() << vnamep << " is type MVT_VARIABLE. Call using addData(name, data, size)" << LL_ENDL; return; } else @@ -643,8 +643,8 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat // Just reporting error is likely not enough. Need // to check how to abort or error out gracefully // from this function. XXXTBD - llerrs << "buildBlock failed. Message excedding " - << "sendBuffersize." << llendl; + LL_ERRS() << "buildBlock failed. Message excedding " + << "sendBuffersize." << LL_ENDL; } } else if (template_data->mType == MBT_MULTIPLE) @@ -652,10 +652,10 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat if (block_count != template_data->mNumber) { // nope! need to fill it in all the way! - llerrs << "Block " << mbci->mName + LL_ERRS() << "Block " << mbci->mName << " is type MBT_MULTIPLE but only has data for " << block_count << " out of its " - << template_data->mNumber << " blocks" << llendl; + << template_data->mNumber << " blocks" << LL_ENDL; } } @@ -669,10 +669,10 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat if (mvci.getSize() == -1) { // oops, this variable wasn't ever set! - llerrs << "The variable " << mvci.getName() << " in block " + LL_ERRS() << "The variable " << mvci.getName() << " in block " << mbci->mName << " of message " << template_data->mName - << " wasn't set prior to buildMessage call" << llendl; + << " wasn't set prior to buildMessage call" << LL_ENDL; } else { @@ -699,7 +699,7 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat htonmemcpy(&buffer[result], &size, MVT_S32, 4); break; default: - llerrs << "Attempting to build variable field with unknown size of " << size << llendl; + LL_ERRS() << "Attempting to build variable field with unknown size of " << size << LL_ENDL; break; } result += mvci.getDataSize(); @@ -721,11 +721,11 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat // Just reporting error is likely not // enough. Need to check how to abort or error // out gracefully from this function. XXXTBD - llerrs << "buildBlock failed. " + LL_ERRS() << "buildBlock failed. " << "Attempted to pack " << (result + mvci.getSize()) << " bytes into a buffer with size " - << buffer_size << "." << llendl; + << buffer_size << "." << LL_ENDL; } } } @@ -760,7 +760,7 @@ U32 LLTemplateMessageBuilder::buildMessage( // do we have a current message? if (!mCurrentSMessageTemplate) { - llerrs << "newMessage not called prior to buildMessage" << llendl; + LL_ERRS() << "newMessage not called prior to buildMessage" << LL_ENDL; return 0; } @@ -809,7 +809,7 @@ U32 LLTemplateMessageBuilder::buildMessage( } else { - llerrs << "unexpected message frequency in buildMessage" << llendl; + LL_ERRS() << "unexpected message frequency in buildMessage" << LL_ENDL; return 0; } diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp index 94bc7cb045..406afadd2f 100755 --- a/indra/llmessage/lltemplatemessagereader.cpp +++ b/indra/llmessage/lltemplatemessagereader.cpp @@ -68,13 +68,13 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname // is there a message ready to go? if (mReceiveSize == -1) { - llerrs << "No message waiting for decode 2!" << llendl; + LL_ERRS() << "No message waiting for decode 2!" << LL_ENDL; return; } if (!mCurrentRMessageData) { - llerrs << "Invalid mCurrentMessageData in getData!" << llendl; + LL_ERRS() << "Invalid mCurrentMessageData in getData!" << LL_ENDL; return; } @@ -85,8 +85,8 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname if (iter == mCurrentRMessageData->mMemberBlocks.end()) { - llerrs << "Block " << blockname << " #" << blocknum - << " not in message " << mCurrentRMessageData->mName << llendl; + LL_ERRS() << "Block " << blockname << " #" << blocknum + << " not in message " << mCurrentRMessageData->mName << LL_ENDL; return; } @@ -95,8 +95,8 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname if (var_data_map.find(vnamep) == var_data_map.end()) { - llerrs << "Variable "<< vnamep << " not in message " - << mCurrentRMessageData->mName<< " block " << bnamep << llendl; + LL_ERRS() << "Variable "<< vnamep << " not in message " + << mCurrentRMessageData->mName<< " block " << bnamep << LL_ENDL; return; } @@ -104,11 +104,11 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname if (size && size != vardata.getSize()) { - llerrs << "Msg " << mCurrentRMessageData->mName + LL_ERRS() << "Msg " << mCurrentRMessageData->mName << " variable " << vnamep << " is size " << vardata.getSize() << " but copying into buffer of size " << size - << llendl; + << LL_ENDL; return; } @@ -138,11 +138,11 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname } else { - llwarns << "Msg " << mCurrentRMessageData->mName + LL_WARNS() << "Msg " << mCurrentRMessageData->mName << " variable " << vnamep << " is size " << vardata.getSize() << " but truncated to max size of " << max_size - << llendl; + << LL_ENDL; memcpy(datap, vardata.getData(), max_size); } @@ -153,13 +153,13 @@ S32 LLTemplateMessageReader::getNumberOfBlocks(const char *blockname) // is there a message ready to go? if (mReceiveSize == -1) { - llerrs << "No message waiting for decode 3!" << llendl; + LL_ERRS() << "No message waiting for decode 3!" << LL_ENDL; return -1; } if (!mCurrentRMessageData) { - llerrs << "Invalid mCurrentRMessageData in getData!" << llendl; + LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL; return -1; } @@ -180,13 +180,13 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, const char *varname) // is there a message ready to go? if (mReceiveSize == -1) { // This is a serious error - crash - llerrs << "No message waiting for decode 4!" << llendl; + LL_ERRS() << "No message waiting for decode 4!" << LL_ENDL; return LL_MESSAGE_ERROR; } if (!mCurrentRMessageData) { // This is a serious error - crash - llerrs << "Invalid mCurrentRMessageData in getData!" << llendl; + LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL; return LL_MESSAGE_ERROR; } @@ -196,8 +196,8 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, const char *varname) if (iter == mCurrentRMessageData->mMemberBlocks.end()) { // don't crash - llinfos << "Block " << bnamep << " not in message " - << mCurrentRMessageData->mName << llendl; + LL_INFOS() << "Block " << bnamep << " not in message " + << mCurrentRMessageData->mName << LL_ENDL; return LL_BLOCK_NOT_IN_MESSAGE; } @@ -208,15 +208,15 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, const char *varname) if (!vardata.getName()) { // don't crash - llinfos << "Variable " << varname << " not in message " - << mCurrentRMessageData->mName << " block " << bnamep << llendl; + LL_INFOS() << "Variable " << varname << " not in message " + << mCurrentRMessageData->mName << " block " << bnamep << LL_ENDL; return LL_VARIABLE_NOT_IN_BLOCK; } if (mCurrentRMessageTemplate->mMemberBlocks[bnamep]->mType != MBT_SINGLE) { // This is a serious error - crash - llerrs << "Block " << bnamep << " isn't type MBT_SINGLE," - " use getSize with blocknum argument!" << llendl; + LL_ERRS() << "Block " << bnamep << " isn't type MBT_SINGLE," + " use getSize with blocknum argument!" << LL_ENDL; return LL_MESSAGE_ERROR; } @@ -228,13 +228,13 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const // is there a message ready to go? if (mReceiveSize == -1) { // This is a serious error - crash - llerrs << "No message waiting for decode 5!" << llendl; + LL_ERRS() << "No message waiting for decode 5!" << LL_ENDL; return LL_MESSAGE_ERROR; } if (!mCurrentRMessageData) { // This is a serious error - crash - llerrs << "Invalid mCurrentRMessageData in getData!" << llendl; + LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL; return LL_MESSAGE_ERROR; } @@ -245,8 +245,8 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const if (iter == mCurrentRMessageData->mMemberBlocks.end()) { // don't crash - llinfos << "Block " << bnamep << " not in message " - << mCurrentRMessageData->mName << llendl; + LL_INFOS() << "Block " << bnamep << " not in message " + << mCurrentRMessageData->mName << LL_ENDL; return LL_BLOCK_NOT_IN_MESSAGE; } @@ -255,8 +255,8 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const if (!vardata.getName()) { // don't crash - llinfos << "Variable " << vnamep << " not in message " - << mCurrentRMessageData->mName << " block " << bnamep << llendl; + LL_INFOS() << "Variable " << vnamep << " not in message " + << mCurrentRMessageData->mName << " block " << bnamep << LL_ENDL; return LL_VARIABLE_NOT_IN_BLOCK; } @@ -328,8 +328,8 @@ void LLTemplateMessageReader::getF32(const char *block, const char *var, if( !llfinite( d ) ) { - llwarns << "non-finite in getF32Fast " << block << " " << var - << llendl; + LL_WARNS() << "non-finite in getF32Fast " << block << " " << var + << LL_ENDL; d = 0; } } @@ -341,8 +341,8 @@ void LLTemplateMessageReader::getF64(const char *block, const char *var, if( !llfinite( d ) ) { - llwarns << "non-finite in getF64Fast " << block << " " << var - << llendl; + LL_WARNS() << "non-finite in getF64Fast " << block << " " << var + << LL_ENDL; d = 0; } } @@ -354,8 +354,8 @@ void LLTemplateMessageReader::getVector3(const char *block, const char *var, if( !v.isFinite() ) { - llwarns << "non-finite in getVector3Fast " << block << " " - << var << llendl; + LL_WARNS() << "non-finite in getVector3Fast " << block << " " + << var << LL_ENDL; v.zeroVec(); } } @@ -367,8 +367,8 @@ void LLTemplateMessageReader::getVector4(const char *block, const char *var, if( !v.isFinite() ) { - llwarns << "non-finite in getVector4Fast " << block << " " - << var << llendl; + LL_WARNS() << "non-finite in getVector4Fast " << block << " " + << var << LL_ENDL; v.zeroVec(); } } @@ -380,8 +380,8 @@ void LLTemplateMessageReader::getVector3d(const char *block, const char *var, if( !v.isFinite() ) { - llwarns << "non-finite in getVector3dFast " << block << " " - << var << llendl; + LL_WARNS() << "non-finite in getVector3dFast " << block << " " + << var << LL_ENDL; v.zeroVec(); } @@ -398,8 +398,8 @@ void LLTemplateMessageReader::getQuat(const char *block, const char *var, } else { - llwarns << "non-finite in getQuatFast " << block << " " << var - << llendl; + LL_WARNS() << "non-finite in getQuatFast " << block << " " << var + << LL_ENDL; q.loadIdentity(); } } @@ -452,7 +452,7 @@ BOOL LLTemplateMessageReader::decodeTemplate( // is there a message ready to go? if (buffer_size <= 0) { - llwarns << "No message waiting for decode!" << llendl; + LL_WARNS() << "No message waiting for decode!" << LL_ENDL; return(FALSE); } @@ -487,8 +487,8 @@ BOOL LLTemplateMessageReader::decodeTemplate( } else // bogus packet received (too short) { - llwarns << "Packet with unusable length received (too short): " - << buffer_size << llendl; + LL_WARNS() << "Packet with unusable length received (too short): " + << buffer_size << LL_ENDL; return(FALSE); } @@ -499,8 +499,8 @@ BOOL LLTemplateMessageReader::decodeTemplate( } else { - llwarns << "Message #" << std::hex << num << std::dec - << " received but not registered!" << llendl; + LL_WARNS() << "Message #" << std::hex << num << std::dec + << " received but not registered!" << LL_ENDL; gMessageSystem->callExceptionFunc(MX_UNREGISTERED_MESSAGE); return(FALSE); } @@ -511,23 +511,23 @@ BOOL LLTemplateMessageReader::decodeTemplate( void LLTemplateMessageReader::logRanOffEndOfPacket( const LLHost& host, const S32 where, const S32 wanted ) { // we've run off the end of the packet! - llwarns << "Ran off end of packet " << mCurrentRMessageTemplate->mName + LL_WARNS() << "Ran off end of packet " << mCurrentRMessageTemplate->mName // << " with id " << mCurrentRecvPacketID << " from " << host << " trying to read " << wanted << " bytes at position " << where << " going past packet end at " << mReceiveSize - << llendl; + << LL_ENDL; if(gMessageSystem->mVerboseLog) { - llinfos << "MSG: -> " << host << "\tREAD PAST END:\t" + LL_INFOS() << "MSG: -> " << host << "\tREAD PAST END:\t" // << mCurrentRecvPacketID << " " - << getMessageName() << llendl; + << getMessageName() << LL_ENDL; } gMessageSystem->callExceptionFunc(MX_RAN_OFF_END_OF_PACKET); } -static LLFastTimer::DeclareTimer FTM_PROCESS_MESSAGES("Process Messages"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_MESSAGES("Process Messages"); // decode a given message BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender ) @@ -588,7 +588,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender } else { - llerrs << "Unknown block type" << llendl; + LL_ERRS() << "Unknown block type" << LL_ENDL; return FALSE; } @@ -655,7 +655,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender htonmemcpy(&tsize, &buffer[decode_pos], MVT_U32, 4); break; default: - llerrs << "Attempting to read variable field with unknown size of " << data_size << llendl; + LL_ERRS() << "Attempting to read variable field with unknown size of " << data_size << LL_ENDL; break; } } @@ -694,7 +694,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender if (mCurrentRMessageData->mMemberBlocks.empty() && !mCurrentRMessageTemplate->mMemberBlocks.empty()) { - lldebugs << "Empty message '" << mCurrentRMessageTemplate->mName << "' (no blocks)" << llendl; + LL_DEBUGS() << "Empty message '" << mCurrentRMessageTemplate->mName << "' (no blocks)" << LL_ENDL; return FALSE; } @@ -707,10 +707,10 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender } { - LLFastTimer t(FTM_PROCESS_MESSAGES); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_MESSAGES); if( !mCurrentRMessageTemplate->callHandlerFunc(gMessageSystem) ) { - llwarns << "Message from " << sender << " with no handler function received: " << mCurrentRMessageTemplate->mName << llendl; + LL_WARNS() << "Message from " << sender << " with no handler function received: " << mCurrentRMessageTemplate->mName << LL_ENDL; } } @@ -740,9 +740,9 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender if(decode_time > LLMessageReader::getTimeDecodesSpamThreshold()) { - lldebugs << "--------- Message " << mCurrentRMessageTemplate->mName << " decode took " << decode_time << " seconds. (" << + LL_DEBUGS() << "--------- Message " << mCurrentRMessageTemplate->mName << " decode took " << decode_time << " seconds. (" << mCurrentRMessageTemplate->mMaxDecodeTimePerMsg << " max, " << - (mCurrentRMessageTemplate->mTotalDecodeTime / mCurrentRMessageTemplate->mTotalDecoded) << " avg)" << llendl; + (mCurrentRMessageTemplate->mTotalDecodeTime / mCurrentRMessageTemplate->mTotalDecoded) << " avg)" << LL_ENDL; } } } @@ -760,9 +760,9 @@ BOOL LLTemplateMessageReader::validateMessage(const U8* buffer, if(valid) { mCurrentRMessageTemplate->mReceiveCount++; - //lldebugs << "MessageRecvd:" + //LL_DEBUGS() << "MessageRecvd:" // << mCurrentRMessageTemplate->mName - // << " from " << sender << llendl; + // << " from " << sender << LL_ENDL; } if (valid && isBanned(trusted)) @@ -772,15 +772,15 @@ BOOL LLTemplateMessageReader::validateMessage(const U8* buffer, << getMessageName() << " from " << ((trusted) ? "trusted " : "untrusted ") - << sender << llendl; + << sender << LL_ENDL; valid = FALSE; } if(valid && isUdpBanned()) { - llwarns << "Received UDP black listed message " + LL_WARNS() << "Received UDP black listed message " << getMessageName() - << " from " << sender << llendl; + << " from " << sender << LL_ENDL; valid = FALSE; } return valid; diff --git a/indra/llmessage/llthrottle.cpp b/indra/llmessage/llthrottle.cpp index 64ebd51fec..e484bd258d 100755 --- a/indra/llmessage/llthrottle.cpp +++ b/indra/llmessage/llthrottle.cpp @@ -53,8 +53,8 @@ F32 LLThrottle::getAvailable() { // use a temporary bits_available // since we don't want to change mBitsAvailable every time - F32 elapsed_time = (F32)(LLMessageSystem::getMessageTimeSeconds() - mLastSendTime); - return mAvailable + (mRate * elapsed_time); + F32Seconds elapsed_time = LLMessageSystem::getMessageTimeSeconds() - mLastSendTime; + return mAvailable + (mRate * elapsed_time.value()); } BOOL LLThrottle::checkOverflow(const F32 amount) @@ -65,8 +65,8 @@ BOOL LLThrottle::checkOverflow(const F32 amount) // use a temporary bits_available // since we don't want to change mBitsAvailable every time - F32 elapsed_time = (F32)(LLMessageSystem::getMessageTimeSeconds() - mLastSendTime); - F32 amount_available = mAvailable + (mRate * elapsed_time); + F32Seconds elapsed_time = LLMessageSystem::getMessageTimeSeconds() - mLastSendTime; + F32 amount_available = mAvailable + (mRate * elapsed_time.value()); if ((amount_available >= lookahead_amount) || (amount_available > amount)) { @@ -80,17 +80,17 @@ BOOL LLThrottle::checkOverflow(const F32 amount) BOOL LLThrottle::throttleOverflow(const F32 amount) { - F32 elapsed_time; + F32Seconds elapsed_time; F32 lookahead_amount; BOOL retval = TRUE; lookahead_amount = mRate * mLookaheadSecs; - F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(); - elapsed_time = (F32)(mt_sec - mLastSendTime); + F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds(); + elapsed_time = mt_sec - mLastSendTime; mLastSendTime = mt_sec; - mAvailable += mRate * elapsed_time; + mAvailable += mRate * elapsed_time.value(); if (mAvailable >= lookahead_amount) { @@ -222,7 +222,7 @@ void LLThrottleGroup::unpackThrottle(LLDataPacker &dp) // into NOT resetting the system. void LLThrottleGroup::resetDynamicAdjust() { - F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(); + F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds(); S32 i; for (i = 0; i < TC_EOF; i++) { @@ -269,8 +269,8 @@ S32 LLThrottleGroup::getAvailable(S32 throttle_cat) // use a temporary bits_available // since we don't want to change mBitsAvailable every time - F32 elapsed_time = (F32)(LLMessageSystem::getMessageTimeSeconds() - mLastSendTime[throttle_cat]); - F32 bits_available = mBitsAvailable[throttle_cat] + (category_bps * elapsed_time); + F32Seconds elapsed_time = LLMessageSystem::getMessageTimeSeconds() - mLastSendTime[throttle_cat]; + F32 bits_available = mBitsAvailable[throttle_cat] + (category_bps * elapsed_time.value()); if (bits_available >= lookahead_bits) { @@ -294,8 +294,8 @@ BOOL LLThrottleGroup::checkOverflow(S32 throttle_cat, F32 bits) // use a temporary bits_available // since we don't want to change mBitsAvailable every time - F32 elapsed_time = (F32)(LLMessageSystem::getMessageTimeSeconds() - mLastSendTime[throttle_cat]); - F32 bits_available = mBitsAvailable[throttle_cat] + (category_bps * elapsed_time); + F32Seconds elapsed_time = LLMessageSystem::getMessageTimeSeconds() - mLastSendTime[throttle_cat]; + F32 bits_available = mBitsAvailable[throttle_cat] + (category_bps * elapsed_time.value()); if (bits_available >= lookahead_bits) { @@ -315,7 +315,7 @@ BOOL LLThrottleGroup::checkOverflow(S32 throttle_cat, F32 bits) BOOL LLThrottleGroup::throttleOverflow(S32 throttle_cat, F32 bits) { - F32 elapsed_time; + F32Seconds elapsed_time; F32 category_bps; F32 lookahead_bits; BOOL retval = TRUE; @@ -323,10 +323,10 @@ BOOL LLThrottleGroup::throttleOverflow(S32 throttle_cat, F32 bits) category_bps = mCurrentBPS[throttle_cat]; lookahead_bits = category_bps * THROTTLE_LOOKAHEAD_TIME; - F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(); - elapsed_time = (F32)(mt_sec - mLastSendTime[throttle_cat]); + F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds(); + elapsed_time = mt_sec - mLastSendTime[throttle_cat]; mLastSendTime[throttle_cat] = mt_sec; - mBitsAvailable[throttle_cat] += category_bps * elapsed_time; + mBitsAvailable[throttle_cat] += category_bps * elapsed_time.value(); if (mBitsAvailable[throttle_cat] >= lookahead_bits) { @@ -356,7 +356,7 @@ BOOL LLThrottleGroup::throttleOverflow(S32 throttle_cat, F32 bits) BOOL LLThrottleGroup::dynamicAdjust() { - const F32 DYNAMIC_ADJUST_TIME = 1.0f; // seconds + const F32Seconds DYNAMIC_ADJUST_TIME(1.0f); const F32 CURRENT_PERIOD_WEIGHT = .25f; // how much weight to give to last period while determining BPS utilization const F32 BUSY_PERCENT = 0.75f; // if use more than this fraction of BPS, you are busy const F32 IDLE_PERCENT = 0.70f; // if use less than this fraction, you are "idle" @@ -365,7 +365,7 @@ BOOL LLThrottleGroup::dynamicAdjust() S32 i; - F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(); + F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds(); // Only dynamically adjust every few seconds if ((mt_sec - mDynamicAdjustTime) < DYNAMIC_ADJUST_TIME) @@ -405,7 +405,7 @@ BOOL LLThrottleGroup::dynamicAdjust() for (i = 0; i < TC_EOF; i++) { // Is this a busy channel? - if (mBitsSentHistory[i] >= BUSY_PERCENT * DYNAMIC_ADJUST_TIME * mCurrentBPS[i]) + if (mBitsSentHistory[i] >= BUSY_PERCENT * DYNAMIC_ADJUST_TIME.value() * mCurrentBPS[i]) { // this channel is busy channels_busy = TRUE; @@ -418,7 +418,7 @@ BOOL LLThrottleGroup::dynamicAdjust() } // Is this an idle channel? - if ((mBitsSentHistory[i] < IDLE_PERCENT * DYNAMIC_ADJUST_TIME * mCurrentBPS[i]) && + if ((mBitsSentHistory[i] < IDLE_PERCENT * DYNAMIC_ADJUST_TIME.value() * mCurrentBPS[i]) && (mBitsAvailable[i] > 0)) { channel_idle[i] = TRUE; @@ -440,8 +440,8 @@ BOOL LLThrottleGroup::dynamicAdjust() //if (total) //{ - // llinfos << i << ": B" << channel_busy[i] << " I" << channel_idle[i] << " N" << channel_over_nominal[i]; - // llcont << " Nom: " << mNominalBPS[i] << " Cur: " << mCurrentBPS[i] << " BS: " << mBitsSentHistory[i] << llendl; + // LL_INFOS() << i << ": B" << channel_busy[i] << " I" << channel_idle[i] << " N" << channel_over_nominal[i]; + // LL_CONT << " Nom: " << mNominalBPS[i] << " Cur: " << mCurrentBPS[i] << " BS: " << mBitsSentHistory[i] << LL_ENDL; //} } @@ -462,7 +462,7 @@ BOOL LLThrottleGroup::dynamicAdjust() // Therefore it's a candidate to give up some bandwidth. // Figure out how much bandwidth it has been using, and how // much is available to steal. - used_bps = mBitsSentHistory[i] / DYNAMIC_ADJUST_TIME; + used_bps = mBitsSentHistory[i] / DYNAMIC_ADJUST_TIME.value(); // CRO make sure to keep a minimum amount of throttle available // CRO NB: channels set to < MINIMUM_BPS will never give up bps, @@ -482,7 +482,7 @@ BOOL LLThrottleGroup::dynamicAdjust() avail_bps = mCurrentBPS[i] - used_bps; } - //llinfos << i << " avail " << avail_bps << llendl; + //LL_INFOS() << i << " avail " << avail_bps << LL_ENDL; // Historically, a channel could have used more than its current share, // even if it's idle right now. @@ -499,7 +499,7 @@ BOOL LLThrottleGroup::dynamicAdjust() } } - //llinfos << "Pool BPS: " << pool_bps << llendl; + //LL_INFOS() << "Pool BPS: " << pool_bps << LL_ENDL; // Now redistribute the bandwidth to busy channels. F32 unused_bps = 0.f; @@ -508,7 +508,7 @@ BOOL LLThrottleGroup::dynamicAdjust() if (channel_busy[i]) { F32 add_amount = pool_bps * (mNominalBPS[i] / busy_nominal_sum); - //llinfos << "Busy " << i << " gets " << pool_bps << llendl; + //LL_INFOS() << "Busy " << i << " gets " << pool_bps << LL_ENDL; mCurrentBPS[i] += add_amount; // CRO: make sure this doesn't get too huge diff --git a/indra/llmessage/llthrottle.h b/indra/llmessage/llthrottle.h index ed0aeb4602..e43e54f61b 100755 --- a/indra/llmessage/llthrottle.h +++ b/indra/llmessage/llthrottle.h @@ -50,7 +50,7 @@ private: F32 mLookaheadSecs; // Seconds to look ahead, maximum F32 mRate; // BPS available, dynamically adjusted F32 mAvailable; // Bits available to send right now on each channel - F64 mLastSendTime; // Time since last send on this channel + F64Seconds mLastSendTime; // Time since last send on this channel }; typedef enum e_throttle_categories @@ -93,8 +93,8 @@ protected: F32 mBitsSentThisPeriod[TC_EOF]; // Sent in this dynamic allocation period F32 mBitsSentHistory[TC_EOF]; // Sent before this dynamic allocation period, adjusted to one period length - F64 mLastSendTime[TC_EOF]; // Time since last send on this channel - F64 mDynamicAdjustTime; // Only dynamic adjust every 2 seconds or so. + F64Seconds mLastSendTime[TC_EOF]; // Time since last send on this channel + F64Seconds mDynamicAdjustTime; // Only dynamic adjust every 2 seconds or so. }; diff --git a/indra/llmessage/lltransfermanager.cpp b/indra/llmessage/lltransfermanager.cpp index 38b743fb75..d6db20d7a3 100755 --- a/indra/llmessage/lltransfermanager.cpp +++ b/indra/llmessage/lltransfermanager.cpp @@ -64,7 +64,7 @@ LLTransferManager::~LLTransferManager() { if (mValid) { - llwarns << "LLTransferManager::~LLTransferManager - Should have been cleaned up by message system shutdown process" << llendl; + LL_WARNS() << "LLTransferManager::~LLTransferManager - Should have been cleaned up by message system shutdown process" << LL_ENDL; cleanup(); } } @@ -74,7 +74,7 @@ void LLTransferManager::init() { if (mValid) { - llerrs << "Double initializing LLTransferManager!" << llendl; + LL_ERRS() << "Double initializing LLTransferManager!" << LL_ENDL; } mValid = TRUE; @@ -122,7 +122,7 @@ void LLTransferManager::cleanupConnection(const LLHost &host) { // This can happen legitimately if we've never done a transfer, and we're // cleaning up a circuit. - //llwarns << "Cleaning up nonexistent transfer connection to " << host << llendl; + //LL_WARNS() << "Cleaning up nonexistent transfer connection to " << host << LL_ENDL; return; } LLTransferConnection *connp = iter->second; @@ -203,7 +203,7 @@ LLTransferSource *LLTransferManager::findTransferSource(const LLUUID &transfer_i //static void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **) { - //llinfos << "LLTransferManager::processTransferRequest" << llendl; + //LL_INFOS() << "LLTransferManager::processTransferRequest" << LL_ENDL; LLUUID transfer_id; LLTransferSourceType source_type; @@ -219,33 +219,33 @@ void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **) if (!tscp) { - llwarns << "Source channel not found" << llendl; + LL_WARNS() << "Source channel not found" << LL_ENDL; return; } if (tscp->findTransferSource(transfer_id)) { - llwarns << "Duplicate request for transfer " << transfer_id << ", aborting!" << llendl; + LL_WARNS() << "Duplicate request for transfer " << transfer_id << ", aborting!" << LL_ENDL; return; } S32 size = msgp->getSize("TransferInfo", "Params"); if(size > MAX_PARAMS_SIZE) { - llwarns << "LLTransferManager::processTransferRequest params too big." - << llendl; + LL_WARNS() << "LLTransferManager::processTransferRequest params too big." + << LL_ENDL; return; } - //llinfos << transfer_id << ":" << source_type << ":" << channel_type << ":" << priority << llendl; + //LL_INFOS() << transfer_id << ":" << source_type << ":" << channel_type << ":" << priority << LL_ENDL; LLTransferSource* tsp = LLTransferSource::createSource( source_type, transfer_id, priority); if(!tsp) { - llwarns << "LLTransferManager::processTransferRequest couldn't create" - << " transfer source!" << llendl; + LL_WARNS() << "LLTransferManager::processTransferRequest couldn't create" + << " transfer source!" << LL_ENDL; return; } U8 tmp[MAX_PARAMS_SIZE]; @@ -258,8 +258,8 @@ void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **) // This should only happen if the data is corrupt or // incorrectly packed. // *NOTE: We may want to call abortTransfer(). - llwarns << "LLTransferManager::processTransferRequest: bad parameters." - << llendl; + LL_WARNS() << "LLTransferManager::processTransferRequest: bad parameters." + << LL_ENDL; delete tsp; return; } @@ -272,7 +272,7 @@ void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **) //static void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) { - //llinfos << "LLTransferManager::processTransferInfo" << llendl; + //LL_INFOS() << "LLTransferManager::processTransferInfo" << LL_ENDL; LLUUID transfer_id; LLTransferTargetType target_type; @@ -286,11 +286,11 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) msgp->getS32("TransferInfo", "Status", (S32 &)status); msgp->getS32("TransferInfo", "Size", size); - //llinfos << transfer_id << ":" << target_type<< ":" << channel_type << llendl; + //LL_INFOS() << transfer_id << ":" << target_type<< ":" << channel_type << LL_ENDL; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(msgp->getSender(), channel_type); if (!ttcp) { - llwarns << "Target channel not found" << llendl; + LL_WARNS() << "Target channel not found" << LL_ENDL; // Should send a message to abort the transfer. return; } @@ -298,7 +298,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) LLTransferTarget *ttp = ttcp->findTransferTarget(transfer_id); if (!ttp) { - llwarns << "TransferInfo for unknown transfer! Not able to handle this yet!" << llendl; + LL_WARNS() << "TransferInfo for unknown transfer! Not able to handle this yet!" << LL_ENDL; // This could happen if we're doing a push transfer, although to avoid confusion, // maybe it should be a different message. return; @@ -306,7 +306,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) if (status != LLTS_OK) { - llwarns << transfer_id << ": Non-ok status, cleaning up" << llendl; + LL_WARNS() << transfer_id << ": Non-ok status, cleaning up" << LL_ENDL; ttp->completionCallback(status); // Clean up the transfer. ttcp->deleteTransfer(ttp); @@ -317,8 +317,8 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) S32 params_size = msgp->getSize("TransferInfo", "Params"); if(params_size > MAX_PARAMS_SIZE) { - llwarns << "LLTransferManager::processTransferInfo params too big." - << llendl; + LL_WARNS() << "LLTransferManager::processTransferInfo params too big." + << LL_ENDL; return; } else if(params_size > 0) @@ -330,15 +330,15 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) { // This should only happen if the data is corrupt or // incorrectly packed. - llwarns << "LLTransferManager::processTransferRequest: bad params." - << llendl; + LL_WARNS() << "LLTransferManager::processTransferRequest: bad params." + << LL_ENDL; ttp->abortTransfer(); ttcp->deleteTransfer(ttp); return; } } - //llinfos << "Receiving " << transfer_id << ", size " << size << " bytes" << llendl; + //LL_INFOS() << "Receiving " << transfer_id << ", size " << size << " bytes" << LL_ENDL; ttp->setSize(size); ttp->setGotInfo(TRUE); @@ -358,7 +358,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) { // Perhaps this stuff should be inside a method in LLTransferPacket? // I'm too lazy to do it now, though. -// llinfos << "Playing back delayed packet " << packet_id << llendl; +// LL_INFOS() << "Playing back delayed packet " << packet_id << LL_ENDL; LLTransferPacket *packetp = ttp->mDelayedPacketMap[packet_id]; // This is somewhat inefficient, but avoids us having to duplicate @@ -392,11 +392,11 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) { if (status != LLTS_DONE) { - llwarns << "LLTransferManager::processTransferInfo Error in playback!" << llendl; + LL_WARNS() << "LLTransferManager::processTransferInfo Error in playback!" << LL_ENDL; } else { - llinfos << "LLTransferManager::processTransferInfo replay FINISHED for " << transfer_id << llendl; + LL_INFOS() << "LLTransferManager::processTransferInfo replay FINISHED for " << transfer_id << LL_ENDL; } // This transfer is done, either via error or not. ttp->completionCallback(status); @@ -410,7 +410,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **) //static void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) { - //llinfos << "LLTransferManager::processTransferPacket" << llendl; + //LL_INFOS() << "LLTransferManager::processTransferPacket" << LL_ENDL; LLUUID transfer_id; LLTransferChannelType channel_type; @@ -423,20 +423,20 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) msgp->getS32("TransferData", "Status", (S32 &)status); // Find the transfer associated with this packet. - //llinfos << transfer_id << ":" << channel_type << llendl; + //LL_INFOS() << transfer_id << ":" << channel_type << LL_ENDL; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(msgp->getSender(), channel_type); if (!ttcp) { - llwarns << "Target channel not found" << llendl; + LL_WARNS() << "Target channel not found" << LL_ENDL; return; } LLTransferTarget *ttp = ttcp->findTransferTarget(transfer_id); if (!ttp) { - llwarns << "Didn't find matching transfer for " << transfer_id + LL_WARNS() << "Didn't find matching transfer for " << transfer_id << " processing packet " << packet_id - << " from " << msgp->getSender() << llendl; + << " from " << msgp->getSender() << LL_ENDL; return; } @@ -455,7 +455,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) if ((size < 0) || (size > MAX_PACKET_DATA_SIZE)) { - llwarns << "Invalid transfer packet size " << size << llendl; + LL_WARNS() << "Invalid transfer packet size " << size << LL_ENDL; return; } @@ -472,8 +472,8 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) if(!ttp->addDelayedPacket(packet_id, status, tmp_data, size)) { // Whoops - failed to add a delayed packet for some reason. - llwarns << "Too many delayed packets processing transfer " - << transfer_id << " from " << msgp->getSender() << llendl; + LL_WARNS() << "Too many delayed packets processing transfer " + << transfer_id << " from " << msgp->getSender() << LL_ENDL; ttp->abortTransfer(); ttcp->deleteTransfer(ttp); return; @@ -483,15 +483,15 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) const S32 LL_TRANSFER_WARN_GAP = 10; if(!ttp->gotInfo()) { - llwarns << "Got data packet before information in transfer " + LL_WARNS() << "Got data packet before information in transfer " << transfer_id << " from " << msgp->getSender() - << ", got " << packet_id << llendl; + << ", got " << packet_id << LL_ENDL; } else if((packet_id - ttp->getNextPacketID()) > LL_TRANSFER_WARN_GAP) { - llwarns << "Out of order packet in transfer " << transfer_id + LL_WARNS() << "Out of order packet in transfer " << transfer_id << " from " << msgp->getSender() << ", got " << packet_id - << " expecting " << ttp->getNextPacketID() << llendl; + << " expecting " << ttp->getNextPacketID() << LL_ENDL; } #endif return; @@ -516,11 +516,11 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) { if (status != LLTS_DONE) { - llwarns << "LLTransferManager::processTransferPacket Error in transfer!" << llendl; + LL_WARNS() << "LLTransferManager::processTransferPacket Error in transfer!" << LL_ENDL; } else { -// llinfos << "LLTransferManager::processTransferPacket done for " << transfer_id << llendl; +// LL_INFOS() << "LLTransferManager::processTransferPacket done for " << transfer_id << LL_ENDL; } // This transfer is done, either via error or not. ttp->completionCallback(status); @@ -534,7 +534,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) { // Perhaps this stuff should be inside a method in LLTransferPacket? // I'm too lazy to do it now, though. -// llinfos << "Playing back delayed packet " << packet_id << llendl; +// LL_INFOS() << "Playing back delayed packet " << packet_id << LL_ENDL; LLTransferPacket *packetp = ttp->mDelayedPacketMap[packet_id]; // This is somewhat inefficient, but avoids us having to duplicate @@ -564,7 +564,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **) //static void LLTransferManager::processTransferAbort(LLMessageSystem *msgp, void **) { - //llinfos << "LLTransferManager::processTransferPacket" << llendl; + //LL_INFOS() << "LLTransferManager::processTransferPacket" << LL_ENDL; LLUUID transfer_id; LLTransferChannelType channel_type; @@ -598,7 +598,7 @@ void LLTransferManager::processTransferAbort(LLMessageSystem *msgp, void **) } } - llwarns << "Couldn't find transfer " << transfer_id << " to abort!" << llendl; + LL_WARNS() << "Couldn't find transfer " << transfer_id << " to abort!" << LL_ENDL; } @@ -612,14 +612,14 @@ void LLTransferManager::reliablePacketCallback(void **user_data, S32 result) LLTransferSource *tsp = gTransferManager.findTransferSource(*transfer_idp); if (tsp) { - llwarns << "Aborting reliable transfer " << *transfer_idp << " due to failed reliable resends!" << llendl; + LL_WARNS() << "Aborting reliable transfer " << *transfer_idp << " due to failed reliable resends!" << LL_ENDL; LLTransferSourceChannel *tscp = tsp->mChannelp; tsp->abortTransfer(); tscp->deleteTransfer(tsp); } else { - llwarns << "Aborting reliable transfer " << *transfer_idp << " but can't find the LLTransferSource object" << llendl; + LL_WARNS() << "Aborting reliable transfer " << *transfer_idp << " but can't find the LLTransferSource object" << LL_ENDL; } } delete transfer_idp; @@ -763,7 +763,7 @@ void LLTransferSourceChannel::updateTransfers() // We DON'T want to send any packets if they're blocked, they'll just end up // piling up on the other end. - //llwarns << "Blocking transfers due to blocked circuit for " << getHost() << llendl; + //LL_WARNS() << "Blocking transfers due to blocked circuit for " << getHost() << LL_ENDL; return; } @@ -781,7 +781,7 @@ void LLTransferSourceChannel::updateTransfers() BOOL done = FALSE; for (iter = mTransferSources.mMap.begin(); (iter != mTransferSources.mMap.end()) && !done;) { - //llinfos << "LLTransferSourceChannel::updateTransfers()" << llendl; + //LL_INFOS() << "LLTransferSourceChannel::updateTransfers()" << LL_ENDL; // Do stuff. next = iter; next++; @@ -820,7 +820,7 @@ void LLTransferSourceChannel::updateTransfers() gMessageSystem->addS32("Status", status); gMessageSystem->addBinaryData("Data", datap, data_size); sent_bytes = gMessageSystem->getCurrentSendTotal(); - gMessageSystem->sendReliable(getHost(), LL_DEFAULT_RELIABLE_RETRIES, TRUE, 0.f, + gMessageSystem->sendReliable(getHost(), LL_DEFAULT_RELIABLE_RETRIES, TRUE, F32Seconds(0.f), LLTransferManager::reliablePacketCallback, (void**)cb_uuid); // Do bookkeeping for the throttle @@ -853,11 +853,11 @@ void LLTransferSourceChannel::updateTransfers() // We're OK, don't need to do anything. Keep sending data. break; case LLTS_ERROR: - llwarns << "Error in transfer dataCallback!" << llendl; + LL_WARNS() << "Error in transfer dataCallback!" << LL_ENDL; // fall through case LLTS_DONE: // We need to clean up this transfer source. - //llinfos << "LLTransferSourceChannel::updateTransfers() " << tsp->getID() << " done" << llendl; + //LL_INFOS() << "LLTransferSourceChannel::updateTransfers() " << tsp->getID() << " done" << LL_ENDL; tsp->completionCallback(status); delete tsp; @@ -865,7 +865,7 @@ void LLTransferSourceChannel::updateTransfers() iter = next; break; default: - llerrs << "Unknown transfer error code!" << llendl; + LL_ERRS() << "Unknown transfer error code!" << LL_ENDL; } // At this point, we should do priority adjustment (since some transfers like @@ -912,10 +912,10 @@ void LLTransferSourceChannel::deleteTransfer(LLTransferSource *tsp) } } - llwarns << "Unable to find transfer source id " + LL_WARNS() << "Unable to find transfer source id " << tsp->getID() << " to delete!" - << llendl; + << LL_ENDL; } } @@ -956,7 +956,7 @@ void LLTransferTargetChannel::requestTransfer( source_params.getType()); if (!ttp) { - llwarns << "LLTransferManager::requestTransfer aborting due to target creation failure!" << llendl; + LL_WARNS() << "LLTransferManager::requestTransfer aborting due to target creation failure!" << LL_ENDL; return; } @@ -1032,10 +1032,10 @@ void LLTransferTargetChannel::deleteTransfer(LLTransferTarget *ttp) } } - llwarns << "Unable to find transfer target id " + LL_WARNS() << "Unable to find transfer target id " << ttp->getID() << " to delete!" - << llendl; + << LL_ENDL; } } @@ -1097,7 +1097,7 @@ void LLTransferSource::sendTransferStatus(LLTSCode status) void LLTransferSource::abortTransfer() { // Send a message down, call the completion callback - llinfos << "LLTransferSource::Aborting transfer " << getID() << " to " << mChannelp->getHost() << llendl; + LL_INFOS() << "LLTransferSource::Aborting transfer " << getID() << " to " << mChannelp->getHost() << LL_ENDL; gMessageSystem->newMessage("TransferAbort"); gMessageSystem->nextBlock("TransferInfo"); gMessageSystem->addUUID("TransferID", getID()); @@ -1115,7 +1115,7 @@ void LLTransferSource::registerSourceType(const LLTransferSourceType stype, LLTr { // Disallow changing what class handles a source type // Unclear when you would want to do this, and whether it would work. - llerrs << "Reregistering source type " << stype << llendl; + LL_ERRS() << "Reregistering source type " << stype << LL_ENDL; } else { @@ -1143,7 +1143,7 @@ LLTransferSource *LLTransferSource::createSource(const LLTransferSourceType styp if (!sSourceCreateMap.count(stype)) { // Use the callback to create the source type if it's not there. - llwarns << "Unknown transfer source type: " << stype << llendl; + LL_WARNS() << "Unknown transfer source type: " << stype << LL_ENDL; return NULL; } return (sSourceCreateMap[stype])(id, priority); @@ -1230,7 +1230,7 @@ LLTransferTarget::~LLTransferTarget() void LLTransferTarget::abortTransfer() { // Send a message up, call the completion callback - llinfos << "LLTransferTarget::Aborting transfer " << getID() << " from " << mChannelp->getHost() << llendl; + LL_INFOS() << "LLTransferTarget::Aborting transfer " << getID() << " from " << mChannelp->getHost() << LL_ENDL; gMessageSystem->newMessage("TransferAbort"); gMessageSystem->nextBlock("TransferInfo"); gMessageSystem->addUUID("TransferID", getID()); @@ -1262,7 +1262,7 @@ bool LLTransferTarget::addDelayedPacket( #ifdef _DEBUG if (mDelayedPacketMap.find(packet_id) != mDelayedPacketMap.end()) { - llerrs << "Packet ALREADY in delayed packet map!" << llendl; + LL_ERRS() << "Packet ALREADY in delayed packet map!" << LL_ENDL; } #endif @@ -1283,7 +1283,7 @@ LLTransferTarget* LLTransferTarget::createTarget( case LLTTT_VFILE: return new LLTransferTargetVFile(id, source_type); default: - llwarns << "Unknown transfer target type: " << type << llendl; + LL_WARNS() << "Unknown transfer target type: " << type << LL_ENDL; return NULL; } } @@ -1318,7 +1318,7 @@ void LLTransferSourceParamsInvItem::setAsset(const LLUUID &asset_id, const LLAss void LLTransferSourceParamsInvItem::packParams(LLDataPacker &dp) const { - lldebugs << "LLTransferSourceParamsInvItem::packParams()" << llendl; + LL_DEBUGS() << "LLTransferSourceParamsInvItem::packParams()" << LL_ENDL; dp.packUUID(mAgentID, "AgentID"); dp.packUUID(mSessionID, "SessionID"); dp.packUUID(mOwnerID, "OwnerID"); diff --git a/indra/llmessage/lltransfersourceasset.cpp b/indra/llmessage/lltransfersourceasset.cpp index 8537773a3f..80ed3340c6 100755 --- a/indra/llmessage/lltransfersourceasset.cpp +++ b/indra/llmessage/lltransfersourceasset.cpp @@ -66,18 +66,18 @@ void LLTransferSourceAsset::initTransfer() } else { - llwarns << "Attempted to request blocked asset " + LL_WARNS() << "Attempted to request blocked asset " << mParams.getAssetID() << ":" << LLAssetType::lookupHumanReadable(mParams.getAssetType()) - << llendl; + << LL_ENDL; sendTransferStatus(LLTS_ERROR); } } else { - llwarns << "Attempted to request asset " << mParams.getAssetID() + LL_WARNS() << "Attempted to request asset " << mParams.getAssetID() << ":" << LLAssetType::lookupHumanReadable(mParams.getAssetType()) - << " without an asset system!" << llendl; + << " without an asset system!" << LL_ENDL; sendTransferStatus(LLTS_ERROR); } } @@ -93,7 +93,7 @@ LLTSCode LLTransferSourceAsset::dataCallback(const S32 packet_id, S32 &returned_bytes, BOOL &delete_returned) { - //llinfos << "LLTransferSourceAsset::dataCallback" << llendl; + //LL_INFOS() << "LLTransferSourceAsset::dataCallback" << LL_ENDL; if (!mGotResponse) { return LLTS_SKIP; @@ -109,14 +109,14 @@ LLTSCode LLTransferSourceAsset::dataCallback(const S32 packet_id, if (packet_id != mLastPacketID + 1) { - llerrs << "Can't handle out of order file transfer yet!" << llendl; + LL_ERRS() << "Can't handle out of order file transfer yet!" << LL_ENDL; } // grab a buffer from the right place in the file if (!vf.seek(mCurPos, 0)) { - llwarns << "LLTransferSourceAsset Can't seek to " << mCurPos << " length " << vf.getSize() << llendl; - llwarns << "While sending " << mParams.getAssetID() << llendl; + LL_WARNS() << "LLTransferSourceAsset Can't seek to " << mCurPos << " length " << vf.getSize() << LL_ENDL; + LL_WARNS() << "While sending " << mParams.getAssetID() << LL_ENDL; return LLTS_ERROR; } @@ -160,13 +160,13 @@ void LLTransferSourceAsset::completionCallback(const LLTSCode status) void LLTransferSourceAsset::packParams(LLDataPacker& dp) const { - //llinfos << "LLTransferSourceAsset::packParams" << llendl; + //LL_INFOS() << "LLTransferSourceAsset::packParams" << LL_ENDL; mParams.packParams(dp); } BOOL LLTransferSourceAsset::unpackParams(LLDataPacker &dp) { - //llinfos << "LLTransferSourceAsset::unpackParams" << llendl; + //LL_INFOS() << "LLTransferSourceAsset::unpackParams" << LL_ENDL; return mParams.unpackParams(dp); } @@ -183,13 +183,13 @@ void LLTransferSourceAsset::responderCallback(LLVFS *vfs, const LLUUID& uuid, LL if (!tsap) { - llinfos << "Aborting transfer " << transfer_id << " callback, transfer source went away" << llendl; + LL_INFOS() << "Aborting transfer " << transfer_id << " callback, transfer source went away" << LL_ENDL; return; } if (result) { - llinfos << "AssetStorage: Error " << gAssetStorage->getErrorString(result) << " downloading uuid " << uuid << llendl; + LL_INFOS() << "AssetStorage: Error " << gAssetStorage->getErrorString(result) << " downloading uuid " << uuid << LL_ENDL; } LLTSCode status; diff --git a/indra/llmessage/lltransfersourcefile.cpp b/indra/llmessage/lltransfersourcefile.cpp index 43c9448fba..1f284a158d 100755 --- a/indra/llmessage/lltransfersourcefile.cpp +++ b/indra/llmessage/lltransfersourcefile.cpp @@ -43,7 +43,7 @@ LLTransferSourceFile::~LLTransferSourceFile() { if (mFP) { - llerrs << "Destructor called without the completion callback being called!" << llendl; + LL_ERRS() << "Destructor called without the completion callback being called!" << LL_ENDL; } } @@ -56,7 +56,7 @@ void LLTransferSourceFile::initTransfer() || (filename == "..") || (filename.find(delimiter[0]) != std::string::npos)) { - llwarns << "Attempting to transfer file " << filename << " with path delimiter, aborting!" << llendl; + LL_WARNS() << "Attempting to transfer file " << filename << " with path delimiter, aborting!" << LL_ENDL; sendTransferStatus(LLTS_ERROR); return; @@ -88,17 +88,17 @@ LLTSCode LLTransferSourceFile::dataCallback(const S32 packet_id, S32 &returned_bytes, BOOL &delete_returned) { - //llinfos << "LLTransferSourceFile::dataCallback" << llendl; + //LL_INFOS() << "LLTransferSourceFile::dataCallback" << LL_ENDL; if (!mFP) { - llerrs << "Data callback without file set!" << llendl; + LL_ERRS() << "Data callback without file set!" << LL_ENDL; return LLTS_ERROR; } if (packet_id != mLastPacketID + 1) { - llerrs << "Can't handle out of order file transfer yet!" << llendl; + LL_ERRS() << "Can't handle out of order file transfer yet!" << LL_ENDL; } // Grab up until the max number of bytes from the file. @@ -137,13 +137,13 @@ void LLTransferSourceFile::completionCallback(const LLTSCode status) void LLTransferSourceFile::packParams(LLDataPacker& dp) const { - //llinfos << "LLTransferSourceFile::packParams" << llendl; + //LL_INFOS() << "LLTransferSourceFile::packParams" << LL_ENDL; mParams.packParams(dp); } BOOL LLTransferSourceFile::unpackParams(LLDataPacker &dp) { - //llinfos << "LLTransferSourceFile::unpackParams" << llendl; + //LL_INFOS() << "LLTransferSourceFile::unpackParams" << LL_ENDL; return mParams.unpackParams(dp); } @@ -169,6 +169,6 @@ BOOL LLTransferSourceParamsFile::unpackParams(LLDataPacker &dp) dp.unpackU8(delete_flag, "Delete"); mDeleteOnCompletion = delete_flag; - llinfos << "Unpacked filename: " << mFilename << llendl; + LL_INFOS() << "Unpacked filename: " << mFilename << LL_ENDL; return TRUE; } diff --git a/indra/llmessage/lltransfertargetfile.cpp b/indra/llmessage/lltransfertargetfile.cpp index 560fc8b6e4..ca0318a2d6 100755 --- a/indra/llmessage/lltransfertargetfile.cpp +++ b/indra/llmessage/lltransfertargetfile.cpp @@ -44,7 +44,7 @@ LLTransferTargetFile::~LLTransferTargetFile() { if (mFP) { - llerrs << "LLTransferTargetFile::~LLTransferTargetFile - Should have been cleaned up in completion callback" << llendl; + LL_ERRS() << "LLTransferTargetFile::~LLTransferTargetFile - Should have been cleaned up in completion callback" << LL_ENDL; fclose(mFP); mFP = NULL; } @@ -61,7 +61,7 @@ void LLTransferTargetFile::applyParams(const LLTransferTargetParams ¶ms) { if (params.getType() != mType) { - llwarns << "Target parameter type doesn't match!" << llendl; + LL_WARNS() << "Target parameter type doesn't match!" << LL_ENDL; return; } @@ -70,8 +70,8 @@ void LLTransferTargetFile::applyParams(const LLTransferTargetParams ¶ms) LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, const S32 in_size) { - //llinfos << "LLTransferTargetFile::dataCallback" << llendl; - //llinfos << "Packet: " << packet_id << llendl; + //LL_INFOS() << "LLTransferTargetFile::dataCallback" << LL_ENDL; + //LL_INFOS() << "Packet: " << packet_id << LL_ENDL; if (!mFP) { @@ -79,7 +79,7 @@ LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, c if (!mFP) { - llwarns << "Failure opening " << mParams.mFilename << " for write by LLTransferTargetFile" << llendl; + LL_WARNS() << "Failure opening " << mParams.mFilename << " for write by LLTransferTargetFile" << LL_ENDL; return LLTS_ERROR; } } @@ -91,7 +91,7 @@ LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, c S32 count = (S32)fwrite(in_datap, 1, in_size, mFP); if (count != in_size) { - llwarns << "Failure in LLTransferTargetFile::dataCallback!" << llendl; + LL_WARNS() << "Failure in LLTransferTargetFile::dataCallback!" << LL_ENDL; return LLTS_ERROR; } return LLTS_OK; @@ -99,7 +99,7 @@ LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, c void LLTransferTargetFile::completionCallback(const LLTSCode status) { - llinfos << "LLTransferTargetFile::completionCallback" << llendl; + LL_INFOS() << "LLTransferTargetFile::completionCallback" << LL_ENDL; if (mFP) { fclose(mFP); @@ -113,7 +113,7 @@ void LLTransferTargetFile::completionCallback(const LLTSCode status) case LLTS_ABORT: case LLTS_ERROR: // We're aborting this transfer, we don't want to keep this file. - llwarns << "Aborting file transfer for " << mParams.mFilename << llendl; + LL_WARNS() << "Aborting file transfer for " << mParams.mFilename << LL_ENDL; if (mFP) { // Only need to remove file if we successfully opened it. diff --git a/indra/llmessage/lltransfertargetvfile.cpp b/indra/llmessage/lltransfertargetvfile.cpp index c78d9288b6..3c234b9726 100755 --- a/indra/llmessage/lltransfertargetvfile.cpp +++ b/indra/llmessage/lltransfertargetvfile.cpp @@ -115,7 +115,7 @@ void LLTransferTargetVFile::applyParams(const LLTransferTargetParams ¶ms) { if (params.getType() != mType) { - llwarns << "Target parameter type doesn't match!" << llendl; + LL_WARNS() << "Target parameter type doesn't match!" << LL_ENDL; return; } @@ -125,8 +125,8 @@ void LLTransferTargetVFile::applyParams(const LLTransferTargetParams ¶ms) LLTSCode LLTransferTargetVFile::dataCallback(const S32 packet_id, U8 *in_datap, const S32 in_size) { - //llinfos << "LLTransferTargetFile::dataCallback" << llendl; - //llinfos << "Packet: " << packet_id << llendl; + //LL_INFOS() << "LLTransferTargetFile::dataCallback" << LL_ENDL; + //LL_INFOS() << "Packet: " << packet_id << LL_ENDL; LLVFile vf(gAssetStorage->mVFS, mTempID, mParams.getAssetType(), LLVFile::APPEND); if (mNeedsCreate) @@ -142,7 +142,7 @@ LLTSCode LLTransferTargetVFile::dataCallback(const S32 packet_id, U8 *in_datap, if (!vf.write(in_datap, in_size)) { - llwarns << "Failure in LLTransferTargetVFile::dataCallback!" << llendl; + LL_WARNS() << "Failure in LLTransferTargetVFile::dataCallback!" << LL_ENDL; return LLTS_ERROR; } return LLTS_OK; @@ -151,11 +151,11 @@ LLTSCode LLTransferTargetVFile::dataCallback(const S32 packet_id, U8 *in_datap, void LLTransferTargetVFile::completionCallback(const LLTSCode status) { - //llinfos << "LLTransferTargetVFile::completionCallback" << llendl; + //LL_INFOS() << "LLTransferTargetVFile::completionCallback" << LL_ENDL; if (!gAssetStorage) { - llwarns << "Aborting vfile transfer after asset storage shut down!" << llendl; + LL_WARNS() << "Aborting vfile transfer after asset storage shut down!" << LL_ENDL; return; } @@ -169,14 +169,14 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status) LLVFile file(gAssetStorage->mVFS, mTempID, mParams.getAssetType(), LLVFile::WRITE); if (!file.rename(mParams.getAssetID(), mParams.getAssetType())) { - llerrs << "LLTransferTargetVFile: rename failed" << llendl; + LL_ERRS() << "LLTransferTargetVFile: rename failed" << LL_ENDL; } } err_code = LL_ERR_NOERR; - lldebugs << "LLTransferTargetVFile::completionCallback for " + LL_DEBUGS() << "LLTransferTargetVFile::completionCallback for " << mParams.getAssetID() << "," << LLAssetType::lookup(mParams.getAssetType()) - << " with temp id " << mTempID << llendl; + << " with temp id " << mTempID << LL_ENDL; break; case LLTS_ERROR: case LLTS_ABORT: @@ -184,7 +184,7 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status) default: { // We're aborting this transfer, we don't want to keep this file. - llwarns << "Aborting vfile transfer for " << mParams.getAssetID() << llendl; + LL_WARNS() << "Aborting vfile transfer for " << mParams.getAssetID() << LL_ENDL; LLVFile vf(gAssetStorage->mVFS, mTempID, mParams.getAssetType(), LLVFile::APPEND); vf.remove(); } diff --git a/indra/llmessage/lltrustedmessageservice.cpp b/indra/llmessage/lltrustedmessageservice.cpp index fea7fc72c4..151d02a156 100755 --- a/indra/llmessage/lltrustedmessageservice.cpp +++ b/indra/llmessage/lltrustedmessageservice.cpp @@ -63,7 +63,7 @@ void LLTrustedMessageService::post(LLHTTPNode::ResponsePtr response, { LL_WARNS("Messaging") << "trusted message POST to /trusted-message/" << name << " from unknown or untrusted sender " - << sender << llendl; + << sender << LL_ENDL; response->status(403, "Unknown or untrusted sender"); } else @@ -71,13 +71,13 @@ void LLTrustedMessageService::post(LLHTTPNode::ResponsePtr response, gMessageSystem->receivedMessageFromTrustedSender(); if (input.has("binary-template-data")) { - llinfos << "Dispatching template: " << input << llendl; + LL_INFOS() << "Dispatching template: " << input << LL_ENDL; // try and send this message using udp dispatch LLMessageSystem::dispatchTemplate(name, message_data, response); } else { - llinfos << "Dispatching without template: " << input << llendl; + LL_INFOS() << "Dispatching without template: " << input << LL_ENDL; LLMessageSystem::dispatch(name, message_data, response); } } diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 683065357d..8e4ee85c17 100755 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -33,6 +33,7 @@ #include <openssl/x509_vfy.h> #include <openssl/ssl.h> #include "llcurl.h" +#include "llfasttimer.h" #include "llioutil.h" #include "llproxy.h" #include "llpumpio.h" @@ -179,7 +180,7 @@ void LLURLRequest::setURL(const std::string& url) mDetail->mURL = url; if (url.empty()) { - llwarns << "empty URL specified" << llendl; + LL_WARNS() << "empty URL specified" << LL_ENDL; } } @@ -232,7 +233,7 @@ void LLURLRequest::useProxy(bool use_proxy) } - lldebugs << "use_proxy = " << (use_proxy?'Y':'N') << ", env_proxy = " << (env_proxy ? env_proxy : "(null)") << llendl; + LL_DEBUGS() << "use_proxy = " << (use_proxy?'Y':'N') << ", env_proxy = " << (env_proxy ? env_proxy : "(null)") << LL_ENDL; if (env_proxy && use_proxy) { @@ -284,9 +285,11 @@ LLIOPipe::EStatus LLURLRequest::handleError( return status; } -static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST("URL Request"); -static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result"); -static LLFastTimer::DeclareTimer FTM_URL_PERFORM("Perform"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_REQUEST("URL Request"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result"); +static LLTrace::BlockTimerStatHandle FTM_URL_PERFORM("Perform"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_PUMP_RESPOND("Pump Respond"); +static LLTrace::BlockTimerStatHandle FTM_URL_ADJUST_TIMEOUT("Adjust Timeout"); // virtual LLIOPipe::EStatus LLURLRequest::process_impl( @@ -296,9 +299,9 @@ LLIOPipe::EStatus LLURLRequest::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_URL_REQUEST); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_REQUEST); PUMP_DEBUG; - //llinfos << "LLURLRequest::process_impl()" << llendl; + //LL_INFOS() << "LLURLRequest::process_impl()" << LL_ENDL; if (!buffer) return STATUS_ERROR; // we're still waiting or prcessing, check how many @@ -306,8 +309,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( const S32 MIN_ACCUMULATION = 100000; if(pump && (mDetail->mByteAccumulator > MIN_ACCUMULATION)) { - static LLFastTimer::DeclareTimer FTM_URL_ADJUST_TIMEOUT("Adjust Timeout"); - LLFastTimer t(FTM_URL_ADJUST_TIMEOUT); + LL_RECORD_BLOCK_TIME(FTM_URL_ADJUST_TIMEOUT); // This is a pretty sloppy calculation, but this // tries to make the gross assumption that if data // is coming in at 56kb/s, then this transfer will @@ -317,11 +319,11 @@ LLIOPipe::EStatus LLURLRequest::process_impl( const F32 TIMEOUT_ADJUSTMENT = 2.0f; mDetail->mByteAccumulator = 0; pump->adjustTimeoutSeconds(TIMEOUT_ADJUSTMENT); - lldebugs << "LLURLRequest adjustTimeoutSeconds for request: " << mDetail->mURL << llendl; - if (mState == STATE_INITIALIZED) - { - llinfos << "LLURLRequest adjustTimeoutSeconds called during upload" << llendl; - } + LL_DEBUGS() << "LLURLRequest adjustTimeoutSeconds for request: " << mDetail->mURL << LL_ENDL; + if (mState == STATE_INITIALIZED) + { + LL_INFOS() << "LLURLRequest adjustTimeoutSeconds called during upload" << LL_ENDL; + } } switch(mState) @@ -356,7 +358,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( PUMP_DEBUG; LLIOPipe::EStatus status = STATUS_BREAK; { - LLFastTimer t(FTM_URL_PERFORM); + LL_RECORD_BLOCK_TIME(FTM_URL_PERFORM); if(!mDetail->mCurlRequest->wait()) { return status ; @@ -370,7 +372,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( bool newmsg = false; { - LLFastTimer t(FTM_PROCESS_URL_REQUEST_GET_RESULT); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_REQUEST_GET_RESULT); newmsg = mDetail->mCurlRequest->getResult(&result); } @@ -384,7 +386,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( mState = STATE_HAVE_RESPONSE; context[CONTEXT_REQUEST][CONTEXT_TRANSFERED_BYTES] = mRequestTransferedBytes; context[CONTEXT_RESPONSE][CONTEXT_TRANSFERED_BYTES] = mResponseTransferedBytes; - lldebugs << this << "Setting context to " << context << llendl; + LL_DEBUGS() << this << "Setting context to " << context << LL_ENDL; switch(result) { case CURLE_OK: @@ -405,9 +407,8 @@ LLIOPipe::EStatus LLURLRequest::process_impl( link.mChannels = LLBufferArray::makeChannelConsumer( channels); chain.push_back(link); - static LLFastTimer::DeclareTimer FTM_PROCESS_URL_PUMP_RESPOND("Pump Respond"); { - LLFastTimer t(FTM_PROCESS_URL_PUMP_RESPOND); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_PUMP_RESPOND); pump->respond(chain, buffer, context); } mCompletionCallback = NULL; @@ -419,12 +420,12 @@ LLIOPipe::EStatus LLURLRequest::process_impl( keep_looping = false; break; default: // CURLE_URL_MALFORMAT - llwarns << "URLRequest Error: " << result + LL_WARNS() << "URLRequest Error: " << result << ", " << LLCurl::strerror(result) << ", " << (mDetail->mURL.empty() ? "<EMPTY URL>" : mDetail->mURL) - << llendl; + << LL_ENDL; status = STATUS_ERROR; keep_looping = false; break; @@ -439,14 +440,14 @@ LLIOPipe::EStatus LLURLRequest::process_impl( eos = true; context[CONTEXT_REQUEST][CONTEXT_TRANSFERED_BYTES] = mRequestTransferedBytes; context[CONTEXT_RESPONSE][CONTEXT_TRANSFERED_BYTES] = mResponseTransferedBytes; - lldebugs << this << "Setting context to " << context << llendl; + LL_DEBUGS() << this << "Setting context to " << context << LL_ENDL; return STATUS_DONE; default: PUMP_DEBUG; context[CONTEXT_REQUEST][CONTEXT_TRANSFERED_BYTES] = mRequestTransferedBytes; context[CONTEXT_RESPONSE][CONTEXT_TRANSFERED_BYTES] = mResponseTransferedBytes; - lldebugs << this << "Setting context to " << context << llendl; + LL_DEBUGS() << this << "Setting context to " << context << LL_ENDL; return STATUS_ERROR; } } @@ -468,10 +469,10 @@ void LLURLRequest::initialize() mResponseTransferedBytes = 0; } -static LLFastTimer::DeclareTimer FTM_URL_REQUEST_CONFIGURE("URL Configure"); +static LLTrace::BlockTimerStatHandle FTM_URL_REQUEST_CONFIGURE("URL Configure"); bool LLURLRequest::configure() { - LLFastTimer t(FTM_URL_REQUEST_CONFIGURE); + LL_RECORD_BLOCK_TIME(FTM_URL_REQUEST_CONFIGURE); bool rv = false; S32 bytes = mDetail->mResponseBuffer->countAfter( @@ -541,7 +542,7 @@ bool LLURLRequest::configure() break; default: - llwarns << "Unhandled URLRequest action: " << mAction << llendl; + LL_WARNS() << "Unhandled URLRequest action: " << mAction << LL_ENDL; break; } if(rv) @@ -669,14 +670,14 @@ static size_t headerCallback(void* data, size_t size, size_t nmemb, void* user) LLStringUtil::trim(header); if (!header.empty()) { - llwarns << "Unable to parse header: " << header << llendl; + LL_WARNS() << "Unable to parse header: " << header << LL_ENDL; } } return header_len; } -static LLFastTimer::DeclareTimer FTM_PROCESS_URL_EXTRACTOR("URL Extractor"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_EXTRACTOR("URL Extractor"); /** * LLContextURLExtractor */ @@ -688,7 +689,7 @@ LLIOPipe::EStatus LLContextURLExtractor::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_URL_EXTRACTOR); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_EXTRACTOR); PUMP_DEBUG; // The destination host is in the context. if(context.isUndefined() || !mRequest) @@ -747,15 +748,15 @@ void LLURLRequestComplete::complete(const LLChannelDescriptors& channels, void LLURLRequestComplete::response(const LLChannelDescriptors& channels, const buffer_ptr_t& buffer) { - llwarns << "LLURLRequestComplete::response default implementation called" - << llendl; + LL_WARNS() << "LLURLRequestComplete::response default implementation called" + << LL_ENDL; } //virtual void LLURLRequestComplete::noResponse() { - llwarns << "LLURLRequestComplete::noResponse default implementation called" - << llendl; + LL_WARNS() << "LLURLRequestComplete::noResponse default implementation called" + << LL_ENDL; } void LLURLRequestComplete::responseStatus(LLIOPipe::EStatus status) @@ -763,7 +764,7 @@ void LLURLRequestComplete::responseStatus(LLIOPipe::EStatus status) mRequestStatus = status; } -static LLFastTimer::DeclareTimer FTM_PROCESS_URL_COMPLETE("URL Complete"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_COMPLETE("URL Complete"); // virtual LLIOPipe::EStatus LLURLRequestComplete::process_impl( const LLChannelDescriptors& channels, @@ -772,7 +773,7 @@ LLIOPipe::EStatus LLURLRequestComplete::process_impl( LLSD& context, LLPumpIO* pump) { - LLFastTimer t(FTM_PROCESS_URL_COMPLETE); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_COMPLETE); PUMP_DEBUG; complete(channels, buffer); return STATUS_OK; diff --git a/indra/llmessage/lluseroperation.cpp b/indra/llmessage/lluseroperation.cpp index a4a68d0c81..c506af19ce 100755 --- a/indra/llmessage/lluseroperation.cpp +++ b/indra/llmessage/lluseroperation.cpp @@ -100,7 +100,7 @@ LLUserOperationMgr::~LLUserOperationMgr() { if (mUserOperationList.size() > 0) { - llwarns << "Exiting with user operations pending." << llendl; + LL_WARNS() << "Exiting with user operations pending." << LL_ENDL; } } @@ -109,7 +109,7 @@ void LLUserOperationMgr::addOperation(LLUserOperation* op) { if(!op) { - llwarns << "Tried to add null op" << llendl; + LL_WARNS() << "Tried to add null op" << LL_ENDL; return; } LLUUID id = op->getTransactionID(); @@ -160,7 +160,7 @@ void LLUserOperationMgr::deleteExpiredOperations() op = (*it).second; if(op && op->isExpired()) { - lldebugs << "expiring: " << (*it).first << llendl; + LL_DEBUGS() << "expiring: " << (*it).first << LL_ENDL; op->expire(); mUserOperationList.erase(it++); delete op; diff --git a/indra/llmessage/llxfer.cpp b/indra/llmessage/llxfer.cpp index f8c55d52ad..4aba5cae72 100755 --- a/indra/llmessage/llxfer.cpp +++ b/indra/llmessage/llxfer.cpp @@ -99,7 +99,7 @@ void LLXfer::cleanup () S32 LLXfer::startSend (U64 xfer_id, const LLHost &remote_host) { - llwarns << "undifferentiated LLXfer::startSend for " << getFileName() << llendl; + LL_WARNS() << "undifferentiated LLXfer::startSend for " << getFileName() << LL_ENDL; return (-1); } @@ -115,8 +115,8 @@ void LLXfer::setXferSize (S32 xfer_size) S32 LLXfer::startDownload() { - llwarns << "undifferentiated LLXfer::startDownload for " << getFileName() - << llendl; + LL_WARNS() << "undifferentiated LLXfer::startDownload for " << getFileName() + << LL_ENDL; return (-1); } @@ -140,7 +140,7 @@ S32 LLXfer::receiveData (char *datap, S32 data_size) } else { - llerrs << "NULL data passed in receiveData" << llendl; + LL_ERRS() << "NULL data passed in receiveData" << LL_ENDL; } } @@ -163,7 +163,7 @@ S32 LLXfer::flush() S32 LLXfer::suck(S32 start_position) { - llwarns << "Attempted to send a packet outside the buffer bounds in LLXfer::suck()" << llendl; + LL_WARNS() << "Attempted to send a packet outside the buffer bounds in LLXfer::suck()" << LL_ENDL; return (-1); } @@ -196,7 +196,7 @@ void LLXfer::sendPacket(S32 packet_num) if (fdata_size < 0) { - llwarns << "negative data size in xfer send, aborting" << llendl; + LL_WARNS() << "negative data size in xfer send, aborting" << LL_ENDL; abort(LL_ERR_EOF); return; } @@ -289,13 +289,13 @@ S32 LLXfer::processEOF() if (LL_ERR_NOERR == mCallbackResult) { - llinfos << "xfer from " << mRemoteHost << " complete: " << getFileName() - << llendl; + LL_INFOS() << "xfer from " << mRemoteHost << " complete: " << getFileName() + << LL_ENDL; } else { - llinfos << "xfer from " << mRemoteHost << " failed, code " - << mCallbackResult << ": " << getFileName() << llendl; + LL_INFOS() << "xfer from " << mRemoteHost << " failed, code " + << mCallbackResult << ": " << getFileName() << LL_ENDL; } if (mCallback) @@ -323,8 +323,8 @@ void LLXfer::abort (S32 result_code) { mCallbackResult = result_code; - llinfos << "Aborting xfer from " << mRemoteHost << " named " << getFileName() - << " - error: " << result_code << llendl; + LL_INFOS() << "Aborting xfer from " << mRemoteHost << " named " << getFileName() + << " - error: " << result_code << LL_ENDL; gMessageSystem->newMessageFast(_PREHASH_AbortXfer); gMessageSystem->nextBlockFast(_PREHASH_XferID); diff --git a/indra/llmessage/llxfer.h b/indra/llmessage/llxfer.h index f9348eb11f..edf5eeb82d 100755 --- a/indra/llmessage/llxfer.h +++ b/indra/llmessage/llxfer.h @@ -32,6 +32,10 @@ #include "llextendedstatus.h" const S32 LL_XFER_LARGE_PAYLOAD = 7680; +const S32 LL_ERR_FILE_EMPTY = -44; +const int LL_ERR_FILE_NOT_FOUND = -43; +const int LL_ERR_CANNOT_OPEN_FILE = -42; +const int LL_ERR_EOF = -39; typedef enum ELLXferStatus { e_LL_XFER_UNINITIALIZED, diff --git a/indra/llmessage/llxfer_file.cpp b/indra/llmessage/llxfer_file.cpp index 9e02af2c3e..257a13f277 100755 --- a/indra/llmessage/llxfer_file.cpp +++ b/indra/llmessage/llxfer_file.cpp @@ -102,12 +102,12 @@ void LLXfer_File::cleanup () if (mDeleteLocalOnCompletion) { - lldebugs << "Removing file: " << mLocalFilename << llendl; + LL_DEBUGS() << "Removing file: " << mLocalFilename << LL_ENDL; LLFile::remove(mLocalFilename); } else { - lldebugs << "Keeping local file: " << mLocalFilename << llendl; + LL_DEBUGS() << "Keeping local file: " << mLocalFilename << LL_ENDL; } LLXfer::cleanup(); @@ -139,7 +139,7 @@ S32 LLXfer_File::initializeRequest(U64 xfer_id, mCallbackDataHandle = user_data; mCallbackResult = LL_ERR_NOERR; - llinfos << "Requesting xfer from " << remote_host << " for file: " << mLocalFilename << llendl; + LL_INFOS() << "Requesting xfer from " << remote_host << " for file: " << mLocalFilename << LL_ENDL; if (mBuffer) { @@ -182,7 +182,7 @@ S32 LLXfer_File::startDownload() } else { - llwarns << "Couldn't create file to be received!" << llendl; + LL_WARNS() << "Couldn't create file to be received!" << LL_ENDL; retval = -1; } @@ -223,7 +223,7 @@ S32 LLXfer_File::startSend (U64 xfer_id, const LLHost &remote_host) } else { - llinfos << "Warning: " << mLocalFilename << " not found." << llendl; + LL_INFOS() << "Warning: " << mLocalFilename << " not found." << LL_ENDL; return (LL_ERR_FILE_NOT_FOUND); } @@ -279,7 +279,7 @@ S32 LLXfer_File::flush() { if (mFp) { - llerrs << "Overwriting open file pointer!" << llendl; + LL_ERRS() << "Overwriting open file pointer!" << LL_ENDL; } mFp = LLFile::fopen(mTempFilename,"a+b"); /* Flawfinder : ignore */ @@ -287,10 +287,10 @@ S32 LLXfer_File::flush() { if (fwrite(mBuffer,1,mBufferLength,mFp) != mBufferLength) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } -// llinfos << "******* wrote " << mBufferLength << " bytes of file xfer" << llendl; +// LL_INFOS() << "******* wrote " << mBufferLength << " bytes of file xfer" << LL_ENDL; fclose(mFp); mFp = NULL; @@ -298,7 +298,7 @@ S32 LLXfer_File::flush() } else { - llwarns << "LLXfer_File::flush() unable to open " << mTempFilename << " for writing!" << llendl; + LL_WARNS() << "LLXfer_File::flush() unable to open " << mTempFilename << " for writing!" << LL_ENDL; retval = LL_ERR_CANNOT_OPEN_FILE; } } @@ -329,37 +329,37 @@ S32 LLXfer_File::processEOF() { #if !LL_WINDOWS S32 error_number = errno; - llinfos << "Rename failure (" << error_number << ") - " - << mTempFilename << " to " << mLocalFilename << llendl; + LL_INFOS() << "Rename failure (" << error_number << ") - " + << mTempFilename << " to " << mLocalFilename << LL_ENDL; if(EXDEV == error_number) { if(copy_file(mTempFilename, mLocalFilename) == 0) { - llinfos << "Rename across mounts; copying+unlinking the file instead." << llendl; + LL_INFOS() << "Rename across mounts; copying+unlinking the file instead." << LL_ENDL; unlink(mTempFilename.c_str()); } else { - llwarns << "Copy failure - " << mTempFilename << " to " - << mLocalFilename << llendl; + LL_WARNS() << "Copy failure - " << mTempFilename << " to " + << mLocalFilename << LL_ENDL; } } else { //LLFILE* fp = LLFile::fopen(mTempFilename, "r"); - //llwarns << "File " << mTempFilename << " does " - // << (!fp ? "not" : "" ) << " exit." << llendl; + //LL_WARNS() << "File " << mTempFilename << " does " + // << (!fp ? "not" : "" ) << " exit." << LL_ENDL; //if(fp) fclose(fp); //fp = LLFile::fopen(mLocalFilename, "r"); - //llwarns << "File " << mLocalFilename << " does " - // << (!fp ? "not" : "" ) << " exit." << llendl; + //LL_WARNS() << "File " << mLocalFilename << " does " + // << (!fp ? "not" : "" ) << " exit." << LL_ENDL; //if(fp) fclose(fp); - llwarns << "Rename fatally failed, can only handle EXDEV (" - << EXDEV << ")" << llendl; + LL_WARNS() << "Rename fatally failed, can only handle EXDEV (" + << EXDEV << ")" << LL_ENDL; } #else - llwarns << "Rename failure - " << mTempFilename << " to " - << mLocalFilename << llendl; + LL_WARNS() << "Rename failure - " << mTempFilename << " to " + << mLocalFilename << LL_ENDL; #endif } } diff --git a/indra/llmessage/llxfer_mem.cpp b/indra/llmessage/llxfer_mem.cpp index 4c7e83c33d..3bea08f2e5 100755 --- a/indra/llmessage/llxfer_mem.cpp +++ b/indra/llmessage/llxfer_mem.cpp @@ -130,7 +130,7 @@ S32 LLXfer_Mem::processEOF() mStatus = e_LL_XFER_COMPLETE; - llinfos << "xfer complete: " << getFileName() << llendl; + LL_INFOS() << "xfer complete: " << getFileName() << LL_ENDL; if (mCallback) { @@ -164,7 +164,7 @@ S32 LLXfer_Mem::initializeRequest(U64 xfer_id, mRemotePath = remote_path; mDeleteRemoteOnCompletion = delete_remote_on_completion; - llinfos << "Requesting file: " << remote_filename << llendl; + LL_INFOS() << "Requesting file: " << remote_filename << LL_ENDL; delete [] mBuffer; mBuffer = NULL; diff --git a/indra/llmessage/llxfer_vfile.cpp b/indra/llmessage/llxfer_vfile.cpp index 751a69518c..4a378d1d34 100755 --- a/indra/llmessage/llxfer_vfile.cpp +++ b/indra/llmessage/llxfer_vfile.cpp @@ -118,7 +118,7 @@ S32 LLXfer_VFile::initializeRequest(U64 xfer_id, mName = llformat("VFile %s:%s", id_string.c_str(), LLAssetType::lookup(mType)); - llinfos << "Requesting " << mName << llendl; + LL_INFOS() << "Requesting " << mName << LL_ENDL; if (mBuffer) { @@ -236,8 +236,8 @@ S32 LLXfer_VFile::suck(S32 start_position) // grab a buffer from the right place in the file if (! mVFile->seek(start_position, 0)) { - llwarns << "VFile Xfer Can't seek to position " << start_position << ", file length " << mVFile->getSize() << llendl; - llwarns << "While sending file " << mLocalID << llendl; + LL_WARNS() << "VFile Xfer Can't seek to position " << start_position << ", file length " << mVFile->getSize() << LL_ENDL; + LL_WARNS() << "While sending file " << mLocalID << LL_ENDL; return -1; } @@ -291,7 +291,7 @@ S32 LLXfer_VFile::processEOF() LLVFile file(mVFS, mTempID, mType, LLVFile::WRITE); if (! file.rename(mLocalID, mType)) { - llinfos << "copy from temp file failed: unable to rename to " << mLocalID << llendl; + LL_INFOS() << "copy from temp file failed: unable to rename to " << mLocalID << LL_ENDL; } } diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp index 00b9d81611..b518dd1b72 100755 --- a/indra/llmessage/llxfermanager.cpp +++ b/indra/llmessage/llxfermanager.cpp @@ -196,13 +196,13 @@ void LLXferManager::printHostStatus() LLHostStatus *host_statusp = NULL; if (!mOutgoingHosts.empty()) { - llinfos << "Outgoing Xfers:" << llendl; + LL_INFOS() << "Outgoing Xfers:" << LL_ENDL; for (status_list_t::iterator iter = mOutgoingHosts.begin(); iter != mOutgoingHosts.end(); ++iter) { host_statusp = *iter; - llinfos << " " << host_statusp->mHost << " active: " << host_statusp->mNumActive << " pending: " << host_statusp->mNumPending << llendl; + LL_INFOS() << " " << host_statusp->mHost << " active: " << host_statusp->mNumActive << " pending: " << host_statusp->mNumPending << LL_ENDL; } } } @@ -392,7 +392,7 @@ U64 LLXferManager::registerXfer(const void *datap, const S32 length) } else { - llerrs << "Xfer allocation error" << llendl; + LL_ERRS() << "Xfer allocation error" << LL_ENDL; xfer_id = 0; } @@ -455,7 +455,7 @@ void LLXferManager::requestFile(const std::string& local_filename, } else { - llerrs << "Xfer allocation error" << llendl; + LL_ERRS() << "Xfer allocation error" << LL_ENDL; } } @@ -483,7 +483,7 @@ void LLXferManager::requestFile(const std::string& remote_filename, } else { - llerrs << "Xfer allocation error" << llendl; + LL_ERRS() << "Xfer allocation error" << LL_ENDL; } } @@ -528,7 +528,7 @@ void LLXferManager::requestVFile(const LLUUID& local_id, } else { - llerrs << "Xfer allocation error" << llendl; + LL_ERRS() << "Xfer allocation error" << LL_ENDL; } } @@ -570,7 +570,7 @@ void LLXferManager::requestXfer( } else { - llerrs << "Xfer allcoation error" << llendl; + LL_ERRS() << "Xfer allcoation error" << LL_ENDL; } } @@ -589,7 +589,7 @@ void LLXferManager::requestXfer(U64 xfer_id, const LLHost &remote_host, BOOL del } else { - llerrs << "Xfer allcoation error" << llendl; + LL_ERRS() << "Xfer allcoation error" << LL_ENDL; } } */ @@ -616,9 +616,9 @@ void LLXferManager::processReceiveData (LLMessageSystem *mesgsys, void ** /*user if (!xferp) { char U64_BUF[MAX_STRING]; /* Flawfinder : ignore */ - llwarns << "received xfer data from " << mesgsys->getSender() + LL_WARNS() << "received xfer data from " << mesgsys->getSender() << " for non-existent xfer id: " - << U64_to_str(id, U64_BUF, sizeof(U64_BUF)) << llendl; + << U64_to_str(id, U64_BUF, sizeof(U64_BUF)) << LL_ENDL; return; } @@ -629,11 +629,11 @@ void LLXferManager::processReceiveData (LLMessageSystem *mesgsys, void ** /*user // confirm it if it was a resend of the last one, since the confirmation might have gotten dropped if (decodePacketNum(packetnum) == (xferp->mPacketNum - 1)) { - llinfos << "Reconfirming xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet " << packetnum << llendl; sendConfirmPacket(mesgsys, id, decodePacketNum(packetnum), mesgsys->getSender()); + LL_INFOS() << "Reconfirming xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet " << packetnum << LL_ENDL; sendConfirmPacket(mesgsys, id, decodePacketNum(packetnum), mesgsys->getSender()); } else { - llinfos << "Ignoring xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " recv'd packet " << packetnum << "; expecting " << xferp->mPacketNum << llendl; + LL_INFOS() << "Ignoring xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " recv'd packet " << packetnum << "; expecting " << xferp->mPacketNum << LL_ENDL; } return; } @@ -677,7 +677,7 @@ void LLXferManager::processReceiveData (LLMessageSystem *mesgsys, void ** /*user ack_info.mID = id; ack_info.mPacketNum = decodePacketNum(packetnum); ack_info.mRemoteHost = mesgsys->getSender(); - mXferAckQueue.push(ack_info); + mXferAckQueue.push_back(ack_info); } if (isLastPacket(packetnum)) @@ -802,8 +802,8 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user mesgsys->getU64Fast(_PREHASH_XferID, _PREHASH_ID, id); char U64_BUF[MAX_STRING]; /* Flawfinder : ignore */ - llinfos << "xfer request id: " << U64_to_str(id, U64_BUF, sizeof(U64_BUF)) - << " to " << mesgsys->getSender() << llendl; + LL_INFOS() << "xfer request id: " << U64_to_str(id, U64_BUF, sizeof(U64_BUF)) + << " to " << mesgsys->getSender() << LL_ENDL; mesgsys->getStringFast(_PREHASH_XferID, _PREHASH_Filename, local_filename); @@ -823,16 +823,16 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user { if(NULL == LLAssetType::lookup(type)) { - llwarns << "Invalid type for xfer request: " << uuid << ":" - << type_s16 << " to " << mesgsys->getSender() << llendl; + LL_WARNS() << "Invalid type for xfer request: " << uuid << ":" + << type_s16 << " to " << mesgsys->getSender() << LL_ENDL; return; } - llinfos << "starting vfile transfer: " << uuid << "," << LLAssetType::lookup(type) << " to " << mesgsys->getSender() << llendl; + LL_INFOS() << "starting vfile transfer: " << uuid << "," << LLAssetType::lookup(type) << " to " << mesgsys->getSender() << LL_ENDL; if (! mVFS) { - llwarns << "Attempt to send VFile w/o available VFS" << llendl; + LL_WARNS() << "Attempt to send VFile w/o available VFS" << LL_ENDL; return; } @@ -845,7 +845,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user } else { - llerrs << "Xfer allcoation error" << llendl; + LL_ERRS() << "Xfer allcoation error" << LL_ENDL; } } else if (!local_filename.empty()) @@ -868,7 +868,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user case LL_PATH_NONE: if(!validateFileForTransfer(local_filename)) { - llwarns << "SECURITY: Unapproved filename '" << local_filename << llendl; + LL_WARNS() << "SECURITY: Unapproved filename '" << local_filename << LL_ENDL; return; } break; @@ -876,13 +876,13 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user case LL_PATH_CACHE: if(!verify_cache_filename(local_filename)) { - llwarns << "SECURITY: Illegal cache filename '" << local_filename << llendl; + LL_WARNS() << "SECURITY: Illegal cache filename '" << local_filename << LL_ENDL; return; } break; default: - llwarns << "SECURITY: Restricted file dir enum: " << (U32)local_path << llendl; + LL_WARNS() << "SECURITY: Restricted file dir enum: " << (U32)local_path << LL_ENDL; return; } @@ -897,7 +897,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user { expanded_filename = local_filename; } - llinfos << "starting file transfer: " << expanded_filename << " to " << mesgsys->getSender() << llendl; + LL_INFOS() << "starting file transfer: " << expanded_filename << " to " << mesgsys->getSender() << LL_ENDL; BOOL delete_local_on_completion = FALSE; mesgsys->getBOOL("XferID", "DeleteOnCompletion", delete_local_on_completion); @@ -913,15 +913,15 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user } else { - llerrs << "Xfer allcoation error" << llendl; + LL_ERRS() << "Xfer allcoation error" << LL_ENDL; } } else { char U64_BUF[MAX_STRING]; /* Flawfinder : ignore */ - llinfos << "starting memory transfer: " + LL_INFOS() << "starting memory transfer: " << U64_to_str(id, U64_BUF, sizeof(U64_BUF)) << " to " - << mesgsys->getSender() << llendl; + << mesgsys->getSender() << LL_ENDL; xferp = findXfer(id, mSendList); @@ -931,7 +931,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user } else { - llinfos << "Warning: " << U64_BUF << " not found." << llendl; + LL_INFOS() << "Warning: " << U64_BUF << " not found." << LL_ENDL; result = LL_ERR_FILE_NOT_FOUND; } } @@ -945,7 +945,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user } else // can happen with a memory transfer not found { - llinfos << "Aborting xfer to " << mesgsys->getSender() << " with error: " << result << llendl; + LL_INFOS() << "Aborting xfer to " << mesgsys->getSender() << " with error: " << result << LL_ENDL; mesgsys->newMessageFast(_PREHASH_AbortXfer); mesgsys->nextBlockFast(_PREHASH_XferID); @@ -959,18 +959,18 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user { xferp->sendNextPacket(); changeNumActiveXfers(xferp->mRemoteHost,1); -// llinfos << "***STARTING XFER IMMEDIATELY***" << llendl; +// LL_INFOS() << "***STARTING XFER IMMEDIATELY***" << LL_ENDL; } else { if(xferp) { - llinfos << " queueing xfer request, " << numPendingXfers(xferp->mRemoteHost) << " ahead of this one" << llendl; + LL_INFOS() << " queueing xfer request, " << numPendingXfers(xferp->mRemoteHost) << " ahead of this one" << LL_ENDL; } else { - llwarns << "LLXferManager::processFileRequest() - no xfer found!" - << llendl; + LL_WARNS() << "LLXferManager::processFileRequest() - no xfer found!" + << LL_ENDL; } } } @@ -1016,7 +1016,7 @@ void LLXferManager::retransmitUnackedPackets () // if the circuit dies, abort if (! gMessageSystem->mCircuitInfo.isCircuitAlive( xferp->mRemoteHost )) { - llinfos << "Xfer found in progress on dead circuit, aborting" << llendl; + LL_INFOS() << "Xfer found in progress on dead circuit, aborting" << LL_ENDL; xferp->mCallbackResult = LL_ERR_CIRCUIT_GONE; xferp->processEOF(); delp = xferp; @@ -1038,7 +1038,7 @@ void LLXferManager::retransmitUnackedPackets () { if (xferp->mRetries > LL_PACKET_RETRY_LIMIT) { - llinfos << "dropping xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet retransmit limit exceeded, xfer dropped" << llendl; + LL_INFOS() << "dropping xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet retransmit limit exceeded, xfer dropped" << LL_ENDL; xferp->abort(LL_ERR_TCP_TIMEOUT); delp = xferp; xferp = xferp->mNext; @@ -1046,14 +1046,14 @@ void LLXferManager::retransmitUnackedPackets () } else { - llinfos << "resending xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet unconfirmed after: "<< et << " sec, packet " << xferp->mPacketNum << llendl; + LL_INFOS() << "resending xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet unconfirmed after: "<< et << " sec, packet " << xferp->mPacketNum << LL_ENDL; xferp->resendLastPacket(); xferp = xferp->mNext; } } else if ((xferp->mStatus == e_LL_XFER_REGISTERED) && ( (et = xferp->ACKTimer.getElapsedTimeF32()) > LL_XFER_REGISTRATION_TIMEOUT)) { - llinfos << "registered xfer never requested, xfer dropped" << llendl; + LL_INFOS() << "registered xfer never requested, xfer dropped" << LL_ENDL; xferp->abort(LL_ERR_TCP_TIMEOUT); delp = xferp; xferp = xferp->mNext; @@ -1061,17 +1061,17 @@ void LLXferManager::retransmitUnackedPackets () } else if (xferp->mStatus == e_LL_XFER_ABORTED) { - llwarns << "Removing aborted xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << llendl; + LL_WARNS() << "Removing aborted xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << LL_ENDL; delp = xferp; xferp = xferp->mNext; removeXfer(delp,&mSendList); } else if (xferp->mStatus == e_LL_XFER_PENDING) { -// llinfos << "*** numActiveXfers = " << numActiveXfers(xferp->mRemoteHost) << " mMaxOutgoingXfersPerCircuit = " << mMaxOutgoingXfersPerCircuit << llendl; +// LL_INFOS() << "*** numActiveXfers = " << numActiveXfers(xferp->mRemoteHost) << " mMaxOutgoingXfersPerCircuit = " << mMaxOutgoingXfersPerCircuit << LL_ENDL; if (numActiveXfers(xferp->mRemoteHost) < mMaxOutgoingXfersPerCircuit) { -// llinfos << "bumping pending xfer to active" << llendl; +// LL_INFOS() << "bumping pending xfer to active" << LL_ENDL; xferp->sendNextPacket(); changeNumActiveXfers(xferp->mRemoteHost,1); } @@ -1088,16 +1088,16 @@ void LLXferManager::retransmitUnackedPackets () // so we don't blow through bandwidth. // - while (mXferAckQueue.getLength()) + while (mXferAckQueue.size()) { if (mAckThrottle.checkOverflow(1000.0f*8.0f)) { break; } - //llinfos << "Confirm packet queue length:" << mXferAckQueue.getLength() << llendl; - LLXferAckInfo ack_info; - mXferAckQueue.pop(ack_info); - //llinfos << "Sending confirm packet" << llendl; + //LL_INFOS() << "Confirm packet queue length:" << mXferAckQueue.size() << LL_ENDL; + LLXferAckInfo ack_info = mXferAckQueue.front(); + mXferAckQueue.pop_front(); + //LL_INFOS() << "Sending confirm packet" << LL_ENDL; sendConfirmPacket(gMessageSystem, ack_info.mID, ack_info.mPacketNum, ack_info.mRemoteHost); mAckThrottle.throttleOverflow(1000.f*8.f); // Assume 1000 bytes/packet } @@ -1156,9 +1156,9 @@ void LLXferManager::startPendingDownloads() S32 start_count = mMaxIncomingXfers - download_count; - lldebugs << "LLXferManager::startPendingDownloads() - XFER_IN_PROGRESS: " + LL_DEBUGS() << "LLXferManager::startPendingDownloads() - XFER_IN_PROGRESS: " << download_count << " XFER_PENDING: " << pending_count - << " startring " << llmin(start_count, pending_count) << llendl; + << " startring " << llmin(start_count, pending_count) << LL_ENDL; if((start_count > 0) && (pending_count > 0)) { diff --git a/indra/llmessage/llxfermanager.h b/indra/llmessage/llxfermanager.h index b84bccb5b7..b3d110e7a1 100755 --- a/indra/llmessage/llxfermanager.h +++ b/indra/llmessage/llxfermanager.h @@ -41,7 +41,7 @@ class LLVFS; #include "message.h" #include "llassetstorage.h" #include "lldir.h" -#include "lllinkedqueue.h" +#include <deque> #include "llthrottle.h" class LLHostStatus @@ -80,7 +80,7 @@ class LLXferManager S32 mMaxIncomingXfers; BOOL mUseAckThrottling; // Use ack throttling to cap file xfer bandwidth - LLLinkedQueue<LLXferAckInfo> mXferAckQueue; + std::deque<LLXferAckInfo> mXferAckQueue; LLThrottle mAckThrottle; public: diff --git a/indra/llmessage/machine.cpp b/indra/llmessage/machine.cpp index 8d2f512037..1e9c9c3c9a 100755 --- a/indra/llmessage/machine.cpp +++ b/indra/llmessage/machine.cpp @@ -33,7 +33,7 @@ void LLMachine::setMachinePort(S32 port) { if (port < 0) { - llinfos << "Can't assign a negative number to LLMachine::mPort" << llendl; + LL_INFOS() << "Can't assign a negative number to LLMachine::mPort" << LL_ENDL; mHost.setPort(0); } else @@ -46,7 +46,7 @@ void LLMachine::setControlPort( S32 port ) { if (port < 0) { - llinfos << "Can't assign a negative number to LLMachine::mControlPort" << llendl; + LL_INFOS() << "Can't assign a negative number to LLMachine::mControlPort" << LL_ENDL; mControlPort = 0; } else diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index c3642ccbe8..4e4dcc1d81 100755 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -47,10 +47,8 @@ // linden library headers #include "indra_constants.h" -#include "lldarray.h" #include "lldir.h" #include "llerror.h" -#include "llerrorlegacy.h" #include "llfasttimer.h" #include "llhttpclient.h" #include "llhttpnodeadapter.h" @@ -73,7 +71,6 @@ #include "lltransfermanager.h" #include "lluuid.h" #include "llxfermanager.h" -#include "timing.h" #include "llquaternion.h" #include "u64.h" #include "v3dmath.h" @@ -83,7 +80,7 @@ // Constants //const char* MESSAGE_LOG_FILENAME = "message.log"; -static const F32 CIRCUIT_DUMP_TIMEOUT = 30.f; +static const F32Seconds CIRCUIT_DUMP_TIMEOUT(30.f); static const S32 TRUST_TIME_WINDOW = 3; // *NOTE: This needs to be moved into a seperate file so that it never gets @@ -120,7 +117,7 @@ namespace { LL_WARNS("Messaging") << "error status " << status << " for message " << mMessageName - << " reason " << reason << llendl; + << " reason " << reason << LL_ENDL; } // TODO: Map status in to useful error code. if(NULL != mCallback) mCallback(mCallbackData, LL_ERR_TCP_TIMEOUT); @@ -155,7 +152,7 @@ void LLMessageHandlerBridge::post(LLHTTPNode::ResponsePtr response, std::string name = context["request"]["wildcard"]["message-name"]; char* namePtr = LLMessageStringTable::getInstance()->getString(name.c_str()); - lldebugs << "Setting mLastSender " << input["sender"].asString() << llendl; + LL_DEBUGS() << "Setting mLastSender " << input["sender"].asString() << LL_ENDL; gMessageSystem->mLastSender = LLHost(input["sender"].asString()); gMessageSystem->mPacketsIn += 1; gMessageSystem->mLLSDMessageReader->setMessage(namePtr, input["body"]); @@ -241,7 +238,7 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, S32 version_patch, bool failure_is_fatal, const F32 circuit_heartbeat_interval, const F32 circuit_timeout) : - mCircuitInfo(circuit_heartbeat_interval, circuit_timeout), + mCircuitInfo(F32Seconds(circuit_heartbeat_interval), F32Seconds(circuit_timeout)), mLastMessageFromTrustedMessageService(false) { init(); @@ -262,7 +259,7 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, mSendPacketFailureCount = 0; - mCircuitPrintFreq = 60.f; // seconds + mCircuitPrintFreq = F32Seconds(60.f); loadTemplateFile(filename, failure_is_fatal); @@ -284,14 +281,14 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, mbError = TRUE; mErrorCode = error; } -// LL_DEBUGS("Messaging") << << "*** port: " << mPort << llendl; +// LL_DEBUGS("Messaging") << << "*** port: " << mPort << LL_ENDL; // // Create the data structure that we can poll on // if (!gAPRPoolp) { - LL_ERRS("Messaging") << "No APR pool before message system initialization!" << llendl; + LL_ERRS("Messaging") << "No APR pool before message system initialization!" << LL_ENDL; ll_init_apr(); } apr_socket_t *aprSocketp = NULL; @@ -306,20 +303,20 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, mPollInfop->mPollFD.desc.s = aprSocketp; mPollInfop->mPollFD.client_data = NULL; - F64 mt_sec = getMessageTimeSeconds(); + F64Seconds mt_sec = getMessageTimeSeconds(); mResendDumpTime = mt_sec; mMessageCountTime = mt_sec; mCircuitPrintTime = mt_sec; - mCurrentMessageTimeSeconds = mt_sec; + mCurrentMessageTime = F64Seconds(mt_sec); // Constants for dumping output based on message processing time/count mNumMessageCounts = 0; mMaxMessageCounts = 200; // >= 0 means dump warnings - mMaxMessageTime = 1.f; + mMaxMessageTime = F32Seconds(1.f); mTrueReceiveSize = 0; - mReceiveTime = 0.f; + mReceiveTime = F32Seconds(0.f); } @@ -329,7 +326,7 @@ void LLMessageSystem::loadTemplateFile(const std::string& filename, bool failure { if(filename.empty()) { - LL_ERRS("Messaging") << "No template filename specified" << llendl; + LL_ERRS("Messaging") << "No template filename specified" << LL_ENDL; mbError = TRUE; return; } @@ -338,9 +335,9 @@ void LLMessageSystem::loadTemplateFile(const std::string& filename, bool failure if(!_read_file_into_string(template_body, filename)) { if (failure_is_fatal) { - LL_ERRS("Messaging") << "Failed to open template: " << filename << llendl; + LL_ERRS("Messaging") << "Failed to open template: " << filename << LL_ENDL; } else { - LL_WARNS("Messaging") << "Failed to open template: " << filename << llendl; + LL_WARNS("Messaging") << "Failed to open template: " << filename << LL_ENDL; } mbError = TRUE; return; @@ -534,7 +531,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) { // This is the first message being handled after a resetReceiveCounts, // we must be starting the message processing loop. Reset the timers. - mCurrentMessageTimeSeconds = totalTime() * SEC_PER_USEC; + mCurrentMessageTime = totalTime(); mMessageCountTime = getMessageTimeSeconds(); } @@ -566,7 +563,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) // Ones that are non-zero but below the minimum packet size are worrisome. if (receive_size > 0) { - LL_WARNS("Messaging") << "Invalid (too short) packet discarded " << receive_size << llendl; + LL_WARNS("Messaging") << "Invalid (too short) packet discarded " << receive_size << LL_ENDL; callExceptionFunc(MX_PACKET_TOO_SHORT); } // no data in packet receive buffer @@ -592,7 +589,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) // the next one LL_WARNS("Messaging") << "Malformed packet received. Packet size " << receive_size << " with invalid no. of acks " << acks - << llendl; + << LL_ENDL; valid_packet = FALSE; continue; } @@ -620,7 +617,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) memcpy(&mem_id, &mTrueReceiveBuffer[true_rcv_size], /* Flawfinder: ignore*/ sizeof(TPACKETID)); packet_id = ntohl(mem_id); - //LL_INFOS("Messaging") << "got ack: " << packet_id << llendl; + //LL_INFOS("Messaging") << "got ack: " << packet_id << LL_ENDL; cdp->ackReliablePacket(packet_id); } if (!cdp->getUnackedPacketCount()) @@ -652,14 +649,14 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) // LL_WARNS("Messaging") << "DISCARDED PACKET HOST MISMATCH! HOST: " // << host << " CIRCUIT: " // << mCircuitInfo.mCurrentCircuit->mHost - // << llendl; + // << LL_ENDL; //} // *************************************** //mCircuitInfo.mCurrentCircuit->mAcks.put(mCurrentRecvPacketID); cdp->collectRAck(mCurrentRecvPacketID); } - LL_DEBUGS("Messaging") << "Discarding duplicate resend from " << host << llendl; + LL_DEBUGS("Messaging") << "Discarding duplicate resend from " << host << LL_ENDL; if(mVerboseLog) { std::ostringstream str; @@ -671,7 +668,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) << " resent " << ((acks > 0) ? "acks" : "") << " DISCARD DUPLICATE"; - LL_INFOS("Messaging") << str.str() << llendl; + LL_INFOS("Messaging") << str.str() << LL_ENDL; } mPacketsIn++; valid_packet = FALSE; @@ -750,7 +747,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) { if (mbProtected && (!cdp)) { - LL_WARNS("Messaging") << "Invalid Packet from invalid circuit " << host << llendl; + LL_WARNS("Messaging") << "Invalid Packet from invalid circuit " << host << LL_ENDL; mOffCircuitPackets++; } else @@ -761,7 +758,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) } } while (!valid_packet && receive_size > 0); - F64 mt_sec = getMessageTimeSeconds(); + F64Seconds mt_sec = getMessageTimeSeconds(); // Check to see if we need to print debug info if ((mt_sec - mCircuitPrintTime) > mCircuitPrintFreq) { @@ -792,7 +789,7 @@ S32 LLMessageSystem::getReceiveBytes() const void LLMessageSystem::processAcks() { - F64 mt_sec = getMessageTimeSeconds(); + F64Seconds mt_sec = getMessageTimeSeconds(); { gTransferManager.updateTransfers(); @@ -820,7 +817,7 @@ void LLMessageSystem::processAcks() if (!mDenyTrustedCircuitSet.empty()) { - LL_INFOS("Messaging") << "Sending queued DenyTrustedCircuit messages." << llendl; + LL_INFOS("Messaging") << "Sending queued DenyTrustedCircuit messages." << LL_ENDL; for (host_set_t::iterator hostit = mDenyTrustedCircuitSet.begin(); hostit != mDenyTrustedCircuitSet.end(); ++hostit) { reallySendDenyTrustedCircuit(*hostit); @@ -836,10 +833,10 @@ void LLMessageSystem::processAcks() } } - if (mMaxMessageTime >= 0.f) + if (mMaxMessageTime >= F32Seconds(0.f)) { // This is one of the only places where we're required to get REAL message system time. - mReceiveTime = (F32)(getMessageTimeSeconds(TRUE) - mMessageCountTime); + mReceiveTime = getMessageTimeSeconds(TRUE) - mMessageCountTime; if (mReceiveTime > mMaxMessageTime) { dump = TRUE; @@ -894,7 +891,7 @@ LLSD LLMessageSystem::getBuiltMessageLLSD() const else { // TODO: implement as below? - llerrs << "Message not built as LLSD." << llendl; + LL_ERRS() << "Message not built as LLSD." << LL_ENDL; } return result; } @@ -1013,13 +1010,13 @@ S32 LLMessageSystem::sendReliable(const LLHost &host) S32 LLMessageSystem::sendSemiReliable(const LLHost &host, void (*callback)(void **,S32), void ** callback_data) { - F32 timeout; + F32Seconds timeout; LLCircuitData *cdp = mCircuitInfo.findCircuit(host); if (cdp) { timeout = llmax(LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS, - LL_SEMIRELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged()); + F32Seconds(LL_SEMIRELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged())); } else { @@ -1035,7 +1032,7 @@ S32 LLMessageSystem::sendSemiReliable(const LLHost &host, void (*callback)(void S32 LLMessageSystem::sendReliable( const LLHost &host, S32 retries, BOOL ping_based_timeout, - F32 timeout, + F32Seconds timeout, void (*callback)(void **,S32), void ** callback_data) { @@ -1044,11 +1041,11 @@ S32 LLMessageSystem::sendReliable( const LLHost &host, LLCircuitData *cdp = mCircuitInfo.findCircuit(host); if (cdp) { - timeout = llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, LL_RELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged()); + timeout = llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, F32Seconds(LL_RELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged())); } else { - timeout = llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, LL_RELIABLE_TIMEOUT_FACTOR * LL_AVERAGED_PING_MAX); + timeout = llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, F32Seconds(LL_RELIABLE_TIMEOUT_FACTOR * LL_AVERAGED_PING_MAX)); } } @@ -1080,7 +1077,7 @@ void LLMessageSystem::forwardReliable(const U32 circuit_code) S32 LLMessageSystem::forwardReliable( const LLHost &host, S32 retries, BOOL ping_based_timeout, - F32 timeout, + F32Seconds timeout, void (*callback)(void **,S32), void ** callback_data) { @@ -1090,13 +1087,13 @@ S32 LLMessageSystem::forwardReliable( const LLHost &host, S32 LLMessageSystem::flushSemiReliable(const LLHost &host, void (*callback)(void **,S32), void ** callback_data) { - F32 timeout; + F32Seconds timeout; LLCircuitData *cdp = mCircuitInfo.findCircuit(host); if (cdp) { timeout = llmax(LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS, - LL_SEMIRELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged()); + F32Seconds(LL_SEMIRELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged())); } else { @@ -1147,7 +1144,7 @@ LLHTTPClient::ResponderPtr LLMessageSystem::createResponder(const std::string& n // explicitly sent as reliable, so they don't have a callback // LL_WARNS("Messaging") << "LLMessageSystem::sendMessage: Sending unreliable " // << mMessageBuilder->getMessageName() << " message via HTTP" -// << llendl; +// << LL_ENDL; return new LLFnPtrResponder( NULL, NULL, @@ -1156,7 +1153,7 @@ LLHTTPClient::ResponderPtr LLMessageSystem::createResponder(const std::string& n } // This can be called from signal handlers, -// so should should not use llinfos. +// so should should not use LL_INFOS(). S32 LLMessageSystem::sendMessage(const LLHost &host) { if (! mMessageBuilder->isBuilt()) @@ -1183,11 +1180,11 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) if(mVerboseLog) { LL_INFOS_ONCE("Messaging") << "MSG: -> " << host << "\tUNKNOWN CIRCUIT:\t" - << mMessageBuilder->getMessageName() << llendl; + << mMessageBuilder->getMessageName() << LL_ENDL; } LL_WARNS_ONCE("Messaging") << "sendMessage - Trying to send " << mMessageBuilder->getMessageName() << " on unknown circuit " - << host << llendl; + << host << LL_ENDL; return 0; } else @@ -1206,11 +1203,11 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) if(mVerboseLog) { LL_INFOS("Messaging") << "MSG: -> " << host << "\tDEAD CIRCUIT\t\t" - << mMessageBuilder->getMessageName() << llendl; + << mMessageBuilder->getMessageName() << LL_ENDL; } LL_WARNS("Messaging") << "sendMessage - Trying to send message " << mMessageBuilder->getMessageName() << " to dead circuit " - << host << llendl; + << host << LL_ENDL; return 0; } } @@ -1255,7 +1252,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) LL_WARNS("Messaging") << "sendMessage - Trying to send " << ((buffer_length > 4000) ? "EXTRA " : "") << "BIG message " << mMessageBuilder->getMessageName() << " - " - << buffer_length << llendl; + << buffer_length << LL_ENDL; } } if (mSendReliable) @@ -1317,7 +1314,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) // append_acout_count is incorrect or that // MAX_BUFFER_SIZE has fallen below MTU which is bad // and probably programmer error. - LL_ERRS("Messaging") << "Buffer packing failed due to size.." << llendl; + LL_ERRS("Messaging") << "Buffer packing failed due to size.." << LL_ENDL; } } @@ -1340,7 +1337,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) else { // mCircuitInfo already points to the correct circuit data - cdp->addBytesOut( buffer_length ); + cdp->addBytesOut( (S32Bytes)buffer_length ); } if(mVerboseLog) @@ -1358,7 +1355,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) std::ostream_iterator<TPACKETID> append(str, " "); std::copy(acks.begin(), acks.end(), append); } - LL_INFOS("Messaging") << str.str() << llendl; + LL_INFOS("Messaging") << str.str() << LL_ENDL; } @@ -1382,7 +1379,7 @@ void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, BOOL recv_re << nullToEmpty(mMessageReader->getMessageName()) << (recv_reliable ? " reliable" : "") << " REJECTED"; - LL_INFOS("Messaging") << str.str() << llendl; + LL_INFOS("Messaging") << str.str() << LL_ENDL; } // nope! // cout << "Rejecting unexpected message " << mCurrentMessageTemplate->mName << " from " << hex << ip << " , " << dec << port << endl; @@ -1390,7 +1387,7 @@ void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, BOOL recv_re // Keep track of rejected messages as well if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM) { - LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << llendl; + LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << LL_ENDL; } else { @@ -1409,7 +1406,7 @@ S32 LLMessageSystem::sendMessage( { if (!(host.isOk())) { - LL_WARNS("Messaging") << "trying to send message to invalid host" << llendl; + LL_WARNS("Messaging") << "trying to send message to invalid host" << LL_ENDL; return 0; } @@ -1427,14 +1424,14 @@ void LLMessageSystem::logTrustedMsgFromUntrustedCircuit( const LLHost& host ) LL_WARNS("Messaging") << "Received trusted message on untrusted circuit. " << "Will reply with deny. " << "Message: " << nullToEmpty(mMessageReader->getMessageName()) - << " Host: " << host << llendl; + << " Host: " << host << LL_ENDL; } if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM) { LL_WARNS("Messaging") << "got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" - << llendl; + << LL_ENDL; } else { @@ -1452,7 +1449,7 @@ void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL r { if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM) { - LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << llendl; + LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << LL_ENDL; } else { @@ -1467,7 +1464,7 @@ void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL r { // update circuit packet ID tracking (missing/out of order packets) cdp->checkPacketInID( mCurrentRecvPacketID, recv_resent ); - cdp->addBytesIn( mTrueReceiveSize ); + cdp->addBytesIn( (S32Bytes)mTrueReceiveSize ); } if(mVerboseLog) @@ -1481,7 +1478,7 @@ void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL r << (recv_reliable ? " reliable" : "") << (recv_resent ? " resent" : "") << (recv_acks ? " acks" : ""); - LL_INFOS("Messaging") << str.str() << llendl; + LL_INFOS("Messaging") << str.str() << LL_ENDL; } } @@ -1491,54 +1488,54 @@ void LLMessageSystem::sanityCheck() // if (!mCurrentRMessageData) // { -// LL_ERRS("Messaging") << "mCurrentRMessageData is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentRMessageData is NULL" << LL_ENDL; // } // if (!mCurrentRMessageTemplate) // { -// LL_ERRS("Messaging") << "mCurrentRMessageTemplate is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentRMessageTemplate is NULL" << LL_ENDL; // } // if (!mCurrentRTemplateBlock) // { -// LL_ERRS("Messaging") << "mCurrentRTemplateBlock is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentRTemplateBlock is NULL" << LL_ENDL; // } // if (!mCurrentRDataBlock) // { -// LL_ERRS("Messaging") << "mCurrentRDataBlock is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentRDataBlock is NULL" << LL_ENDL; // } // if (!mCurrentSMessageData) // { -// LL_ERRS("Messaging") << "mCurrentSMessageData is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentSMessageData is NULL" << LL_ENDL; // } // if (!mCurrentSMessageTemplate) // { -// LL_ERRS("Messaging") << "mCurrentSMessageTemplate is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentSMessageTemplate is NULL" << LL_ENDL; // } // if (!mCurrentSTemplateBlock) // { -// LL_ERRS("Messaging") << "mCurrentSTemplateBlock is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentSTemplateBlock is NULL" << LL_ENDL; // } // if (!mCurrentSDataBlock) // { -// LL_ERRS("Messaging") << "mCurrentSDataBlock is NULL" << llendl; +// LL_ERRS("Messaging") << "mCurrentSDataBlock is NULL" << LL_ENDL; // } } void LLMessageSystem::showCircuitInfo() { - LL_INFOS("Messaging") << mCircuitInfo << llendl; + LL_INFOS("Messaging") << mCircuitInfo << LL_ENDL; } void LLMessageSystem::dumpCircuitInfo() { - lldebugst(LLERR_CIRCUIT_INFO) << mCircuitInfo << llendl; + LL_DEBUGS("Messaging") << mCircuitInfo << LL_ENDL; } /* virtual */ @@ -1582,7 +1579,7 @@ void LLMessageSystem::enableCircuit(const LLHost &host, BOOL trusted) void LLMessageSystem::disableCircuit(const LLHost &host) { - LL_INFOS("Messaging") << "LLMessageSystem::disableCircuit for " << host << llendl; + LL_INFOS("Messaging") << "LLMessageSystem::disableCircuit for " << host << LL_ENDL; U32 code = gMessageSystem->findCircuitCode( host ); // Don't need to do this, as we're removing the circuit info anyway - djs 01/28/03 @@ -1595,7 +1592,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host) code_session_map_t::iterator it = mCircuitCodes.find(code); if(it != mCircuitCodes.end()) { - LL_INFOS("Messaging") << "Circuit " << code << " removed from list" << llendl; + LL_INFOS("Messaging") << "Circuit " << code << " removed from list" << LL_ENDL; //mCircuitCodes.removeData(code); mCircuitCodes.erase(it); } @@ -1611,7 +1608,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host) U32 old_port = (U32)(ip_port & (U64)0xFFFFFFFF); U32 old_ip = (U32)(ip_port >> 32); - LL_INFOS("Messaging") << "Host " << LLHost(old_ip, old_port) << " circuit " << code << " removed from lookup table" << llendl; + LL_INFOS("Messaging") << "Host " << LLHost(old_ip, old_port) << " circuit " << code << " removed from lookup table" << LL_ENDL; gMessageSystem->mIPPortToCircuitCode.erase(ip_port); } mCircuitInfo.removeCircuitData(host); @@ -1621,7 +1618,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host) // Sigh, since we can open circuits which don't have circuit // codes, it's possible for this to happen... - LL_WARNS("Messaging") << "Couldn't find circuit code for " << host << llendl; + LL_WARNS("Messaging") << "Couldn't find circuit code for " << host << LL_ENDL; } } @@ -1652,7 +1649,7 @@ BOOL LLMessageSystem::checkCircuitBlocked(const U32 circuit) if (!host.isOk()) { - LL_DEBUGS("Messaging") << "checkCircuitBlocked: Unknown circuit " << circuit << llendl; + LL_DEBUGS("Messaging") << "checkCircuitBlocked: Unknown circuit " << circuit << LL_ENDL; return TRUE; } @@ -1663,7 +1660,7 @@ BOOL LLMessageSystem::checkCircuitBlocked(const U32 circuit) } else { - LL_INFOS("Messaging") << "checkCircuitBlocked(circuit): Unknown host - " << host << llendl; + LL_INFOS("Messaging") << "checkCircuitBlocked(circuit): Unknown host - " << host << LL_ENDL; return FALSE; } } @@ -1674,7 +1671,7 @@ BOOL LLMessageSystem::checkCircuitAlive(const U32 circuit) if (!host.isOk()) { - LL_DEBUGS("Messaging") << "checkCircuitAlive: Unknown circuit " << circuit << llendl; + LL_DEBUGS("Messaging") << "checkCircuitAlive: Unknown circuit " << circuit << LL_ENDL; return FALSE; } @@ -1685,7 +1682,7 @@ BOOL LLMessageSystem::checkCircuitAlive(const U32 circuit) } else { - LL_INFOS("Messaging") << "checkCircuitAlive(circuit): Unknown host - " << host << llendl; + LL_INFOS("Messaging") << "checkCircuitAlive(circuit): Unknown host - " << host << LL_ENDL; return FALSE; } } @@ -1699,7 +1696,7 @@ BOOL LLMessageSystem::checkCircuitAlive(const LLHost &host) } else { - LL_DEBUGS("Messaging") << "checkCircuitAlive(host): Unknown host - " << host << llendl; + LL_DEBUGS("Messaging") << "checkCircuitAlive(host): Unknown host - " << host << LL_ENDL; return FALSE; } } @@ -1734,7 +1731,7 @@ LLHost LLMessageSystem::findHost(const U32 circuit_code) void LLMessageSystem::setMaxMessageTime(const F32 seconds) { - mMaxMessageTime = seconds; + mMaxMessageTime = F32Seconds(seconds); } void LLMessageSystem::setMaxMessageCounts(const S32 num) @@ -1851,18 +1848,18 @@ void LLMessageSystem::processAssignCircuitCode(LLMessageSystem* msg, void**) { LL_WARNS("Messaging") << "AssignCircuitCode, bad session id. Expecting " << msg->getMySessionID() << " but got " << session_id - << llendl; + << LL_ENDL; return; } U32 code; msg->getU32Fast(_PREHASH_CircuitCode, _PREHASH_Code, code); if (!code) { - LL_ERRS("Messaging") << "Assigning circuit code of zero!" << llendl; + LL_ERRS("Messaging") << "Assigning circuit code of zero!" << LL_ENDL; } msg->mOurCircuitCode = code; - LL_INFOS("Messaging") << "Circuit code " << code << " assigned." << llendl; + LL_INFOS("Messaging") << "Circuit code " << code << " assigned." << LL_ENDL; } */ @@ -1886,20 +1883,20 @@ bool LLMessageSystem::addCircuitCode(U32 code, const LLUUID& session_id) { if(!code) { - LL_WARNS("Messaging") << "addCircuitCode: zero circuit code" << llendl; + LL_WARNS("Messaging") << "addCircuitCode: zero circuit code" << LL_ENDL; return false; } code_session_map_t::iterator it = mCircuitCodes.find(code); if(it == mCircuitCodes.end()) { - LL_INFOS("Messaging") << "New circuit code " << code << " added" << llendl; + LL_INFOS("Messaging") << "New circuit code " << code << " added" << LL_ENDL; //msg->mCircuitCodes[circuit_code] = circuit_code; mCircuitCodes.insert(code_session_map_t::value_type(code, session_id)); } else { - LL_INFOS("Messaging") << "Duplicate circuit code " << code << " added" << llendl; + LL_INFOS("Messaging") << "Duplicate circuit code " << code << " added" << LL_ENDL; } return true; } @@ -1933,7 +1930,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, // Whoah, abort! We don't know anything about this circuit code. LL_WARNS("Messaging") << "UseCircuitCode for " << circuit_code_in << " received without AddCircuitCode message - aborting" - << llendl; + << LL_ENDL; return; } @@ -1945,7 +1942,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, { LL_WARNS("Messaging") << "UseCircuitCode unmatched session id. Got " << session_id << " but expected " << (*it).second - << llendl; + << LL_ENDL; return; } @@ -1958,7 +1955,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, if ((ip_port_old == ip_port_in) && (circuit_code_old == circuit_code_in)) { // Current information is the same as incoming info, ignore - LL_INFOS("Messaging") << "Got duplicate UseCircuitCode for circuit " << circuit_code_in << " to " << msg->getSender() << llendl; + LL_INFOS("Messaging") << "Got duplicate UseCircuitCode for circuit " << circuit_code_in << " to " << msg->getSender() << LL_ENDL; return; } @@ -1968,27 +1965,27 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, msg->mIPPortToCircuitCode.erase(ip_port_old); U32 old_port = (U32)(ip_port_old & (U64)0xFFFFFFFF); U32 old_ip = (U32)(ip_port_old >> 32); - LL_INFOS("Messaging") << "Removing derelict lookup entry for circuit " << circuit_code_old << " to " << LLHost(old_ip, old_port) << llendl; + LL_INFOS("Messaging") << "Removing derelict lookup entry for circuit " << circuit_code_old << " to " << LLHost(old_ip, old_port) << LL_ENDL; } if (circuit_code_old) { LLHost cur_host(ip, port); - LL_WARNS("Messaging") << "Disabling existing circuit for " << cur_host << llendl; + LL_WARNS("Messaging") << "Disabling existing circuit for " << cur_host << LL_ENDL; msg->disableCircuit(cur_host); if (circuit_code_old == circuit_code_in) { - LL_WARNS("Messaging") << "Asymmetrical circuit to ip/port lookup!" << llendl; - LL_WARNS("Messaging") << "Multiple circuit codes for " << cur_host << " probably!" << llendl; - LL_WARNS("Messaging") << "Permanently disabling circuit" << llendl; + LL_WARNS("Messaging") << "Asymmetrical circuit to ip/port lookup!" << LL_ENDL; + LL_WARNS("Messaging") << "Multiple circuit codes for " << cur_host << " probably!" << LL_ENDL; + LL_WARNS("Messaging") << "Permanently disabling circuit" << LL_ENDL; return; } else { LL_WARNS("Messaging") << "Circuit code changed for " << msg->getSender() << " from " << circuit_code_old << " to " - << circuit_code_in << llendl; + << circuit_code_in << LL_ENDL; } } @@ -2030,7 +2027,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, LL_INFOS("Messaging") << "Circuit code " << circuit_code_in << " from " << msg->getSender() << " for agent " << id << " in session " - << session_id << llendl; + << session_id << LL_ENDL; const LLUseCircuitCodeResponder* responder = (const LLUseCircuitCodeResponder*) user; @@ -2041,7 +2038,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, } else { - LL_WARNS("Messaging") << "Got zero circuit code in use_circuit_code" << llendl; + LL_WARNS("Messaging") << "Got zero circuit code in use_circuit_code" << LL_ENDL; } } @@ -2063,7 +2060,7 @@ void LLMessageSystem::processError(LLMessageSystem* msg, void**) LL_WARNS("Messaging") << "Message error from " << msg->getSender() << " - " << error_code << " " << error_token << " " << error_id << " \"" - << error_system << "\" \"" << error_message << "\"" << llendl; + << error_system << "\" \"" << error_message << "\"" << LL_ENDL; } @@ -2099,7 +2096,7 @@ void LLMessageSystem::dispatch( gMessageSystem->mMessageTemplates.end()) && !LLMessageConfig::isValidMessage(msg_name)) { - LL_WARNS("Messaging") << "Ignoring unknown message " << msg_name << llendl; + LL_WARNS("Messaging") << "Ignoring unknown message " << msg_name << LL_ENDL; responsep->notFound("Invalid message name"); return; } @@ -2110,12 +2107,12 @@ void LLMessageSystem::dispatch( if (!handler) { LL_WARNS("Messaging") << "LLMessageService::dispatch > no handler for " - << path << llendl; + << path << LL_ENDL; return; } // enable this for output of message names - //LL_INFOS("Messaging") << "< \"" << msg_name << "\"" << llendl; - //lldebugs << "data: " << LLSDNotationStreamer(message) << llendl; + //LL_INFOS("Messaging") << "< \"" << msg_name << "\"" << LL_ENDL; + //LL_DEBUGS() << "data: " << LLSDNotationStreamer(message) << LL_ENDL; handler->post(responsep, context, message); } @@ -2233,7 +2230,7 @@ S32 LLMessageSystem::sendError( else { LL_WARNS("Messaging") << "Data and message were too large -- data removed." - << llendl; + << LL_ENDL; addBinaryData("Data", NULL, 0); } return sendReliable(host); @@ -2253,7 +2250,7 @@ void process_packet_ack(LLMessageSystem *msgsystem, void** /*user_data*/) for (S32 i = 0; i < ack_count; i++) { msgsystem->getU32Fast(_PREHASH_Packets, _PREHASH_ID, packet_id, i); -// LL_DEBUGS("Messaging") << "ack recvd' from " << host << " for packet " << (TPACKETID)packet_id << llendl; +// LL_DEBUGS("Messaging") << "ack recvd' from " << host << " for packet " << (TPACKETID)packet_id << LL_ENDL; cdp->ackReliablePacket(packet_id); } if (!cdp->getUnackedPacketCount()) @@ -2274,12 +2271,12 @@ void process_log_messages(LLMessageSystem* msg, void**) if (log_message) { - LL_INFOS("Messaging") << "Starting logging via message" << llendl; + LL_INFOS("Messaging") << "Starting logging via message" << LL_ENDL; msg->startLogging(); } else { - LL_INFOS("Messaging") << "Stopping logging via message" << llendl; + LL_INFOS("Messaging") << "Stopping logging via message" << LL_ENDL; msg->stopLogging(); } }*/ @@ -2299,7 +2296,7 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **) if (!cdp) { LL_WARNS("Messaging") << "Attempt to create trusted circuit without circuit data: " - << msg->getSender() << llendl; + << msg->getSender() << LL_ENDL; return; } @@ -2318,13 +2315,13 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **) if( msg->getBlockUntrustedInterface() ) { LL_WARNS("Messaging") << "Ignoring CreateTrustedCircuit on public interface from host: " - << msg->getSender() << llendl; + << msg->getSender() << LL_ENDL; return; } else { LL_WARNS("Messaging") << "Processing CreateTrustedCircuit on public interface from host: " - << msg->getSender() << llendl; + << msg->getSender() << LL_ENDL; } } @@ -2340,7 +2337,7 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **) if(msg->isMatchingDigestForWindowAndUUIDs(their_digest, TRUST_TIME_WINDOW, local_id, remote_id)) { cdp->setTrusted(TRUE); - LL_INFOS("Messaging") << "Trusted digest from " << msg->getSender() << llendl; + LL_INFOS("Messaging") << "Trusted digest from " << msg->getSender() << LL_ENDL; return; } else if (cdp->getTrusted()) @@ -2350,13 +2347,13 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **) // the message system is being slow. Don't bother sending the deny, as it may continually // ping-pong back and forth on a very hosed circuit. LL_WARNS("Messaging") << "Ignoring bad digest from known trusted circuit: " << their_digest - << " host: " << msg->getSender() << llendl; + << " host: " << msg->getSender() << LL_ENDL; return; } else { LL_WARNS("Messaging") << "Bad digest from known circuit: " << their_digest - << " host: " << msg->getSender() << llendl; + << " host: " << msg->getSender() << LL_ENDL; msg->sendDenyTrustedCircuit(msg->getSender()); return; } @@ -2392,13 +2389,13 @@ void process_deny_trusted_circuit(LLMessageSystem *msg, void **) if( msg->getBlockUntrustedInterface() ) { LL_WARNS("Messaging") << "Ignoring DenyTrustedCircuit on public interface from host: " - << msg->getSender() << llendl; + << msg->getSender() << LL_ENDL; return; } else { LL_WARNS("Messaging") << "Processing DenyTrustedCircuit on public interface from host: " - << msg->getSender() << llendl; + << msg->getSender() << LL_ENDL; } } @@ -2411,7 +2408,7 @@ void process_deny_trusted_circuit(LLMessageSystem *msg, void **) // *TODO: probably should keep a count of number of resends // per circuit, and stop resending after a while. LL_INFOS("Messaging") << "Got DenyTrustedCircuit. Sending CreateTrustedCircuit to " - << msg->getSender() << llendl; + << msg->getSender() << LL_ENDL; msg->sendCreateTrustedCircuit(msg->getSender(), local_id, remote_id); } @@ -2527,11 +2524,11 @@ bool start_messaging_system( if (gMessageSystem->mMessageFileVersionNumber != gPrehashVersionNumber) { LL_INFOS("AppInit") << "Message template version does not match prehash version number" << LL_ENDL; - LL_INFOS("AppInit") << "Run simulator with -prehash command line option to rebuild prehash data" << llendl; + LL_INFOS("AppInit") << "Run simulator with -prehash command line option to rebuild prehash data" << LL_ENDL; } else { - LL_DEBUGS("AppInit") << "Message template version matches prehash version number" << llendl; + LL_DEBUGS("AppInit") << "Message template version matches prehash version number" << LL_ENDL; } } @@ -2577,7 +2574,7 @@ void LLMessageSystem::startLogging() str << "\t<-\tincoming message" <<std::endl; str << "\t->\toutgoing message" << std::endl; str << " <> host size zero id name"; - LL_INFOS("Messaging") << str.str() << llendl; + LL_INFOS("Messaging") << str.str() << LL_ENDL; } void LLMessageSystem::stopLogging() @@ -2585,7 +2582,7 @@ void LLMessageSystem::stopLogging() if(mVerboseLog) { mVerboseLog = FALSE; - LL_INFOS("Messaging") << "END MESSAGE LOG" << llendl; + LL_INFOS("Messaging") << "END MESSAGE LOG" << LL_ENDL; } } @@ -2693,7 +2690,7 @@ void end_messaging_system(bool print_summary) { std::ostringstream str; gMessageSystem->summarizeLogs(str); - LL_INFOS("Messaging") << str.str().c_str() << llendl; + LL_INFOS("Messaging") << str.str().c_str() << LL_ENDL; } delete gMessageSystem; @@ -2746,7 +2743,7 @@ void LLMessageSystem::dumpReceiveCounts() if(mNumMessageCounts > 0) { - LL_DEBUGS("Messaging") << "Dump: " << mNumMessageCounts << " messages processed in " << mReceiveTime << " seconds" << llendl; + LL_DEBUGS("Messaging") << "Dump: " << mNumMessageCounts << " messages processed in " << mReceiveTime << " seconds" << LL_ENDL; for (message_template_name_map_t::const_iterator iter = mMessageTemplates.begin(), end = mMessageTemplates.end(); iter != end; iter++) @@ -2755,7 +2752,7 @@ void LLMessageSystem::dumpReceiveCounts() if (mt->mReceiveCount > 0) { LL_INFOS("Messaging") << "Num: " << std::setw(3) << mt->mReceiveCount << " Bytes: " << std::setw(6) << mt->mReceiveBytes - << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime) << "%" << llendl; + << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime.value()) << "%" << LL_ENDL; } } } @@ -2872,7 +2869,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size) if ((*data_size ) < LL_MINIMUM_VALID_PACKET_SIZE) { LL_WARNS("Messaging") << "zeroCodeExpand() called with data_size of " << *data_size - << llendl; + << LL_ENDL; } mTotalBytesIn += *data_size; @@ -2911,7 +2908,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size) { if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-1])) { - LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 1" << llendl; + LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 1" << LL_ENDL; callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE); outptr = mEncodedRecvBuffer; break; @@ -2923,7 +2920,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size) *outptr++ = *inptr++; if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-256])) { - LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 2" << llendl; + LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 2" << LL_ENDL; callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE); outptr = mEncodedRecvBuffer; count = -1; @@ -2942,7 +2939,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size) { if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-(*inptr)])) { - LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 3" << llendl; + LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 3" << LL_ENDL; callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE); outptr = mEncodedRecvBuffer; } @@ -2966,7 +2963,7 @@ void LLMessageSystem::addTemplate(LLMessageTemplate *templatep) if (mMessageTemplates.count(templatep->mName) > 0) { LL_ERRS("Messaging") << templatep->mName << " already used as a template name!" - << llendl; + << LL_ENDL; } mMessageTemplates[templatep->mName] = templatep; mMessageNumbers[templatep->mMessageNumber] = templatep; @@ -2982,7 +2979,7 @@ void LLMessageSystem::setHandlerFuncFast(const char *name, void (*handler_func)( } else { - LL_ERRS("Messaging") << name << " is not a known message name!" << llendl; + LL_ERRS("Messaging") << name << " is not a known message name!" << LL_ENDL; } } @@ -2995,7 +2992,7 @@ bool LLMessageSystem::callHandler(const char *name, if(iter == mMessageTemplates.end()) { LL_WARNS("Messaging") << "LLMessageSystem::callHandler: unknown message " - << name << llendl; + << name << LL_ENDL; return false; } @@ -3006,7 +3003,7 @@ bool LLMessageSystem::callHandler(const char *name, << name << " from " << (trustedSource ? "trusted " : "untrusted ") - << "source" << llendl; + << "source" << LL_ENDL; return false; } @@ -3042,7 +3039,7 @@ BOOL LLMessageSystem::callExceptionFunc(EMessageException exception) if (!ex_cb) { - LL_WARNS("Messaging") << "LLMessageSystem::callExceptionFunc: bad message exception callback." << llendl; + LL_WARNS("Messaging") << "LLMessageSystem::callExceptionFunc: bad message exception callback." << LL_ENDL; return FALSE; } @@ -3153,7 +3150,7 @@ bool LLMessageSystem::generateDigestForWindowAndUUIDs(char* digest, const S32 wi std::string shared_secret = get_shared_secret(); if(shared_secret.empty()) { - LL_ERRS("Messaging") << "Trying to generate complex digest on a machine without a shared secret!" << llendl; + LL_ERRS("Messaging") << "Trying to generate complex digest on a machine without a shared secret!" << LL_ENDL; } U32 now = (U32)time(NULL); @@ -3172,7 +3169,7 @@ bool LLMessageSystem::isMatchingDigestForWindowAndUUIDs(const char* digest, cons std::string shared_secret = get_shared_secret(); if(shared_secret.empty()) { - LL_ERRS("Messaging") << "Trying to compare complex digests on a machine without a shared secret!" << llendl; + LL_ERRS("Messaging") << "Trying to compare complex digests on a machine without a shared secret!" << LL_ENDL; } char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ @@ -3219,7 +3216,7 @@ bool LLMessageSystem::generateDigestForWindow(char* digest, const S32 window) co std::string shared_secret = get_shared_secret(); if(shared_secret.empty()) { - LL_ERRS("Messaging") << "Trying to generate simple digest on a machine without a shared secret!" << llendl; + LL_ERRS("Messaging") << "Trying to generate simple digest on a machine without a shared secret!" << LL_ENDL; } U32 now = (U32)time(NULL); @@ -3238,7 +3235,7 @@ bool LLMessageSystem::isMatchingDigestForWindow(const char* digest, S32 const wi std::string shared_secret = get_shared_secret(); if(shared_secret.empty()) { - LL_ERRS("Messaging") << "Trying to compare simple digests on a machine without a shared secret!" << llendl; + LL_ERRS("Messaging") << "Trying to compare simple digests on a machine without a shared secret!" << LL_ENDL; } char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ @@ -3272,12 +3269,12 @@ void LLMessageSystem::sendCreateTrustedCircuit(const LLHost &host, const LLUUID char digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ if (id1.isNull()) { - LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the local end point ID" << llendl; + LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the local end point ID" << LL_ENDL; return; } if (id2.isNull()) { - LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the remote end point ID" << llendl; + LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the remote end point ID" << LL_ENDL; return; } generateDigestForWindowAndUUIDs(digest, TRUST_TIME_WINDOW, id1, id2); @@ -3285,7 +3282,7 @@ void LLMessageSystem::sendCreateTrustedCircuit(const LLHost &host, const LLUUID nextBlockFast(_PREHASH_DataBlock); addUUIDFast(_PREHASH_EndPointID, id1); addBinaryDataFast(_PREHASH_Digest, digest, MD5HEX_STR_BYTES); - LL_INFOS("Messaging") << "xmitting digest: " << digest << " Host: " << host << llendl; + LL_INFOS("Messaging") << "xmitting digest: " << digest << " Host: " << host << LL_ENDL; sendMessage(host); } @@ -3299,10 +3296,10 @@ void LLMessageSystem::reallySendDenyTrustedCircuit(const LLHost &host) LLCircuitData *cdp = mCircuitInfo.findCircuit(host); if (!cdp) { - LL_WARNS("Messaging") << "Not sending DenyTrustedCircuit to host without a circuit." << llendl; + LL_WARNS("Messaging") << "Not sending DenyTrustedCircuit to host without a circuit." << LL_ENDL; return; } - LL_INFOS("Messaging") << "Sending DenyTrustedCircuit to " << host << llendl; + LL_INFOS("Messaging") << "Sending DenyTrustedCircuit to " << host << LL_ENDL; newMessageFast(_PREHASH_DenyTrustedCircuit); nextBlockFast(_PREHASH_DataBlock); addUUIDFast(_PREHASH_EndPointID, cdp->getLocalEndPointID()); @@ -3323,7 +3320,7 @@ void LLMessageSystem::establishBidirectionalTrust(const LLHost &host, S64 frame_ std::string shared_secret = get_shared_secret(); if(shared_secret.empty()) { - LL_ERRS("Messaging") << "Trying to establish bidirectional trust on a machine without a shared secret!" << llendl; + LL_ERRS("Messaging") << "Trying to establish bidirectional trust on a machine without a shared secret!" << LL_ENDL; } LLTimer timeout; @@ -3375,8 +3372,8 @@ void LLMessageSystem::establishBidirectionalTrust(const LLHost &host, S64 frame_ void LLMessageSystem::dumpPacketToLog() { - LL_WARNS("Messaging") << "Packet Dump from:" << mPacketRing.getLastSender() << llendl; - LL_WARNS("Messaging") << "Packet Size:" << mTrueReceiveSize << llendl; + LL_WARNS("Messaging") << "Packet Dump from:" << mPacketRing.getLastSender() << LL_ENDL; + LL_WARNS("Messaging") << "Packet Size:" << mTrueReceiveSize << LL_ENDL; char line_buffer[256]; /* Flawfinder: ignore */ S32 i; S32 cur_line_pos = 0; @@ -3391,27 +3388,27 @@ void LLMessageSystem::dumpPacketToLog() if (cur_line_pos >= 16) { cur_line_pos = 0; - LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << llendl; + LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << LL_ENDL; cur_line++; } } if (cur_line_pos) { - LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << llendl; + LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << LL_ENDL; } } //static -U64 LLMessageSystem::getMessageTimeUsecs(const BOOL update) +U64Microseconds LLMessageSystem::getMessageTimeUsecs(const BOOL update) { if (gMessageSystem) { if (update) { - gMessageSystem->mCurrentMessageTimeSeconds = totalTime()*SEC_PER_USEC; + gMessageSystem->mCurrentMessageTime = totalTime(); } - return (U64)(gMessageSystem->mCurrentMessageTimeSeconds * USEC_PER_SEC); + return gMessageSystem->mCurrentMessageTime; } else { @@ -3420,19 +3417,19 @@ U64 LLMessageSystem::getMessageTimeUsecs(const BOOL update) } //static -F64 LLMessageSystem::getMessageTimeSeconds(const BOOL update) +F64Seconds LLMessageSystem::getMessageTimeSeconds(const BOOL update) { if (gMessageSystem) { if (update) { - gMessageSystem->mCurrentMessageTimeSeconds = totalTime()*SEC_PER_USEC; + gMessageSystem->mCurrentMessageTime = totalTime(); } - return gMessageSystem->mCurrentMessageTimeSeconds; + return gMessageSystem->mCurrentMessageTime; } else { - return totalTime()*SEC_PER_USEC; + return F64Seconds(totalTime()); } } @@ -3941,7 +3938,7 @@ void LLMessageSystem::getStringFast(const char *block, const char *var, { if(buffer_size <= 0) { - LL_WARNS("Messaging") << "buffer_size <= 0" << llendl; + LL_WARNS("Messaging") << "buffer_size <= 0" << LL_ENDL; } mMessageReader->getString(block, var, buffer_size, s, blocknum); } @@ -4050,7 +4047,7 @@ void LLMessageSystem::banUdpMessage(const std::string& name) } else { - llwarns << "Attempted to ban an unknown message: " << name << "." << llendl; + LL_WARNS() << "Attempted to ban an unknown message: " << name << "." << LL_ENDL; } } const LLHost& LLMessageSystem::getSender() const diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index 1589ea29c1..da06b64506 100755 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -45,14 +45,14 @@ #include "llerror.h" #include "net.h" -#include "string_table.h" +#include "llstringtable.h" #include "llcircuit.h" #include "lltimer.h" #include "llpacketring.h" #include "llhost.h" -#include "llhttpclient.h" +#include "llcurl.h" #include "llhttpnode.h" -#include "llpacketack.h" +//#include "llpacketack.h" #include "llsingleton.h" #include "message_prehash.h" #include "llstl.h" @@ -142,23 +142,18 @@ enum EPacketHeaderLayout const S32 LL_DEFAULT_RELIABLE_RETRIES = 3; -const F32 LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS = 1.f; -const F32 LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS = 1.f; -const F32 LL_PING_BASED_TIMEOUT_DUMMY = 0.0f; - -// *NOTE: Maybe these factors shouldn't include the msec to sec conversion -// implicitly. -// However, all units should be MKS. -const F32 LL_SEMIRELIABLE_TIMEOUT_FACTOR = 5.f / 1000.f; // factor * averaged ping -const F32 LL_RELIABLE_TIMEOUT_FACTOR = 5.f / 1000.f; // factor * averaged ping -const F32 LL_FILE_XFER_TIMEOUT_FACTOR = 5.f / 1000.f; // factor * averaged ping -const F32 LL_LOST_TIMEOUT_FACTOR = 16.f / 1000.f; // factor * averaged ping for marking packets "Lost" -const F32 LL_MAX_LOST_TIMEOUT = 5.f; // Maximum amount of time before considering something "lost" +const F32Seconds LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS(1.f); +const F32Seconds LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS(1.f); +const F32Seconds LL_PING_BASED_TIMEOUT_DUMMY(0.0f); + +const F32 LL_SEMIRELIABLE_TIMEOUT_FACTOR = 5.f; // averaged ping +const F32 LL_RELIABLE_TIMEOUT_FACTOR = 5.f; // averaged ping +const F32 LL_LOST_TIMEOUT_FACTOR = 16.f; // averaged ping for marking packets "Lost" +const F32Seconds LL_MAX_LOST_TIMEOUT(5.f); // Maximum amount of time before considering something "lost" const S32 MAX_MESSAGE_COUNT_NUM = 1024; // Forward declarations -class LLCircuit; class LLVector3; class LLVector4; class LLVector3d; @@ -214,19 +209,19 @@ class LLMessageSystem : public LLMessageSenderInterface public: LLPacketRing mPacketRing; - LLReliablePacketParams mReliablePacketParams; + LLReliablePacketParams mReliablePacketParams; // Set this flag to TRUE when you want *very* verbose logs. - BOOL mVerboseLog; + BOOL mVerboseLog; - F32 mMessageFileVersionNumber; + F32 mMessageFileVersionNumber; typedef std::map<const char *, LLMessageTemplate*> message_template_name_map_t; typedef std::map<U32, LLMessageTemplate*> message_template_number_map_t; private: message_template_name_map_t mMessageTemplates; - message_template_number_map_t mMessageNumbers; + message_template_number_map_t mMessageNumbers; public: S32 mSystemVersionMajor; @@ -235,7 +230,7 @@ public: S32 mSystemVersionServer; U32 mVersionFlags; - BOOL mbProtected; + BOOL mbProtected; U32 mNumberHighFreqMessages; U32 mNumberMediumFreqMessages; @@ -255,11 +250,11 @@ public: U32 mReliablePacketsIn; // total reliable packets in U32 mReliablePacketsOut; // total reliable packets out - U32 mDroppedPackets; // total dropped packets in - U32 mResentPackets; // total resent packets out - U32 mFailedResendPackets; // total resend failure packets out - U32 mOffCircuitPackets; // total # of off-circuit packets rejected - U32 mInvalidOnCircuitPackets; // total # of on-circuit but invalid packets rejected + U32 mDroppedPackets; // total dropped packets in + U32 mResentPackets; // total resent packets out + U32 mFailedResendPackets; // total resend failure packets out + U32 mOffCircuitPackets; // total # of off-circuit packets rejected + U32 mInvalidOnCircuitPackets; // total # of on-circuit but invalid packets rejected S64 mUncompressedBytesIn; // total uncompressed size of compressed packets in S64 mUncompressedBytesOut; // total uncompressed size of compressed packets out @@ -268,14 +263,14 @@ public: S64 mTotalBytesIn; // total size of all uncompressed packets in S64 mTotalBytesOut; // total size of all uncompressed packets out - BOOL mSendReliable; // does the outgoing message require a pos ack? + BOOL mSendReliable; // does the outgoing message require a pos ack? - LLCircuit mCircuitInfo; - F64 mCircuitPrintTime; // used to print circuit debug info every couple minutes - F32 mCircuitPrintFreq; // seconds + LLCircuit mCircuitInfo; + F64Seconds mCircuitPrintTime; // used to print circuit debug info every couple minutes + F32Seconds mCircuitPrintFreq; - std::map<U64, U32> mIPPortToCircuitCode; - std::map<U32, U64> mCircuitCodeToIPPort; + std::map<U64, U32> mIPPortToCircuitCode; + std::map<U32, U64> mCircuitCodeToIPPort; U32 mOurCircuitCode; S32 mSendPacketFailureCount; S32 mUnackedListDepth; @@ -470,7 +465,7 @@ public: S32 sendReliable( const LLHost &host, S32 retries, BOOL ping_based_retries, - F32 timeout, + F32Seconds timeout, void (*callback)(void **,S32), void ** callback_data); @@ -490,11 +485,11 @@ public: const LLHost &host, S32 retries, BOOL ping_based_timeout, - F32 timeout, + F32Seconds timeout, void (*callback)(void **,S32), void ** callback_data); - LLHTTPClient::ResponderPtr createResponder(const std::string& name); + LLCurl::ResponderPtr createResponder(const std::string& name); S32 sendMessage(const LLHost &host); S32 sendMessage(const U32 circuit); private: @@ -657,8 +652,8 @@ public: S32 getSize(const char *blockname, S32 blocknum, const char *varname) const; void resetReceiveCounts(); // resets receive counts for all message types to 0 - void dumpReceiveCounts(); // dumps receive count for each message type to llinfos - void dumpCircuitInfo(); // Circuit information to llinfos + void dumpReceiveCounts(); // dumps receive count for each message type to LL_INFOS() + void dumpCircuitInfo(); // Circuit information to LL_INFOS() BOOL isClear() const; // returns mbSClear; S32 flush(const LLHost &host); @@ -684,8 +679,8 @@ public: void setMaxMessageTime(const F32 seconds); // Max time to process messages before warning and dumping (neg to disable) void setMaxMessageCounts(const S32 num); // Max number of messages before dumping (neg to disable) - static U64 getMessageTimeUsecs(const BOOL update = FALSE); // Get the current message system time in microseconds - static F64 getMessageTimeSeconds(const BOOL update = FALSE); // Get the current message system time in seconds + static U64Microseconds getMessageTimeUsecs(const BOOL update = FALSE); // Get the current message system time in microseconds + static F64Seconds getMessageTimeSeconds(const BOOL update = FALSE); // Get the current message system time in seconds static void setTimeDecodes(BOOL b); static void setTimeDecodesSpamThreshold(F32 seconds); @@ -784,16 +779,16 @@ private: BOOL mbError; S32 mErrorCode; - F64 mResendDumpTime; // The last time we dumped resends + F64Seconds mResendDumpTime; // The last time we dumped resends LLMessageCountInfo mMessageCountList[MAX_MESSAGE_COUNT_NUM]; S32 mNumMessageCounts; - F32 mReceiveTime; - F32 mMaxMessageTime; // Max number of seconds for processing messages + F32Seconds mReceiveTime; + F32Seconds mMaxMessageTime; // Max number of seconds for processing messages S32 mMaxMessageCounts; // Max number of messages to process before dumping. - F64 mMessageCountTime; + F64Seconds mMessageCountTime; - F64 mCurrentMessageTimeSeconds; // The current "message system time" (updated the first call to checkMessages after a resetReceiveCount + F64Seconds mCurrentMessageTime; // The current "message system time" (updated the first call to checkMessages after a resetReceiveCount // message system exceptions typedef std::pair<msg_exception_callback, void*> exception_t; @@ -888,7 +883,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_S16: if (n != 2) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN *(s + 1) = *(ct); @@ -903,7 +898,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_F32: if (n != 4) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN *(s + 3) = *(ct); @@ -920,7 +915,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_F64: if (n != 8) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN *(s + 7) = *(ct); @@ -940,7 +935,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_LLQuaternion: // We only send x, y, z and infer w (we set x, y, z to ensure that w >= 0) if (n != 12) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN htonmemcpy(s + 8, ct + 8, MVT_F32, 4); @@ -953,7 +948,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_LLVector3d: if (n != 24) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN htonmemcpy(s + 16, ct + 16, MVT_F64, 8); @@ -966,7 +961,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_LLVector4: if (n != 16) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN htonmemcpy(s + 12, ct + 12, MVT_F32, 4); @@ -980,7 +975,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_U16Vec3: if (n != 6) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN htonmemcpy(s + 4, ct + 4, MVT_U16, 2); @@ -993,7 +988,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_U16Quat: if (n != 8) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN htonmemcpy(s + 6, ct + 6, MVT_U16, 2); @@ -1007,7 +1002,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type, case MVT_S16Array: if (n % 2) { - llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl; + LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL; } #ifdef LL_BIG_ENDIAN length = n % 2; diff --git a/indra/llmessage/message_string_table.cpp b/indra/llmessage/message_string_table.cpp index dd063fcb83..e4f5fb3a38 100755 --- a/indra/llmessage/message_string_table.cpp +++ b/indra/llmessage/message_string_table.cpp @@ -80,10 +80,10 @@ char* LLMessageStringTable::getString(const char *str) if (mUsed >= MESSAGE_NUMBER_OF_HASH_BUCKETS - 1) { U32 i; - llinfos << "Dumping string table before crashing on HashTable full!" << llendl; + LL_INFOS() << "Dumping string table before crashing on HashTable full!" << LL_ENDL; for (i = 0; i < MESSAGE_NUMBER_OF_HASH_BUCKETS; i++) { - llinfos << "Entry #" << i << ": " << mString[i] << llendl; + LL_INFOS() << "Entry #" << i << ": " << mString[i] << LL_ENDL; } } return mString[hash_value]; diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp index 85aef5da00..523bcbb60d 100755 --- a/indra/llmessage/net.cpp +++ b/indra/llmessage/net.cpp @@ -26,15 +26,13 @@ #include "linden_common.h" -#include "net.h" +//#include "net.h" // system library includes #include <stdexcept> #if LL_WINDOWS - #define WIN32_LEAN_AND_MEAN - #include <winsock2.h> - #include <windows.h> +#include "llwin32headerslean.h" #else #include <sys/types.h> #include <sys/socket.h> @@ -175,7 +173,7 @@ U32 ip_string_to_u32(const char* ip_string) if (ip == INADDR_NONE && strncmp(ip_string, BROADCAST_ADDRESS_STRING, MAXADDRSTR) != 0) { - llwarns << "ip_string_to_u32() failed, Error: Invalid IP string '" << ip_string << "'" << llendl; + LL_WARNS() << "ip_string_to_u32() failed, Error: Invalid IP string '" << ip_string << "'" << LL_ENDL; return INVALID_HOST_IP_ADDRESS; } return ip; @@ -334,7 +332,7 @@ S32 receive_packet(int hSocket, char * receiveBuffer) return 0; if (WSAECONNRESET == WSAGetLastError()) return 0; - llinfos << "receivePacket() failed, Error: " << WSAGetLastError() << llendl; + LL_INFOS() << "receivePacket() failed, Error: " << WSAGetLastError() << LL_ENDL; } return nRet; @@ -368,8 +366,8 @@ BOOL send_packet(int hSocket, const char *sendBuffer, int size, U32 recipient, i { return TRUE; } - llinfos << "sendto() failed to " << u32_to_ip_string(recipient) << ":" << nPort - << ", Error " << last_error << llendl; + LL_INFOS() << "sendto() failed to " << u32_to_ip_string(recipient) << ":" << nPort + << ", Error " << last_error << LL_ENDL; } } } while ( (nRet == SOCKET_ERROR) @@ -397,7 +395,7 @@ S32 start_net(S32& socket_out, int& nPort) hSocket = socket(AF_INET, SOCK_DGRAM, 0); if (hSocket < 0) { - llwarns << "socket() failed" << llendl; + LL_WARNS() << "socket() failed" << LL_ENDL; return 1; } @@ -408,21 +406,21 @@ S32 start_net(S32& socket_out, int& nPort) stLclAddr.sin_family = AF_INET; stLclAddr.sin_addr.s_addr = htonl(INADDR_ANY); stLclAddr.sin_port = htons(0); - llinfos << "attempting to connect on OS assigned port" << llendl; + LL_INFOS() << "attempting to connect on OS assigned port" << LL_ENDL; nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr)); if (nRet < 0) { - llwarns << "Failed to bind on an OS assigned port error: " - << nRet << llendl; + LL_WARNS() << "Failed to bind on an OS assigned port error: " + << nRet << LL_ENDL; } else { sockaddr_in socket_info; socklen_t len = sizeof(sockaddr_in); int err = getsockname(hSocket, (sockaddr*)&socket_info, &len); - llinfos << "Get socket returned: " << err << " length " << len << llendl; + LL_INFOS() << "Get socket returned: " << err << " length " << len << LL_ENDL; nPort = ntohs(socket_info.sin_port); - llinfos << "Assigned port: " << nPort << llendl; + LL_INFOS() << "Assigned port: " << nPort << LL_ENDL; } } @@ -433,7 +431,7 @@ S32 start_net(S32& socket_out, int& nPort) stLclAddr.sin_addr.s_addr = htonl(INADDR_ANY); stLclAddr.sin_port = htons(nPort); U32 attempt_port = nPort; - llinfos << "attempting to connect on port " << attempt_port << llendl; + LL_INFOS() << "attempting to connect on port " << attempt_port << LL_ENDL; nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr)); if (nRet < 0) @@ -447,7 +445,7 @@ S32 start_net(S32& socket_out, int& nPort) attempt_port++) { stLclAddr.sin_port = htons(attempt_port); - llinfos << "trying port " << attempt_port << llendl; + LL_INFOS() << "trying port " << attempt_port << LL_ENDL; nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr)); if (!((nRet < 0) && (errno == EADDRINUSE))) { @@ -456,7 +454,7 @@ S32 start_net(S32& socket_out, int& nPort) } if (nRet < 0) { - llwarns << "startNet() : Couldn't find available network port." << llendl; + LL_WARNS() << "startNet() : Couldn't find available network port." << LL_ENDL; // Fail gracefully in release. return 3; } @@ -464,12 +462,12 @@ S32 start_net(S32& socket_out, int& nPort) // Some other socket error else { - llwarns << llformat ("bind() port: %d failed, Err: %s\n", nPort, strerror(errno)) << llendl; + LL_WARNS() << llformat ("bind() port: %d failed, Err: %s\n", nPort, strerror(errno)) << LL_ENDL; // Fail gracefully in release. return 4; } } - llinfos << "connected on port " << attempt_port << llendl; + LL_INFOS() << "connected on port " << attempt_port << LL_ENDL; nPort = attempt_port; } // Set socket to be non-blocking @@ -478,18 +476,18 @@ S32 start_net(S32& socket_out, int& nPort) nRet = setsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, buff_size); if (nRet) { - llinfos << "Can't set receive size!" << llendl; + LL_INFOS() << "Can't set receive size!" << LL_ENDL; } nRet = setsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, buff_size); if (nRet) { - llinfos << "Can't set send size!" << llendl; + LL_INFOS() << "Can't set send size!" << LL_ENDL; } getsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, &buff_size); getsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, &buff_size); - llinfos << "startNet - receive buffer size : " << rec_size << llendl; - llinfos << "startNet - send buffer size : " << snd_size << llendl; + LL_INFOS() << "startNet - receive buffer size : " << rec_size << LL_ENDL; + LL_INFOS() << "startNet - send buffer size : " << snd_size << LL_ENDL; #if LL_LINUX // Turn on recipient address tracking @@ -497,11 +495,11 @@ S32 start_net(S32& socket_out, int& nPort) int use_pktinfo = 1; if( setsockopt( hSocket, SOL_IP, IP_PKTINFO, &use_pktinfo, sizeof(use_pktinfo) ) == -1 ) { - llwarns << "No IP_PKTINFO available" << llendl; + LL_WARNS() << "No IP_PKTINFO available" << LL_ENDL; } else { - llinfos << "IP_PKKTINFO enabled" << llendl; + LL_INFOS() << "IP_PKKTINFO enabled" << LL_ENDL; } } #endif @@ -595,7 +593,7 @@ int receive_packet(int hSocket, char * receiveBuffer) } // Uncomment for testing if/when implementing for Mac or Windows: - // llinfos << "Received datagram to in addr " << u32_to_ip_string(get_receiving_interface_ip()) << llendl; + // LL_INFOS() << "Received datagram to in addr " << u32_to_ip_string(get_receiving_interface_ip()) << LL_ENDL; return nRet; } @@ -629,22 +627,22 @@ BOOL send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient, if (errno == EAGAIN) { // say nothing, just repeat send - llinfos << "sendto() reported buffer full, resending (attempt " << send_attempts << ")" << llendl; - llinfos << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << llendl; + LL_INFOS() << "sendto() reported buffer full, resending (attempt " << send_attempts << ")" << LL_ENDL; + LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL; resend = TRUE; } else if (errno == ECONNREFUSED) { // response to ICMP connection refused message on earlier send - llinfos << "sendto() reported connection refused, resending (attempt " << send_attempts << ")" << llendl; - llinfos << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << llendl; + LL_INFOS() << "sendto() reported connection refused, resending (attempt " << send_attempts << ")" << LL_ENDL; + LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL; resend = TRUE; } else { // some other error - llinfos << "sendto() failed: " << errno << ", " << strerror(errno) << llendl; - llinfos << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << llendl; + LL_INFOS() << "sendto() failed: " << errno << ", " << strerror(errno) << LL_ENDL; + LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL; resend = FALSE; } } @@ -653,7 +651,7 @@ BOOL send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient, if (send_attempts >= 3) { - llinfos << "sendPacket() bailed out of send!" << llendl; + LL_INFOS() << "sendPacket() bailed out of send!" << LL_ENDL; return FALSE; } diff --git a/indra/llmessage/net.h b/indra/llmessage/net.h index 0f2437479d..beb67bae4e 100755 --- a/indra/llmessage/net.h +++ b/indra/llmessage/net.h @@ -67,5 +67,8 @@ const S32 ETHERNET_MTU_BYTES = 1500; const S32 MTUBITS = MTUBYTES*8; const S32 MTUU32S = MTUBITS/32; +// For automatic port discovery when running multiple viewers on one host +const U32 PORT_DISCOVERY_RANGE_MIN = 13000; +const U32 PORT_DISCOVERY_RANGE_MAX = PORT_DISCOVERY_RANGE_MIN + 50; #endif diff --git a/indra/llmessage/partsyspacket.cpp b/indra/llmessage/partsyspacket.cpp index ad21614258..d87de38aa5 100755 --- a/indra/llmessage/partsyspacket.cpp +++ b/indra/llmessage/partsyspacket.cpp @@ -28,7 +28,7 @@ #include "linden_common.h" #include "partsyspacket.h" -#include "imageids.h" +#include "indra_constants.h" // this function is global void gSetInitDataDefaults(LLPartInitData *setMe) @@ -1272,7 +1272,7 @@ BOOL LLPartSysCompressedPacket::fromUnsignedBytes(U8 *in, U32 bytesUsed) } else { - llerrs << "NULL input data or number of bytes exceed mData size" << llendl; + LL_ERRS() << "NULL input data or number of bytes exceed mData size" << LL_ENDL; return FALSE; } } diff --git a/indra/llmessage/patch_code.cpp b/indra/llmessage/patch_code.cpp index e5d7f19448..32f8d80782 100755 --- a/indra/llmessage/patch_code.cpp +++ b/indra/llmessage/patch_code.cpp @@ -31,7 +31,7 @@ #include "v3math.h" #include "patch_dct.h" #include "patch_code.h" -#include "bitpack.h" +#include "llbitpack.h" U32 gPatchSize, gWordBits; @@ -88,7 +88,7 @@ void code_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, S32 *patch) if ( (wbits > 17) ||(wbits < 2)) { - llerrs << "Bits needed per word in code_patch_header out of legal range. Adjust compression quatization." << llendl; + LL_ERRS() << "Bits needed per word in code_patch_header out of legal range. Adjust compression quatization." << LL_ENDL; } ph->quant_wbits |= (wbits - 2); @@ -135,7 +135,7 @@ void code_patch(LLBitPack &bitpack, S32 *patch, S32 postquant) if ( (postquant > patch_size*patch_size) ||(postquant < 0)) { - llerrs << "Bad postquant in code_patch!" << llendl; + LL_ERRS() << "Bad postquant in code_patch!" << LL_ENDL; } if (postquant) diff --git a/indra/llmessage/tests/llareslistener_test.cpp b/indra/llmessage/tests/llareslistener_test.cpp index 60c91e12cf..c04696c86b 100755 --- a/indra/llmessage/tests/llareslistener_test.cpp +++ b/indra/llmessage/tests/llareslistener_test.cpp @@ -135,7 +135,7 @@ namespace tut void object::test<2>() { set_test_name("bad op"); - WrapLL_ERRS capture; + WrapLLErrs capture; LLSD request; request["op"] = "foo"; std::string threw; @@ -143,7 +143,7 @@ namespace tut { LLEventPumps::instance().obtain("LLAres").post(request); } - catch (const WrapLL_ERRS::FatalException& e) + catch (const WrapLLErrs::FatalException& e) { threw = e.what(); } @@ -154,7 +154,7 @@ namespace tut void object::test<3>() { set_test_name("bad rewriteURI request"); - WrapLL_ERRS capture; + WrapLLErrs capture; LLSD request; request["op"] = "rewriteURI"; std::string threw; @@ -162,7 +162,7 @@ namespace tut { LLEventPumps::instance().obtain("LLAres").post(request); } - catch (const WrapLL_ERRS::FatalException& e) + catch (const WrapLLErrs::FatalException& e) { threw = e.what(); } @@ -175,7 +175,7 @@ namespace tut void object::test<4>() { set_test_name("bad rewriteURI request"); - WrapLL_ERRS capture; + WrapLLErrs capture; LLSD request; request["op"] = "rewriteURI"; request["reply"] = "nonexistent"; @@ -184,7 +184,7 @@ namespace tut { LLEventPumps::instance().obtain("LLAres").post(request); } - catch (const WrapLL_ERRS::FatalException& e) + catch (const WrapLLErrs::FatalException& e) { threw = e.what(); } @@ -197,7 +197,7 @@ namespace tut void object::test<5>() { set_test_name("bad rewriteURI request"); - WrapLL_ERRS capture; + WrapLLErrs capture; LLSD request; request["op"] = "rewriteURI"; request["uri"] = "foo.bar.com"; @@ -206,7 +206,7 @@ namespace tut { LLEventPumps::instance().obtain("LLAres").post(request); } - catch (const WrapLL_ERRS::FatalException& e) + catch (const WrapLLErrs::FatalException& e) { threw = e.what(); } diff --git a/indra/llmessage/tests/llmime_test.cpp b/indra/llmessage/tests/llmime_test.cpp index aed5c4589c..ea48561ae9 100755 --- a/indra/llmessage/tests/llmime_test.cpp +++ b/indra/llmessage/tests/llmime_test.cpp @@ -83,8 +83,8 @@ namespace tut headers["Content-Length"] = MULTI_CONTENT_LENGTH; headers["Content-Type"] = MULTI_CONTENT_TYPE; LLMimeIndex mime(headers, MULTI_CONTENT_OFFSET); - llinfos << "headers: " << LLSDOStreamer<LLSDNotationFormatter>(headers) - << llendl; + LL_INFOS() << "headers: " << LLSDOStreamer<LLSDNotationFormatter>(headers) + << LL_ENDL; const S32 META_CONTENT_LENGTH = 700; |