LLHTTPAssetStorage Class Reference

#include <llhttpassetstorage.h>

Inheritance diagram for LLHTTPAssetStorage:

Inheritance graph
[legend]
Collaboration diagram for LLHTTPAssetStorage:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LLHTTPAssetStorage (LLMessageSystem *msg, LLXferManager *xfer, LLVFS *vfs, const LLHost &upstream_host, const char *web_host, const char *local_web_host, const char *host_name)
 LLHTTPAssetStorage (LLMessageSystem *msg, LLXferManager *xfer, LLVFS *vfs, const char *web_host, const char *local_web_host, const char *host_name)
virtual ~LLHTTPAssetStorage ()
virtual void storeAssetData (const LLUUID &uuid, LLAssetType::EType atype, LLStoreAssetCallback callback, void *user_data, bool temp_file=false, bool is_priority=false, bool store_local=false, const LLUUID &requesting_agent_id=LLUUID::null, bool user_waiting=FALSE, F64 timeout=LL_ASSET_STORAGE_TIMEOUT)
virtual void storeAssetData (const char *filename, const LLUUID &asset_id, LLAssetType::EType atype, LLStoreAssetCallback callback, void *user_data, bool temp_file, bool is_priority, bool user_waiting=FALSE, F64 timeout=LL_ASSET_STORAGE_TIMEOUT)
virtual LLSD getPendingDetails (ERequestType rt, LLAssetType::EType asset_type, const std::string &detail_prefix) const
virtual LLSD getPendingRequest (ERequestType rt, LLAssetType::EType asset_type, const LLUUID &asset_id) const
virtual bool deletePendingRequest (ERequestType rt, LLAssetType::EType asset_type, const LLUUID &asset_id)
S32 getURLToFile (const LLUUID &uuid, LLAssetType::EType asset_type, const LLString &url, const char *filename, progress_callback callback, void *userdata)
LLAssetRequestfindNextRequest (request_list_t &pending, request_list_t &running)
void checkForTimeouts ()
void addRunningRequest (ERequestType rt, LLHTTPAssetRequest *request)
void removeRunningRequest (ERequestType rt, LLHTTPAssetRequest *request)
request_list_tgetRunningList (ERequestType rt)
const request_list_tgetRunningList (ERequestType rt) const
virtual void addTempAssetData (const LLUUID &asset_id, const LLUUID &agent_id, const std::string &host_name)
virtual BOOL hasTempAssetData (const LLUUID &texture_id) const
virtual std::string getTempAssetHostName (const LLUUID &texture_id) const
virtual LLUUID getTempAssetAgentID (const LLUUID &texture_id) const
virtual void removeTempAssetData (const LLUUID &asset_id)
virtual void removeTempAssetDataByAgentID (const LLUUID &agent_id)
virtual void dumpTempAssetData (const LLUUID &avatar_id) const
virtual void clearTempAssetData ()

Static Public Member Functions

static size_t curlDownCallback (void *data, size_t size, size_t nmemb, void *user_data)
static size_t curlFileDownCallback (void *data, size_t size, size_t nmemb, void *user_data)
static size_t curlUpCallback (void *data, size_t size, size_t nmemb, void *user_data)
static size_t nullOutputCallback (void *data, size_t size, size_t nmemb, void *user_data)

Protected Member Functions

void _queueDataRequest (const LLUUID &uuid, LLAssetType::EType type, void(*callback)(LLVFS *vfs, const LLUUID &, LLAssetType::EType, void *, S32, LLExtStat), void *user_data, BOOL duplicate, BOOL is_priority)

Protected Attributes

std::string mBaseURL
std::string mLocalBaseURL
std::string mHostName
CURLM * mCurlMultiHandle
request_list_t mRunningDownloads
request_list_t mRunningUploads
request_list_t mRunningLocalUploads
uuid_tempdata_map mTempAssets

Private Member Functions

void _init (const char *web_host, const char *local_web_host, const char *host_name)
std::string getBaseURL (const LLUUID &asset_id, LLAssetType::EType asset_type)
void bumpTimedOutUploads ()


Detailed Description

Definition at line 46 of file llhttpassetstorage.h.


Constructor & Destructor Documentation

