#include <llxfermanager.h>
Collaboration diagram for LLXferManager:
Public Types | |
LOW_PRIORITY = FALSE | |
HIGH_PRIORITY = TRUE | |
enum | { LOW_PRIORITY = FALSE, HIGH_PRIORITY = TRUE } |
Public Member Functions | |
LLXferManager (LLVFS *vfs) | |
virtual | ~LLXferManager () |
virtual void | init (LLVFS *vfs) |
virtual void | free () |
void | setUseAckThrottling (const BOOL use) |
void | setAckThrottleBPS (const F32 bps) |
virtual LLXfer * | findXfer (U64 id, LLXfer *list_head) |
virtual void | removeXfer (LLXfer *delp, LLXfer **list_head) |
virtual U32 | numActiveListEntries (LLXfer *list_head) |
virtual S32 | numActiveXfers (const LLHost &host) |
virtual S32 | numPendingXfers (const LLHost &host) |
virtual void | changeNumActiveXfers (const LLHost &host, S32 delta) |
virtual void | setMaxOutgoingXfersPerCircuit (S32 max_num) |
virtual void | setMaxIncomingXfers (S32 max_num) |
virtual void | updateHostStatus () |
virtual void | printHostStatus () |
virtual void | registerCallbacks (LLMessageSystem *mesgsys) |
virtual U64 | getNextID () |
virtual S32 | encodePacketNum (S32 packet_num, BOOL is_eof) |
virtual S32 | decodePacketNum (S32 packet_num) |
virtual BOOL | isLastPacket (S32 packet_num) |
virtual U64 | registerXfer (const void *datap, const S32 length) |
virtual void | requestFile (const char *local_filename, const char *remote_filename, ELLPath remote_path, const LLHost &remote_host, BOOL delete_remote_on_completion, void(*callback)(void **, S32, LLExtStat), void **user_data, BOOL is_priority=FALSE, BOOL use_big_packets=FALSE) |
virtual void | requestFile (const char *remote_filename, ELLPath remote_path, const LLHost &remote_host, BOOL delete_remote_on_completion, void(*callback)(void *, S32, void **, S32, LLExtStat), void **user_data, BOOL is_priority=FALSE) |
virtual void | requestVFile (const LLUUID &local_id, const LLUUID &remote_id, LLAssetType::EType type, LLVFS *vfs, const LLHost &remote_host, void(*callback)(void **, S32, LLExtStat), void **user_data, BOOL is_priority=FALSE) |
virtual void | processReceiveData (LLMessageSystem *mesgsys, void **user_data) |
virtual void | sendConfirmPacket (LLMessageSystem *mesgsys, U64 id, S32 packetnum, const LLHost &remote_host) |
virtual void | processFileRequest (LLMessageSystem *mesgsys, void **user_data) |
virtual void | processConfirmation (LLMessageSystem *mesgsys, void **user_data) |
virtual void | retransmitUnackedPackets () |
virtual void | processAbort (LLMessageSystem *mesgsys, void **user_data) |
Public Attributes | |
LLXfer * | mSendList |
LLXfer * | mReceiveList |
LLLinkedList< LLHostStatus > | mOutgoingHosts |
Protected Member Functions | |
virtual void | startPendingDownloads () |
virtual void | addToList (LLXfer *xferp, LLXfer *&head, BOOL is_priority) |
Protected Attributes | |
S32 | mMaxOutgoingXfersPerCircuit |
S32 | mMaxIncomingXfers |
BOOL | mUseAckThrottling |
LLLinkedQueue< LLXferAckInfo > | mXferAckQueue |
LLThrottle | mAckThrottle |
Private Attributes | |
LLVFS * | mVFS |
Definition at line 79 of file llxfermanager.h.
anonymous enum |
LLXferManager::LLXferManager | ( | LLVFS * | vfs | ) |
LLXferManager::~LLXferManager | ( | ) | [virtual] |
void LLXferManager::addToList | ( | LLXfer * | xferp, | |
LLXfer *& | head, | |||
BOOL | is_priority | |||
) | [protected, virtual] |
Definition at line 1055 of file llxfermanager.cpp.
References LLXfer::mNext, and NULL.
Referenced by requestFile(), and requestVFile().
Definition at line 306 of file llxfermanager.cpp.
References LLLinkedList< DATA_TYPE >::getFirstData(), LLLinkedList< DATA_TYPE >::getNextData(), LLHostStatus::mHost, LLHostStatus::mNumActive, mOutgoingHosts, and NULL.
Referenced by processFileRequest(), and retransmitUnackedPackets().
Definition at line 343 of file llxfermanager.cpp.
Definition at line 211 of file llxfermanager.cpp.
References LLXfer::mID, and LLXfer::mNext.
Referenced by processAbort(), processConfirmation(), processFileRequest(), and processReceiveData().
void LLXferManager::free | ( | ) | [virtual] |
Definition at line 89 of file llxfermanager.cpp.
References LLLinkedList< DATA_TYPE >::deleteAllData(), LLXfer::mNext, mOutgoingHosts, mReceiveList, mSendList, and NULL.
Referenced by ~LLXferManager().
U64 LLXferManager::getNextID | ( | ) | [virtual] |
Definition at line 331 of file llxfermanager.cpp.
References LLUUID::generate(), and LLUUID::mData.
Referenced by registerXfer(), requestFile(), and requestVFile().
Definition at line 72 of file llxfermanager.cpp.
References FALSE, LL_DEFAULT_MAX_REQUEST_FIFO_XFERS, LL_DEFAULT_MAX_SIMULTANEOUS_XFERS, mReceiveList, mSendList, mUseAckThrottling, mVFS, NULL, setAckThrottleBPS(), setMaxIncomingXfers(), and setMaxOutgoingXfersPerCircuit().
Referenced by LLXferManager().
Definition at line 257 of file llxfermanager.cpp.
References e_LL_XFER_IN_PROGRESS, LLXfer::mNext, and LLXfer::mStatus.
Definition at line 290 of file llxfermanager.cpp.
References LLLinkedList< DATA_TYPE >::getFirstData(), LLLinkedList< DATA_TYPE >::getNextData(), LLHostStatus::mHost, LLHostStatus::mNumActive, mOutgoingHosts, and NULL.
Referenced by processFileRequest(), and retransmitUnackedPackets().
Definition at line 274 of file llxfermanager.cpp.
References LLLinkedList< DATA_TYPE >::getFirstData(), LLLinkedList< DATA_TYPE >::getNextData(), LLHostStatus::mHost, LLHostStatus::mNumPending, mOutgoingHosts, and NULL.
Referenced by processFileRequest().
void LLXferManager::printHostStatus | ( | ) | [virtual] |
Definition at line 195 of file llxfermanager.cpp.
References LLLinkedList< DATA_TYPE >::getFirstData(), LLLinkedList< DATA_TYPE >::getNextData(), llendl, llinfos, LLHostStatus::mHost, LLHostStatus::mNumActive, LLHostStatus::mNumPending, mOutgoingHosts, and NULL.
void LLXferManager::processAbort | ( | LLMessageSystem * | mesgsys, | |
void ** | user_data | |||
) | [virtual] |
Definition at line 982 of file llxfermanager.cpp.
References _PREHASH_ID, _PREHASH_Result, _PREHASH_XferID, findXfer(), LLMessageSystem::getS32Fast(), LLMessageSystem::getU64Fast(), LLXfer::mCallbackResult, mReceiveList, LLXfer::processEOF(), removeXfer(), S32, and startPendingDownloads().
Referenced by process_abort_xfer().
void LLXferManager::processConfirmation | ( | LLMessageSystem * | mesgsys, | |
void ** | user_data | |||
) | [virtual] |
Definition at line 854 of file llxfermanager.cpp.
References _PREHASH_ID, _PREHASH_Packet, _PREHASH_XferID, e_LL_XFER_IN_PROGRESS, FALSE, findXfer(), LLMessageSystem::getS32Fast(), LLMessageSystem::getU64Fast(), mSendList, LLXfer::mStatus, LLXfer::mWaitingForACK, removeXfer(), S32, and LLXfer::sendNextPacket().
Referenced by process_confirm_packet().
void LLXferManager::processFileRequest | ( | LLMessageSystem * | mesgsys, | |
void ** | user_data | |||
) | [virtual] |
Definition at line 704 of file llxfermanager.cpp.
References _PREHASH_AbortXfer, _PREHASH_Filename, _PREHASH_ID, _PREHASH_Result, _PREHASH_VFileID, _PREHASH_VFileType, _PREHASH_XferID, LLMessageSystem::addS32Fast(), LLMessageSystem::addU64Fast(), changeNumActiveXfers(), FALSE, findXfer(), gDirUtilp, LLMessageSystem::getBOOL(), LLDir::getExpandedFilename(), LLMessageSystem::getS16Fast(), LLMessageSystem::getSender(), LLMessageSystem::getStringFast(), LLMessageSystem::getU64Fast(), LLMessageSystem::getU8(), LLMessageSystem::getUUIDFast(), LL_ERR_FILE_NOT_FOUND, LL_ERR_NOERR, LL_PATH_COUNT, LL_PATH_NONE, LL_XFER_LARGE_PAYLOAD, llendl, llerrs, llinfos, llwarns, LLAssetType::lookup(), MAX_STRING, mMaxOutgoingXfersPerCircuit, LLXfer::mNext, LLXfer::mRemoteHost, mSendList, mVFS, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), NULL, LLUUID::null, numActiveXfers(), numPendingXfers(), removeXfer(), S32, LLMessageSystem::sendMessage(), LLXfer::sendNextPacket(), LLXfer::startSend(), and U64_to_str().
Referenced by process_request_xfer().
void LLXferManager::processReceiveData | ( | LLMessageSystem * | mesgsys, | |
void ** | user_data | |||
) | [virtual] |
Definition at line 591 of file llxfermanager.cpp.
References _PREHASH_Data, _PREHASH_DataPacket, _PREHASH_ID, _PREHASH_Packet, _PREHASH_XferID, LLXfer::abort(), decodePacketNum(), findXfer(), LLMessageSystem::getBinaryDataFast(), LLXfer::getName(), LLMessageSystem::getS32Fast(), LLMessageSystem::getSender(), LLMessageSystem::getSizeFast(), LLMessageSystem::getU64Fast(), isLastPacket(), LL_ERR_CANNOT_OPEN_FILE, LL_XFER_LARGE_PAYLOAD, llendl, llinfos, llwarns, MAX_STRING, LLXferAckInfo::mID, LLXferAckInfo::mPacketNum, LLXfer::mPacketNum, mReceiveList, LLXferAckInfo::mRemoteHost, LLXfer::mRemoteHost, mUseAckThrottling, MVT_S32, mXferAckQueue, ntohmemcpy(), LLXfer::processEOF(), LLLinkedQueue< DATA_TYPE >::push(), LLXfer::receiveData(), removeXfer(), S32, sendConfirmPacket(), LLXfer::setXferSize(), startPendingDownloads(), and U64_to_str().
Referenced by continue_file_receive().
void LLXferManager::registerCallbacks | ( | LLMessageSystem * | mesgsys | ) | [virtual] |
Definition at line 321 of file llxfermanager.cpp.
References _PREHASH_AbortXfer, _PREHASH_ConfirmXferPacket, _PREHASH_RequestXfer, _PREHASH_SendXferPacket, continue_file_receive(), NULL, process_abort_xfer(), process_confirm_packet(), process_request_xfer(), and LLMessageSystem::setHandlerFuncFast().
Referenced by idle_startup().
Definition at line 368 of file llxfermanager.cpp.
References getNextID(), llendl, llerrs, LLXfer::mNext, mSendList, and removeXfer().
Definition at line 227 of file llxfermanager.cpp.
References LLXfer::mNext.
Referenced by processAbort(), processConfirmation(), processFileRequest(), processReceiveData(), registerXfer(), and retransmitUnackedPackets().
void LLXferManager::requestFile | ( | const char * | remote_filename, | |
ELLPath | remote_path, | |||
const LLHost & | remote_host, | |||
BOOL | delete_remote_on_completion, | |||
void(*)(void *, S32, void **, S32, LLExtStat) | callback, | |||
void ** | user_data, | |||
BOOL | is_priority = FALSE | |||
) | [virtual] |
Definition at line 455 of file llxfermanager.cpp.
References addToList(), getNextID(), llendl, llerrs, mReceiveList, and startPendingDownloads().
void LLXferManager::requestFile | ( | const char * | local_filename, | |
const char * | remote_filename, | |||
ELLPath | remote_path, | |||
const LLHost & | remote_host, | |||
BOOL | delete_remote_on_completion, | |||
void(*)(void **, S32, LLExtStat) | callback, | |||
void ** | user_data, | |||
BOOL | is_priority = FALSE , |
|||
BOOL | use_big_packets = FALSE | |||
) | [virtual] |
Definition at line 397 of file llxfermanager.cpp.
References addToList(), getNextID(), LLXfer::getXferTypeTag(), LL_XFER_LARGE_PAYLOAD, llendl, llerrs, LLXfer::mCallback, LLXfer::mCallbackDataHandle, LLXfer::mNext, mReceiveList, LLXfer::mRemoteHost, LLFile::remove(), S32, startPendingDownloads(), and LLXfer::XFER_FILE.
Referenced by process_initiate_download(), LLMuteList::processMuteListUpdate(), LLViewerObject::processTaskInv(), and LLPanelRequestTools::sendRequest().
void LLXferManager::requestVFile | ( | const LLUUID & | local_id, | |
const LLUUID & | remote_id, | |||
LLAssetType::EType | type, | |||
LLVFS * | vfs, | |||
const LLHost & | remote_host, | |||
void(*)(void **, S32, LLExtStat) | callback, | |||
void ** | user_data, | |||
BOOL | is_priority = FALSE | |||
) | [virtual] |
Definition at line 483 of file llxfermanager.cpp.
References addToList(), getNextID(), LLXfer::getXferTypeTag(), llendl, llerrs, LLXfer::mCallback, LLXfer::mCallbackDataHandle, LLXfer::mNext, mReceiveList, LLXfer::mRemoteHost, startPendingDownloads(), and LLXfer::XFER_VFILE.
void LLXferManager::retransmitUnackedPackets | ( | ) | [virtual] |
Definition at line 880 of file llxfermanager.cpp.
References LLXfer::abort(), LLXfer::ACKTimer, changeNumActiveXfers(), LLThrottle::checkOverflow(), e_LL_XFER_ABORTED, e_LL_XFER_IN_PROGRESS, e_LL_XFER_PENDING, e_LL_XFER_REGISTERED, f, LLTimer::getElapsedTimeF32(), LLLinkedQueue< DATA_TYPE >::getLength(), LLXfer::getName(), gMessageSystem, LLCircuit::isCircuitAlive(), LL_ERR_CIRCUIT_GONE, LL_ERR_TCP_TIMEOUT, LL_PACKET_RETRY_LIMIT, LL_PACKET_TIMEOUT, LL_XFER_REGISTRATION_TIMEOUT, llendl, llinfos, llwarns, mAckThrottle, LLXfer::mCallbackResult, LLMessageSystem::mCircuitInfo, LLXferAckInfo::mID, mMaxOutgoingXfersPerCircuit, LLXfer::mNext, LLXferAckInfo::mPacketNum, LLXfer::mPacketNum, mReceiveList, LLXferAckInfo::mRemoteHost, LLXfer::mRemoteHost, LLXfer::mRetries, mSendList, LLXfer::mStatus, LLXfer::mWaitingForACK, mXferAckQueue, numActiveXfers(), LLLinkedQueue< DATA_TYPE >::pop(), LLXfer::processEOF(), removeXfer(), LLXfer::resendLastPacket(), sendConfirmPacket(), LLXfer::sendNextPacket(), LLThrottle::throttleOverflow(), and updateHostStatus().
Referenced by idle_network(), and LLMessageSystem::processAcks().
void LLXferManager::sendConfirmPacket | ( | LLMessageSystem * | mesgsys, | |
U64 | id, | |||
S32 | packetnum, | |||
const LLHost & | remote_host | |||
) | [virtual] |
Definition at line 686 of file llxfermanager.cpp.
References _PREHASH_ConfirmXferPacket, _PREHASH_ID, _PREHASH_Packet, _PREHASH_XferID, LLMessageSystem::addU32Fast(), LLMessageSystem::addU64Fast(), LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), and LLMessageSystem::sendMessage().
Referenced by processReceiveData(), and retransmitUnackedPackets().
Definition at line 134 of file llxfermanager.cpp.
References f, LL_PACKET_TIMEOUT, llendl, llinfos, llmax(), mAckThrottle, mMaxIncomingXfers, and LLThrottle::setRate().
Referenced by idle_startup(), and init().
Definition at line 117 of file llxfermanager.cpp.
References mMaxIncomingXfers.
Referenced by idle_startup(), and init().
Definition at line 124 of file llxfermanager.cpp.
References mMaxOutgoingXfersPerCircuit.
Referenced by init().
Definition at line 129 of file llxfermanager.cpp.
References mUseAckThrottling.
Referenced by idle_startup().
void LLXferManager::startPendingDownloads | ( | ) | [protected, virtual] |
Definition at line 1003 of file llxfermanager.cpp.
References LLXfer::abort(), LLLinkedList< DATA_TYPE >::addData(), e_LL_XFER_IN_PROGRESS, e_LL_XFER_PENDING, LLLinkedList< DATA_TYPE >::getFirstData(), LLLinkedList< DATA_TYPE >::getNextData(), lldebugs, llendl, llmin(), mMaxIncomingXfers, LLXfer::mNext, mReceiveList, LLXfer::mStatus, S32, and LLXfer::startDownload().
Referenced by processAbort(), processReceiveData(), requestFile(), and requestVFile().
void LLXferManager::updateHostStatus | ( | ) | [virtual] |
Definition at line 153 of file llxfermanager.cpp.
References LLLinkedList< DATA_TYPE >::addData(), LLLinkedList< DATA_TYPE >::deleteAllData(), e_LL_XFER_IN_PROGRESS, e_LL_XFER_PENDING, LLLinkedList< DATA_TYPE >::getFirstData(), LLLinkedList< DATA_TYPE >::getNextData(), LLHostStatus::mHost, LLXfer::mNext, LLHostStatus::mNumActive, LLHostStatus::mNumPending, mOutgoingHosts, LLXfer::mRemoteHost, mSendList, LLXfer::mStatus, and NULL.
Referenced by retransmitUnackedPackets().
LLThrottle LLXferManager::mAckThrottle [protected] |
Definition at line 90 of file llxfermanager.h.
Referenced by retransmitUnackedPackets(), and setAckThrottleBPS().
S32 LLXferManager::mMaxIncomingXfers [protected] |
Definition at line 86 of file llxfermanager.h.
Referenced by setAckThrottleBPS(), setMaxIncomingXfers(), and startPendingDownloads().
S32 LLXferManager::mMaxOutgoingXfersPerCircuit [protected] |
Definition at line 85 of file llxfermanager.h.
Referenced by processFileRequest(), retransmitUnackedPackets(), and setMaxOutgoingXfersPerCircuit().
Definition at line 104 of file llxfermanager.h.
Referenced by changeNumActiveXfers(), free(), numActiveXfers(), numPendingXfers(), printHostStatus(), and updateHostStatus().
Definition at line 102 of file llxfermanager.h.
Referenced by free(), init(), processAbort(), processReceiveData(), requestFile(), requestVFile(), retransmitUnackedPackets(), and startPendingDownloads().
Definition at line 101 of file llxfermanager.h.
Referenced by free(), init(), processConfirmation(), processFileRequest(), registerXfer(), retransmitUnackedPackets(), and updateHostStatus().
BOOL LLXferManager::mUseAckThrottling [protected] |
Definition at line 88 of file llxfermanager.h.
Referenced by init(), processReceiveData(), and setUseAckThrottling().
LLVFS* LLXferManager::mVFS [private] |
LLLinkedQueue<LLXferAckInfo> LLXferManager::mXferAckQueue [protected] |
Definition at line 89 of file llxfermanager.h.
Referenced by processReceiveData(), and retransmitUnackedPackets().