removed scrub_host_name

meow-7.2.2
Brad Payne (Vir Linden) 2010-11-29 16:24:52 -05:00
parent 19ced614ad
commit 32d496e472
2 changed files with 1 additions and 51 deletions

View File

@ -108,48 +108,6 @@ U32 get_volume_memory_size(const LLVolume* volume)
return indices*2+vertices*11+sizeof(LLVolume)+sizeof(LLVolumeFace)*volume->getNumVolumeFaces();
}
std::string scrub_host_name(std::string http_url)
{ //curl loves to abuse the DNS cache, so scrub host names out of urls where trivial to prevent DNS timeouts
#if 0
if (http_url.empty())
{
return http_url;
}
// Not safe to scrub amazon paths
if (http_url.find("s3.amazonaws.com") != std::string::npos)
{
return http_url;
}
std::string::size_type begin_host = http_url.find("://")+3;
std::string host_string = http_url.substr(begin_host);
std::string::size_type end_host = host_string.find(":");
if (end_host == std::string::npos)
{
end_host = host_string.find("/");
}
host_string = host_string.substr(0, end_host);
std::string::size_type idx = http_url.find(host_string);
hostent* ent = gethostbyname(host_string.c_str());
if (ent && ent->h_length > 0)
{
U8* addr = (U8*) ent->h_addr_list[0];
std::string ip_string = llformat("%d.%d.%d.%d", addr[0], addr[1], addr[2], addr[3]);
if (!ip_string.empty() && !host_string.empty() && idx != std::string::npos)
{
http_url.replace(idx, host_string.length(), ip_string);
}
}
#endif
return http_url;
}
LLVertexBuffer* get_vertex_buffer_from_mesh(LLCDMeshData& mesh, F32 scale = 1.f)
{
LLVertexBuffer* buff = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL, 0);
@ -1426,9 +1384,6 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,
mUploadObjectAssetCapability = gAgent.getRegion()->getCapability("UploadObjectAsset");
mNewInventoryCapability = gAgent.getRegion()->getCapability("NewFileAgentInventoryVariablePrice");
//mUploadObjectAssetCapability = scrub_host_name(mUploadObjectAssetCapability);
//mNewInventoryCapability = scrub_host_name(mNewInventoryCapability);
mOrigin += gAgent.getAtAxis() * scale.magVec();
}
@ -2322,7 +2277,6 @@ void LLMeshRepository::notifyLoadedMeshes()
region_name = gAgent.getRegion()->getName();
mGetMeshCapability = gAgent.getRegion()->getCapability("GetMesh");
mGetMeshCapability = scrub_host_name(mGetMeshCapability);
}
}
@ -3022,7 +2976,6 @@ void LLMeshUploadThread::priceResult(LLMeshUploadData& data, const LLSD& content
{
mPendingCost += content["upload_price"].asInteger();
data.mRSVP = content["rsvp"].asString();
data.mRSVP = scrub_host_name(data.mRSVP);
mConfirmedQ.push(data);
}
@ -3031,7 +2984,6 @@ void LLMeshUploadThread::priceResult(LLTextureUploadData& data, const LLSD& cont
{
mPendingCost += content["upload_price"].asInteger();
data.mRSVP = content["rsvp"].asString();
data.mRSVP = scrub_host_name(data.mRSVP);
mConfirmedTextureQ.push(data);
}

View File

@ -51,8 +51,6 @@
#include "llviewerstats.h"
#include "llworld.h"
std::string scrub_host_name(std::string http_url);
//////////////////////////////////////////////////////////////////////////////
class LLTextureFetchWorker : public LLWorkerClass
{
@ -914,7 +912,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
// Will call callbackHttpGet when curl request completes
std::vector<std::string> headers;
headers.push_back("Accept: image/x-j2c");
res = mFetcher->mCurlGetRequest->getByteRange(scrub_host_name(mUrl), headers, offset, mRequestedSize,
res = mFetcher->mCurlGetRequest->getByteRange(mUrl, headers, offset, mRequestedSize,
new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, offset, true));
}
if (!res)