LLHTTPAssetStorage::LLHTTPAssetStorage ( LLMessageSystem msg,
LLXferManager xfer,
LLVFS vfs,
const LLHost upstream_host,
const char *  web_host,
const char *  local_web_host,
const char *  host_name 
)

Definition at line 401 of file llhttpassetstorage.cpp.

References _init().

Here is the call graph for this function:

LLHTTPAssetStorage::LLHTTPAssetStorage ( LLMessageSystem msg,
LLXferManager xfer,
LLVFS vfs,
const char *  web_host,
const char *  local_web_host,
const char *  host_name 
)

Definition at line 411 of file llhttpassetstorage.cpp.

References _init().

Here is the call graph for this function:

LLHTTPAssetStorage::~LLHTTPAssetStorage (  )  [virtual]

Definition at line 432 of file llhttpassetstorage.cpp.

References mCurlMultiHandle, and NULL.


Member Function Documentation

virtual void LLHTTPAssetStorage::storeAssetData ( const LLUUID uuid,
LLAssetType::EType  atype,
LLStoreAssetCallback  callback,
void *  user_data,
bool  temp_file = false,
bool  is_priority = false,
bool  store_local = false,
const LLUUID requesting_agent_id = LLUUID::null,
bool  user_waiting = FALSE,
F64  timeout = LL_ASSET_STORAGE_TIMEOUT 
) [virtual]

Referenced by storeAssetData().

Here is the caller graph for this function:

void LLHTTPAssetStorage::storeAssetData ( const char *  filename,
const LLUUID asset_id,
LLAssetType::EType  atype,
LLStoreAssetCallback  callback,
void *  user_data,
bool  temp_file,
bool  is_priority,
bool  user_waiting = FALSE,
F64  timeout = LL_ASSET_STORAGE_TIMEOUT 
) [virtual]

LLSD LLHTTPAssetStorage::getPendingDetails ( LLAssetStorage::ERequestType  rt,
LLAssetType::EType  asset_type,
const std::string &  detail_prefix 
) const [virtual]

LLSD LLHTTPAssetStorage::getPendingRequest ( LLAssetStorage::ERequestType  rt,
LLAssetType::EType  asset_type,
const LLUUID asset_id 
) const [virtual]

Reimplemented from LLAssetStorage.

Definition at line 620 of file llhttpassetstorage.cpp.

References LLAssetStorage::getPendingRequest(), getRunningList(), and tut::sd().

Here is the call graph for this function:

bool LLHTTPAssetStorage::deletePendingRequest ( LLAssetStorage::ERequestType  rt,
LLAssetType::EType  asset_type,
const LLUUID asset_id 
) [virtual]

S32 LLHTTPAssetStorage::getURLToFile ( const LLUUID uuid,
LLAssetType::EType  asset_type,
const LLString url,
const char *  filename,
progress_callback  callback,
void *  userdata 
)

LLAssetRequest* LLHTTPAssetStorage::findNextRequest ( request_list_t pending,
request_list_t running 
)

Referenced by checkForTimeouts().

Here is the caller graph for this function:

void LLHTTPAssetStorage::checkForTimeouts (  )  [virtual]

Reimplemented from LLAssetStorage.

Definition at line 762 of file llhttpassetstorage.cpp.

