From f1c97f4057833220a2e9ac045d701208e30457d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20N=C3=A6sbye=20Christensen?= Date: Sun, 18 Feb 2024 16:41:22 +0100 Subject: misc: BOOL to bool --- indra/llmessage/llxfermanager.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/llmessage/llxfermanager.h') diff --git a/indra/llmessage/llxfermanager.h b/indra/llmessage/llxfermanager.h index f49209bed0..17625aedfa 100644 --- a/indra/llmessage/llxfermanager.h +++ b/indra/llmessage/llxfermanager.h @@ -100,7 +100,7 @@ class LLXferManager protected: // implementation methods virtual void startPendingDownloads(); - virtual void addToList(LLXfer* xferp, xfer_list_t & xfer_list, BOOL is_priority); + virtual void addToList(LLXfer* xferp, xfer_list_t & xfer_list, bool is_priority); std::multiset mExpectedTransfers; // files that are authorized to transfer out std::multiset mExpectedRequests; // files that are authorized to be downloaded on top of std::multiset mExpectedVFileTransfers; // files that are authorized to transfer out @@ -135,9 +135,9 @@ class LLXferManager // general utility routines 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 S32 encodePacketNum(S32 packet_num, bool is_eof); + virtual S32 decodePacketNum(S32 packet_num); + virtual bool isLastPacket(S32 packet_num); // file requesting routines // .. to file @@ -145,19 +145,19 @@ class LLXferManager const std::string& remote_filename, ELLPath remote_path, const LLHost& remote_host, - BOOL delete_remote_on_completion, + bool delete_remote_on_completion, void (*callback)(void**,S32,LLExtStat), void** user_data, - BOOL is_priority = FALSE, - BOOL use_big_packets = FALSE); + bool is_priority = false, + bool use_big_packets = false); /* // .. to memory virtual void requestFile(const std::string& remote_filename, ELLPath remote_path, const LLHost &remote_host, - BOOL delete_remote_on_completion, + bool delete_remote_on_completion, void (*callback)(void*, S32, void**, S32, LLExtStat), void** user_data, - BOOL is_priority = FALSE); + bool is_priority = false); */ // vfile requesting // .. to vfile @@ -165,7 +165,7 @@ class LLXferManager LLAssetType::EType type, const LLHost& remote_host, void (*callback)(void**,S32,LLExtStat), void** user_data, - BOOL is_priority = FALSE); + bool is_priority = false); /** When arbitrary files are requested to be transfered (by giving a dir of LL_PATH_NONE) they must be "expected", but having something pre-authorize them. This pair of functions -- cgit v1.2.3 From 321f283032688f0feddc696654e86f62af07121a Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 19 Feb 2024 15:01:44 +0100 Subject: Replace remaining BOOL with bool llinventory and llmessage --- indra/llmessage/llxfermanager.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llmessage/llxfermanager.h') diff --git a/indra/llmessage/llxfermanager.h b/indra/llmessage/llxfermanager.h index 17625aedfa..5b42e781eb 100644 --- a/indra/llmessage/llxfermanager.h +++ b/indra/llmessage/llxfermanager.h @@ -76,7 +76,7 @@ class LLXferManager S32 mHardLimitOutgoingXfersPerCircuit; // At this limit, kill off the connection S32 mMaxIncomingXfers; - BOOL mUseAckThrottling; // Use ack throttling to cap file xfer bandwidth + bool mUseAckThrottling; // Use ack throttling to cap file xfer bandwidth std::deque mXferAckQueue; LLThrottle mAckThrottle; public: @@ -85,8 +85,8 @@ class LLXferManager // an xfer must happen asap. enum { - LOW_PRIORITY = FALSE, - HIGH_PRIORITY = TRUE, + LOW_PRIORITY = false, + HIGH_PRIORITY = true, }; // Linked FIFO list, add to the front and pull from back @@ -113,7 +113,7 @@ class LLXferManager virtual void init(); virtual void cleanup(); - void setUseAckThrottling(const BOOL use); + void setUseAckThrottling(const bool use); void setAckThrottleBPS(const F32 bps); // list management routines -- cgit v1.2.3 From e2e37cced861b98de8c1a7c9c0d3a50d2d90e433 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 22 May 2024 21:25:21 +0200 Subject: Fix line endlings --- indra/llmessage/llxfermanager.h | 446 ++++++++++++++++++++-------------------- 1 file changed, 223 insertions(+), 223 deletions(-) (limited to 'indra/llmessage/llxfermanager.h') diff --git a/indra/llmessage/llxfermanager.h b/indra/llmessage/llxfermanager.h index ce412ddd26..3be5f5a228 100644 --- a/indra/llmessage/llxfermanager.h +++ b/indra/llmessage/llxfermanager.h @@ -1,223 +1,223 @@ -/** - * @file llxfermanager.h - * @brief definition of LLXferManager class for a keeping track of - * multiple xfers - * - * $LicenseInfo:firstyear=2001&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_LLXFERMANAGER_H -#define LL_LLXFERMANAGER_H - -/** - * this manager keeps both a send list and a receive list; anything with a - * LLXferManager can send and receive files via messages - */ - -//Forward declaration to avoid circular dependencies -class LLXfer; - -#include "llxfer.h" -#include "message.h" -#include "llassetstorage.h" -#include "lldir.h" -#include -#include "llthrottle.h" - -class LLHostStatus -{ - public: - LLHost mHost; - S32 mNumActive; - S32 mNumPending; - - LLHostStatus() {mNumActive = 0; mNumPending = 0;}; - virtual ~LLHostStatus(){}; -}; - -// Class stores ack information, to be put on list so we can throttle xfer rate. -class LLXferAckInfo -{ -public: - LLXferAckInfo(U32 dummy = 0) - { - mID = 0; - mPacketNum = -1; - } - - U64 mID; - S32 mPacketNum; - LLHost mRemoteHost; -}; - -class LLXferManager -{ - protected: - S32 mMaxOutgoingXfersPerCircuit; - S32 mHardLimitOutgoingXfersPerCircuit; // At this limit, kill off the connection - S32 mMaxIncomingXfers; - - bool mUseAckThrottling; // Use ack throttling to cap file xfer bandwidth - std::deque mXferAckQueue; - LLThrottle mAckThrottle; - public: - - // This enumeration is useful in the requestFile() to specify if - // an xfer must happen asap. - enum - { - LOW_PRIORITY = false, - HIGH_PRIORITY = true, - }; - - // Linked FIFO list, add to the front and pull from back - typedef std::deque xfer_list_t; - xfer_list_t mSendList; - xfer_list_t mReceiveList; - - typedef std::list status_list_t; - status_list_t mOutgoingHosts; - - protected: - // implementation methods - virtual void startPendingDownloads(); - virtual void addToList(LLXfer* xferp, xfer_list_t & xfer_list, bool is_priority); - std::multiset mExpectedTransfers; // files that are authorized to transfer out - std::multiset mExpectedRequests; // files that are authorized to be downloaded on top of - std::multiset mExpectedVFileTransfers; // files that are authorized to transfer out - std::multiset mExpectedVFileRequests; // files that are authorized to be downloaded on top of - - public: - LLXferManager(); - virtual ~LLXferManager(); - - virtual void init(); - virtual void cleanup(); - - void setUseAckThrottling(const bool use); - void setAckThrottleBPS(const F32 bps); - -// list management routines - virtual LLXfer *findXferByID(U64 id, xfer_list_t & xfer_list); - virtual void removeXfer (LLXfer *delp, xfer_list_t & xfer_list); - - LLHostStatus * findHostStatus(const LLHost &host); - 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 setHardLimitOutgoingXfersPerCircuit(S32 max_num); - virtual void setMaxIncomingXfers(S32 max_num); - virtual void updateHostStatus(); - virtual void printHostStatus(); - -// general utility routines - 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); - -// file requesting routines -// .. to file - virtual U64 requestFile(const std::string& local_filename, - const std::string& 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); - /* -// .. to memory - virtual void requestFile(const std::string& 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); - */ -// vfile requesting -// .. to vfile - virtual void requestVFile(const LLUUID &local_id, const LLUUID& remote_id, - LLAssetType::EType type, - const LLHost& remote_host, - void (*callback)(void**,S32,LLExtStat), void** user_data, - bool is_priority = false); - /** - When arbitrary files are requested to be transfered (by giving a dir of LL_PATH_NONE) - they must be "expected", but having something pre-authorize them. This pair of functions - maintains a pre-authorized list. The first function adds something to the list, the second - checks if is authorized, removing it if so. In this way, a file is only authorized for - a single use. - */ - virtual void expectFileForTransfer(const std::string& filename); - virtual bool validateFileForTransfer(const std::string& filename); - /** - Same idea, but for the viewer about to call InitiateDownload to track what it requested. - */ - virtual void expectFileForRequest(const std::string& filename); - virtual bool validateFileForRequest(const std::string& filename); - - /** - Same idea but for VFiles, kept separate to avoid namespace overlap - */ - /* Present in fireengine, not used by viewer - virtual void expectVFileForTransfer(const std::string& filename); - virtual bool validateVFileForTransfer(const std::string& filename); - virtual void expectVFileForRequest(const std::string& filename); - virtual bool validateVFileForRequest(const std::string& filename); - */ - - virtual void processReceiveData (LLMessageSystem *mesgsys, void **user_data); - virtual void sendConfirmPacket (LLMessageSystem *mesgsys, U64 id, S32 packetnum, const LLHost &remote_host); - -// file sending routines - virtual void processFileRequest (LLMessageSystem *mesgsys, void **user_data); - virtual void processConfirmation (LLMessageSystem *mesgsys, void **user_data); - virtual void retransmitUnackedPackets (); - -// error handling - void abortRequestById(U64 xfer_id, S32 result_code); - virtual void processAbort (LLMessageSystem *mesgsys, void **user_data); - - virtual bool isHostFlooded(const LLHost & host); -}; - -extern LLXferManager* gXferManager; - -// initialization and garbage collection -void start_xfer_manager(); -void cleanup_xfer_manager(); - -// message system callbacks -void process_confirm_packet (LLMessageSystem *mesgsys, void **user_data); -void process_request_xfer (LLMessageSystem *mesgsys, void **user_data); -void continue_file_receive(LLMessageSystem *mesgsys, void **user_data); -void process_abort_xfer (LLMessageSystem *mesgsys, void **user_data); -#endif - - - +/** + * @file llxfermanager.h + * @brief definition of LLXferManager class for a keeping track of + * multiple xfers + * + * $LicenseInfo:firstyear=2001&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_LLXFERMANAGER_H +#define LL_LLXFERMANAGER_H + +/** + * this manager keeps both a send list and a receive list; anything with a + * LLXferManager can send and receive files via messages + */ + +//Forward declaration to avoid circular dependencies +class LLXfer; + +#include "llxfer.h" +#include "message.h" +#include "llassetstorage.h" +#include "lldir.h" +#include +#include "llthrottle.h" + +class LLHostStatus +{ + public: + LLHost mHost; + S32 mNumActive; + S32 mNumPending; + + LLHostStatus() {mNumActive = 0; mNumPending = 0;}; + virtual ~LLHostStatus(){}; +}; + +// Class stores ack information, to be put on list so we can throttle xfer rate. +class LLXferAckInfo +{ +public: + LLXferAckInfo(U32 dummy = 0) + { + mID = 0; + mPacketNum = -1; + } + + U64 mID; + S32 mPacketNum; + LLHost mRemoteHost; +}; + +class LLXferManager +{ + protected: + S32 mMaxOutgoingXfersPerCircuit; + S32 mHardLimitOutgoingXfersPerCircuit; // At this limit, kill off the connection + S32 mMaxIncomingXfers; + + bool mUseAckThrottling; // Use ack throttling to cap file xfer bandwidth + std::deque mXferAckQueue; + LLThrottle mAckThrottle; + public: + + // This enumeration is useful in the requestFile() to specify if + // an xfer must happen asap. + enum + { + LOW_PRIORITY = false, + HIGH_PRIORITY = true, + }; + + // Linked FIFO list, add to the front and pull from back + typedef std::deque xfer_list_t; + xfer_list_t mSendList; + xfer_list_t mReceiveList; + + typedef std::list status_list_t; + status_list_t mOutgoingHosts; + + protected: + // implementation methods + virtual void startPendingDownloads(); + virtual void addToList(LLXfer* xferp, xfer_list_t & xfer_list, bool is_priority); + std::multiset mExpectedTransfers; // files that are authorized to transfer out + std::multiset mExpectedRequests; // files that are authorized to be downloaded on top of + std::multiset mExpectedVFileTransfers; // files that are authorized to transfer out + std::multiset mExpectedVFileRequests; // files that are authorized to be downloaded on top of + + public: + LLXferManager(); + virtual ~LLXferManager(); + + virtual void init(); + virtual void cleanup(); + + void setUseAckThrottling(const bool use); + void setAckThrottleBPS(const F32 bps); + +// list management routines + virtual LLXfer *findXferByID(U64 id, xfer_list_t & xfer_list); + virtual void removeXfer (LLXfer *delp, xfer_list_t & xfer_list); + + LLHostStatus * findHostStatus(const LLHost &host); + 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 setHardLimitOutgoingXfersPerCircuit(S32 max_num); + virtual void setMaxIncomingXfers(S32 max_num); + virtual void updateHostStatus(); + virtual void printHostStatus(); + +// general utility routines + 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); + +// file requesting routines +// .. to file + virtual U64 requestFile(const std::string& local_filename, + const std::string& 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); + /* +// .. to memory + virtual void requestFile(const std::string& 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); + */ +// vfile requesting +// .. to vfile + virtual void requestVFile(const LLUUID &local_id, const LLUUID& remote_id, + LLAssetType::EType type, + const LLHost& remote_host, + void (*callback)(void**,S32,LLExtStat), void** user_data, + bool is_priority = false); + /** + When arbitrary files are requested to be transfered (by giving a dir of LL_PATH_NONE) + they must be "expected", but having something pre-authorize them. This pair of functions + maintains a pre-authorized list. The first function adds something to the list, the second + checks if is authorized, removing it if so. In this way, a file is only authorized for + a single use. + */ + virtual void expectFileForTransfer(const std::string& filename); + virtual bool validateFileForTransfer(const std::string& filename); + /** + Same idea, but for the viewer about to call InitiateDownload to track what it requested. + */ + virtual void expectFileForRequest(const std::string& filename); + virtual bool validateFileForRequest(const std::string& filename); + + /** + Same idea but for VFiles, kept separate to avoid namespace overlap + */ + /* Present in fireengine, not used by viewer + virtual void expectVFileForTransfer(const std::string& filename); + virtual bool validateVFileForTransfer(const std::string& filename); + virtual void expectVFileForRequest(const std::string& filename); + virtual bool validateVFileForRequest(const std::string& filename); + */ + + virtual void processReceiveData (LLMessageSystem *mesgsys, void **user_data); + virtual void sendConfirmPacket (LLMessageSystem *mesgsys, U64 id, S32 packetnum, const LLHost &remote_host); + +// file sending routines + virtual void processFileRequest (LLMessageSystem *mesgsys, void **user_data); + virtual void processConfirmation (LLMessageSystem *mesgsys, void **user_data); + virtual void retransmitUnackedPackets (); + +// error handling + void abortRequestById(U64 xfer_id, S32 result_code); + virtual void processAbort (LLMessageSystem *mesgsys, void **user_data); + + virtual bool isHostFlooded(const LLHost & host); +}; + +extern LLXferManager* gXferManager; + +// initialization and garbage collection +void start_xfer_manager(); +void cleanup_xfer_manager(); + +// message system callbacks +void process_confirm_packet (LLMessageSystem *mesgsys, void **user_data); +void process_request_xfer (LLMessageSystem *mesgsys, void **user_data); +void continue_file_receive(LLMessageSystem *mesgsys, void **user_data); +void process_abort_xfer (LLMessageSystem *mesgsys, void **user_data); +#endif + + + -- cgit v1.2.3