From ea4603ffb942f1ccddf8629d65490bf83979fda2 Mon Sep 17 00:00:00 2001 From: upstream svn Date: Thu, 13 May 2010 21:27:15 +0000 Subject: [PATCH] Upstream tarball 10154 --- .svn-revision | 2 +- src/KnownFile.h | 72 +++++++++++++-------------- src/libs/ec/abstracts/ECCodes.abstract | 1 - src/libs/ec/cpp/ECCodes.h | 2 - src/libs/ec/java/ECCodes.java | 1 - src/webserver/default/amuleweb-main-dload.php | 2 +- 6 files changed, 38 insertions(+), 42 deletions(-) diff --git a/.svn-revision b/.svn-revision index df3e7843..c82e8c6d 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -10153 +10154 diff --git a/src/KnownFile.h b/src/KnownFile.h index d14d1a47..3c35aa30 100644 --- a/src/KnownFile.h +++ b/src/KnownFile.h @@ -17,7 +17,7 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA @@ -79,11 +79,11 @@ public: uint32 GetAllTimeRequests() const {return alltimerequested;} void SetAllTimeRequests(uint32 new_value) { alltimerequested = new_value; }; uint32 GetAllTimeAccepts() const {return alltimeaccepted;} - void SetAllTimeAccepts(uint32 new_value) { alltimeaccepted = new_value; }; + void SetAllTimeAccepts(uint32 new_value) { alltimeaccepted = new_value; }; uint64 GetAllTimeTransferred() const {return alltimetransferred;} void SetAllTimeTransferred(uint64 new_value) { alltimetransferred = new_value; }; CKnownFile* fileParent; - + private: uint16 requested; uint64 transferred; @@ -99,7 +99,7 @@ private: CKnownFile / CAbstractFile - \ + \ CSearchFile */ class CAbstractFile @@ -125,19 +125,19 @@ public: void SetIntTagValue(uint8 tagname, uint32 ruValue) const; const wxString& GetStrTagValue(uint8 tagname) const; const wxString& GetStrTagValue(const wxString& tagname) const; - const CTag *GetTag(const wxString& tagname) const; + const CTag *GetTag(const wxString& tagname) const; const CTag *GetTag(const wxString& tagname, uint8 tagtype) const; const CTag *GetTag(uint8 tagname) const; - const CTag *GetTag(uint8 tagname, uint8 tagtype) const; + const CTag *GetTag(uint8 tagname, uint8 tagtype) const; void AddTagUnique(const CTag &pTag); const ArrayOfCTag& GetTags() const { return m_taglist; } void AddNote(Kademlia::CEntry* pEntry); const CKadEntryPtrList& getNotes() const { return m_kadNotes; } - /* Comment and rating */ + /* Comment and rating */ virtual const wxString& GetFileComment() const { return m_strComment; } - virtual int8 GetFileRating() const { return m_iRating; } - + virtual int8 GetFileRating() const { return m_iRating; } + bool HasComment() const { return m_hasComment; } bool HasRating() const { return (m_iUserRating != 0); } int8 UserRating() const { return m_iUserRating; } @@ -146,7 +146,7 @@ public: protected: //! CAbstractFile is not assignable. CAbstractFile& operator=(const CAbstractFile); - + CMD4Hash m_abyFileHash; wxString m_strComment; int8 m_iRating; @@ -177,12 +177,12 @@ public: void SetFilePath(const CPath& filePath); const CPath& GetFilePath() const { return m_filePath; } - + virtual bool IsPartFile() const {return false;} virtual bool IsCPartFile() const { return false; } virtual bool LoadFromFile(const CFileDataIO* file); //load date, hashset and tags from a .met file virtual uint8 GetStatus(bool WXUNUSED(ignorepause) = false) const { return PS_COMPLETE; } - bool WriteToFile(CFileDataIO* file); + bool WriteToFile(CFileDataIO* file); time_t GetLastChangeDatetime() const { return m_lastDateChanged; } virtual void SetFileSize(uint64 nFileSize); @@ -199,7 +199,7 @@ public: // nr. of 9MB parts according the file size wrt ED2K protocol (OP_FILESTATUS) inline uint16 GetED2KPartCount() const { return m_iED2KPartCount; } - + // size of a certain part, last is different, all others are PARTSIZE uint32 GetPartSize(uint16 part) const { return part == m_iPartCount - 1 ? m_sizeLastPart : PARTSIZE; } @@ -218,54 +218,54 @@ public: bool LoadHashsetFromFile(const CFileDataIO* file, bool checkhash); void AddUploadingClient(CUpDownClient* client); void RemoveUploadingClient(CUpDownClient* client); - - // comment - const wxString& GetFileComment() { if (!m_bCommentLoaded) LoadComment(); return m_strComment; } + + // comment + const wxString& GetFileComment() { if (!m_bCommentLoaded) LoadComment(); return m_strComment; } int8 GetFileRating() { if (!m_bCommentLoaded) LoadComment(); return m_iRating; } void SetFileComment(const wxString& strNewComment); - void SetFileRating(int8 iNewRating); + void SetFileRating(int8 iNewRating); void SetPublishedED2K( bool val ); bool GetPublishedED2K() const {return m_PublishedED2K;} - /* Kad stuff */ + /* Kad stuff */ uint32 GetKadFileSearchID() const { return kadFileSearchID; } // KAD TODO: This must be used on KadSearchListCtrl too once imported void SetKadFileSearchID(uint32 id) { kadFileSearchID = id; } // John - Don't use this unless you know what your are DOING!! (Hopefully I do.. :) const Kademlia::WordList& GetKadKeywords() const { return wordlist; } // KAD TODO: If we add the proper column to SharedFilesCtrl, this is the funtion. - uint32 GetLastPublishTimeKadSrc() const { return m_lastPublishTimeKadSrc; } + uint32 GetLastPublishTimeKadSrc() const { return m_lastPublishTimeKadSrc; } void SetLastPublishTimeKadSrc(uint32 time, uint32 buddyip) { m_lastPublishTimeKadSrc = time; m_lastBuddyIP = buddyip;} // Another unused function, useful for the shared files control column uint32 GetLastPublishBuddy() const { return m_lastBuddyIP; } void SetLastPublishTimeKadNotes(uint32 time) {m_lastPublishTimeKadNotes = time;} - uint32 GetLastPublishTimeKadNotes() const { return m_lastPublishTimeKadNotes; } - + uint32 GetLastPublishTimeKadNotes() const { return m_lastPublishTimeKadNotes; } + bool PublishSrc(); - bool PublishNotes(); - + bool PublishNotes(); + // TODO: This must be implemented if we ever want to have metadata. uint32 GetMetaDataVer() const { return /*m_uMetaDataVer*/ 0; } - + // file sharing virtual CPacket* CreateSrcInfoPacket(const CUpDownClient* forClient, uint8 byRequestedVersion, uint16 nRequestedOptions); - - virtual void UpdatePartsInfo(); - + virtual void UpdatePartsInfo(); + + CFileStatistic statistic; - + time_t m_nCompleteSourcesTime; uint16 m_nCompleteSourcesCount; uint16 m_nCompleteSourcesCountLo; uint16 m_nCompleteSourcesCountHi; - + // Common for part and known files. typedef std::set SourceSet; SourceSet m_ClientUploadList; ArrayOfUInts16 m_AvailPartFrequency; - - /** + + /** * Returns a base-16 encoding of the master hash, or * an empty string if no such hash exists. */ @@ -279,16 +279,16 @@ public: * @param client The clients whoose uploading parts should be considered. * @param increment If true, the counts are incremented, otherwise they are decremented. * - * This functions updates the frequency list of file-upparts, using the clients + * This functions updates the frequency list of file-upparts, using the clients * upparts-status. This function should be called by clients every time they update their * upparts-status, or when they are added or removed from the file. */ void UpdateUpPartsFrequency( CUpDownClient* client, bool increment ); static void CreateHashFromHashlist(const ArrayOfCMD4Hash& hashes, CMD4Hash* Output); - + void ClearPriority(); - + time_t m_lastDateChanged; virtual wxString GetFeedback() const; @@ -314,7 +314,7 @@ protected: // AICH CAICHHashSet* GetAICHHashset() const { return m_pAICHHashSet; } void SetAICHHashset(CAICHHashSet* val) { m_pAICHHashSet = val; } - + protected: CAICHHashSet* m_pAICHHashSet; #endif @@ -323,7 +323,7 @@ protected: bool LoadDateFromFile(const CFileDataIO* file); void LoadComment();//comment ArrayOfCMD4Hash m_hashlist; - CPath m_filePath; + CPath m_filePath; static void CreateHashFromFile(class CFileAutoClose& file, uint64 offset, uint32 Length, CMD4Hash* Output, CAICHHashTree* pShaHashOut); static void CreateHashFromInput(const byte* input, uint32 Length, CMD4Hash* Output, CAICHHashTree* pShaHashOut); diff --git a/src/libs/ec/abstracts/ECCodes.abstract b/src/libs/ec/abstracts/ECCodes.abstract index 6e8655cd..dde08631 100644 --- a/src/libs/ec/abstracts/ECCodes.abstract +++ b/src/libs/ec/abstracts/ECCodes.abstract @@ -225,7 +225,6 @@ EC_TAG_PARTFILE 0x0300 EC_TAG_PARTFILE_HASH 0x031E EC_TAG_PARTFILE_SHARED 0x031F EC_TAG_PARTFILE_HASHED_PART_COUNT 0x0320 - EC_TAG_PARTFILE_PART_COUNT 0x0321 EC_TAG_KNOWNFILE 0x0400 EC_TAG_KNOWNFILE_XFERRED 0x0401 diff --git a/src/libs/ec/cpp/ECCodes.h b/src/libs/ec/cpp/ECCodes.h index 2de6354b..98000ff3 100644 --- a/src/libs/ec/cpp/ECCodes.h +++ b/src/libs/ec/cpp/ECCodes.h @@ -201,7 +201,6 @@ enum ECTagNames { EC_TAG_PARTFILE_HASH = 0x031E, EC_TAG_PARTFILE_SHARED = 0x031F, EC_TAG_PARTFILE_HASHED_PART_COUNT = 0x0320, - EC_TAG_PARTFILE_PART_COUNT = 0x0321, EC_TAG_KNOWNFILE = 0x0400, EC_TAG_KNOWNFILE_XFERRED = 0x0401, EC_TAG_KNOWNFILE_XFERRED_ALL = 0x0402, @@ -611,7 +610,6 @@ wxString GetDebugNameECTagNames(uint16 arg) case 0x031E: return wxT("EC_TAG_PARTFILE_HASH"); case 0x031F: return wxT("EC_TAG_PARTFILE_SHARED"); case 0x0320: return wxT("EC_TAG_PARTFILE_HASHED_PART_COUNT"); - case 0x0321: return wxT("EC_TAG_PARTFILE_PART_COUNT"); case 0x0400: return wxT("EC_TAG_KNOWNFILE"); case 0x0401: return wxT("EC_TAG_KNOWNFILE_XFERRED"); case 0x0402: return wxT("EC_TAG_KNOWNFILE_XFERRED_ALL"); diff --git a/src/libs/ec/java/ECCodes.java b/src/libs/ec/java/ECCodes.java index 86e820dc..78ff78eb 100644 --- a/src/libs/ec/java/ECCodes.java +++ b/src/libs/ec/java/ECCodes.java @@ -189,7 +189,6 @@ public final static short EC_TAG_PARTFILE_AVAILABLE_PARTS = 0x031D; public final static short EC_TAG_PARTFILE_HASH = 0x031E; public final static short EC_TAG_PARTFILE_SHARED = 0x031F; public final static short EC_TAG_PARTFILE_HASHED_PART_COUNT = 0x0320; -public final static short EC_TAG_PARTFILE_PART_COUNT = 0x0321; public final static short EC_TAG_KNOWNFILE = 0x0400; public final static short EC_TAG_KNOWNFILE_XFERRED = 0x0401; public final static short EC_TAG_KNOWNFILE_XFERRED_ALL = 0x0402; diff --git a/src/webserver/default/amuleweb-main-dload.php b/src/webserver/default/amuleweb-main-dload.php index 13e56202..6e0b67c9 100644 --- a/src/webserver/default/amuleweb-main-dload.php +++ b/src/webserver/default/amuleweb-main-dload.php @@ -331,7 +331,7 @@ function formCommandSubmit(command) } // - // perform command b20efore processing content + // perform command before processing content if ( ($HTTP_GET_VARS["command"] != "") && ($_SESSION["guest_login"] == 0) ) { foreach ( $HTTP_GET_VARS as $name => $val) { -- 2.11.4.GIT