References LLAssetStorage::_callUploadCallbacks(), addTempAssetData(), LLAssetType::AT_OBJECT, bumpTimedOutUploads(), LLAssetStorage::checkForTimeouts(), LLHTTPAssetRequest::cleanupCurlHandle(), LLHTTPAssetRequest::curlCompressedUploadCallback(), curlDownCallback(), curlUpCallback(), deletePendingRequest(), LLAssetStorage::downloadCompleteCallback(), findNextRequest(), LLUUID::generate(), getBaseURL(), LLVFile::getSize(), LLAssetRequest::getType(), LLAssetRequest::getUUID(), HTTP_MISSING, HTTP_NO_CONTENT, HTTP_OK, HTTP_PUT_OK, HTTP_SERVER_BAD_GATEWAY, HTTP_SERVER_TEMP_UNAVAILABLE, LL_ERR_ASSET_REQUEST_FAILED, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_ERR_NOERR, LL_EXSTAT_CURL_RESULT, llendl, llinfos, llwarns, LLAssetType::lookup(), MAX_STRING, mBaseURL, LLHTTPAssetRequest::mCurlHandle, mCurlMultiHandle, mHostName, LLAssetRequest::mIsUserWaiting, mLocalBaseURL, LLAssetStorage::mPendingDownloads, LLAssetStorage::mPendingLocalUploads, LLAssetStorage::mPendingUploads, LLAssetRequest::mRequestingAgentID, LLHTTPAssetRequest::mRequestType, mRunningDownloads, mRunningLocalUploads, mRunningUploads, LLAssetRequest::mTime, LLAssetRequest::mTimeout, LLHTTPAssetRequest::mTmpUUID, LLHTTPAssetRequest::mURLBuffer, LLHTTPAssetRequest::mVFile, LLAssetStorage::mVFS, NULL, nullOutputCallback(), LLHTTPAssetRequest::prepareCompressedUpload(), LLVFile::remove(), LLVFile::rename(), LLAssetStorage::RT_DOWNLOAD, LLAssetStorage::RT_LOCALUPLOAD, LLAssetStorage::RT_UPLOAD, S32, LLHTTPAssetRequest::setupCurlHandle(), LLUUID::toString(), TRUE, and UUID_STR_LENGTH.

Here is the call graph for this function:

size_t LLHTTPAssetStorage::curlDownCallback ( void *  data,
size_t  size,
size_t  nmemb,
void *  user_data 
) [static]

Definition at line 1098 of file llhttpassetstorage.cpp.

References LLVFile::APPEND, LLAssetType::AT_NONE, gAssetStorage, LLVFile::getSize(), llendl, llmax(), llmin(), llwarns, LLHTTPAssetRequest::mTmpUUID, LLHTTPAssetRequest::mVFile, LLAssetStorage::mVFS, NULL, S32, LLVFile::setMaxSize(), and LLVFile::write().

Referenced by checkForTimeouts().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t LLHTTPAssetStorage::curlFileDownCallback ( void *  data,
size_t  size,
size_t  nmemb,
void *  user_data 
) [static]

Definition at line 1255 of file llhttpassetstorage.cpp.

References llendl, llwarns, LLHTTPAssetRequest::mFP, and NULL.

Referenced by getURLToFile().

Here is the caller graph for this function:

size_t LLHTTPAssetStorage::curlUpCallback ( void *  data,
size_t  size,
size_t  nmemb,
void *  user_data 
) [static]

size_t LLHTTPAssetStorage::nullOutputCallback ( void *  data,
size_t  size,
size_t  nmemb,
void *  user_data 
) [static]

Definition at line 1152 of file llhttpassetstorage.cpp.

Referenced by checkForTimeouts().

Here is the caller graph for this function:

void LLHTTPAssetStorage::addRunningRequest ( ERequestType  rt,
LLHTTPAssetRequest request 
)

Definition at line 1301 of file llhttpassetstorage.cpp.

References getRunningList(), llendl, and llerrs.

Referenced by LLHTTPAssetRequest::setupCurlHandle().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLHTTPAssetStorage::removeRunningRequest ( ERequestType  rt,
LLHTTPAssetRequest request 
)

Definition at line 1314 of file llhttpassetstorage.cpp.

References getRunningList(), llendl, and llerrs.

Referenced by LLHTTPAssetRequest::cleanupCurlHandle().

Here is the call graph for this function:

Here is the caller graph for this function:

LLAssetStorage::request_list_t * LLHTTPAssetStorage::getRunningList ( LLAssetStorage::ERequestType  rt  ) 

const LLAssetStorage::request_list_t * LLHTTPAssetStorage::getRunningList ( LLAssetStorage::ERequestType  rt  )  const

void LLHTTPAssetStorage::addTempAssetData ( const LLUUID asset_id,
const LLUUID agent_id,
const std::string &  host_name 
) [virtual]

Reimplemented from LLAssetStorage.

Definition at line 1328 of file llhttpassetstorage.cpp.

References LLUUID::isNull(), llendl, llwarns, LLTempAssetData::mAgentID, LLTempAssetData::mAssetID, LLTempAssetData::mHostName, and mTempAssets.

Referenced by checkForTimeouts().

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL LLHTTPAssetStorage::hasTempAssetData ( const LLUUID texture_id  )  const [virtual]

Reimplemented from LLAssetStorage.

Definition at line 1345 of file llhttpassetstorage.cpp.

References mTempAssets.

std::string LLHTTPAssetStorage::getTempAssetHostName ( const LLUUID texture_id  )  const [virtual]

Reimplemented from LLAssetStorage.

Definition at line 1353 of file llhttpassetstorage.cpp.

References mTempAssets.

LLUUID LLHTTPAssetStorage::getTempAssetAgentID ( const LLUUID texture_id  )  const [virtual]

Reimplemented from LLAssetStorage.

Definition at line 1367 of file llhttpassetstorage.cpp.

References mTempAssets, and LLUUID::null.

void LLHTTPAssetStorage::removeTempAssetData ( const LLUUID asset_id  )  [virtual]

Reimplemented from LLAssetStorage.

Definition at line 1381 of file llhttpassetstorage.cpp.

References mTempAssets.

void LLHTTPAssetStorage::removeTempAssetDataByAgentID ( const LLUUID agent_id  )  [virtual]

Reimplemented from LLAssetStorage.

Definition at line 1387 of file llhttpassetstorage.cpp.

References LLTempAssetData::mAgentID, and mTempAssets.

void LLHTTPAssetStorage::dumpTempAssetData ( const LLUUID avatar_id  )  const [virtual]

Reimplemented from LLAssetStorage.

Definition at line 1422 of file llhttpassetstorage.cpp.

References LLUUID::isNull(), llendl, llinfos, LLTempAssetData::mAgentID, LLTempAssetData::mAssetID, LLTempAssetData::mHostName, mTempAssets, and S32.

Here is the call graph for this function:

void LLHTTPAssetStorage::clearTempAssetData (  )  [virtual]

Reimplemented from LLAssetStorage.

Definition at line 1451 of file llhttpassetstorage.cpp.

References llendl, llinfos, and mTempAssets.

void LLHTTPAssetStorage::_queueDataRequest ( const LLUUID uuid,
LLAssetType::EType  type,
void(*)(LLVFS *vfs, const LLUUID &, LLAssetType::EType, void *, S32, LLExtStat callback,
void *  user_data,
BOOL  duplicate,
BOOL  is_priority 
) [protected, virtual]

void LLHTTPAssetStorage::_init ( const char *  web_host,
const char *  local_web_host,
const char *  host_name 
) [private]

Definition at line 421 of file llhttpassetstorage.cpp.

References mBaseURL, mCurlMultiHandle, mHostName, and mLocalBaseURL.

Referenced by LLHTTPAssetStorage().

Here is the caller graph for this function:

std::string LLHTTPAssetStorage::getBaseURL ( const LLUUID asset_id,
LLAssetType::EType  asset_type 
) [private]

Definition at line 1406 of file llhttpassetstorage.cpp.

References LLAssetType::AT_TEXTURE, llformat(), LOCAL_ASSET_URL_FORMAT, mBaseURL, and mTempAssets.

Referenced by checkForTimeouts().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLHTTPAssetStorage::bumpTimedOutUploads (  )  [private]


Member Data Documentation

std::string LLHTTPAssetStorage::mBaseURL [protected]

Definition at line 148 of file llhttpassetstorage.h.

Referenced by _init(), checkForTimeouts(), and getBaseURL().

std::string LLHTTPAssetStorage::mLocalBaseURL [protected]

Definition at line 149 of file llhttpassetstorage.h.

Referenced by _init(), and checkForTimeouts().

std::string LLHTTPAssetStorage::mHostName [protected]

Definition at line 150 of file llhttpassetstorage.h.

Referenced by _init(), and checkForTimeouts().

Definition at line 152 of file llhttpassetstorage.h.

Referenced by _init(), checkForTimeouts(), getURLToFile(), and ~LLHTTPAssetStorage().

Definition at line 154 of file llhttpassetstorage.h.

Referenced by checkForTimeouts(), and getRunningList().

Definition at line 155 of file llhttpassetstorage.h.

Referenced by bumpTimedOutUploads(), checkForTimeouts(), and getRunningList().

Definition at line 156 of file llhttpassetstorage.h.

Referenced by checkForTimeouts(), and getRunningList().


The documentation for this class was generated from the following files:

Generated on Fri May 16 08:49:00 2008 for SecondLife by  doxygen 1.5.5