From e9ae4d8504bff18d349f04df0ee04454890a6177 Mon Sep 17 00:00:00 2001 From: upstream svn Date: Mon, 21 Jun 2010 18:37:16 +0000 Subject: [PATCH] Upstream tarball 10223 --- .svn-revision | 2 +- src/webserver/src/WebServer.cpp | 2 ++ src/webserver/src/WebServer.h | 4 ++-- src/webserver/src/php_amule_lib.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.svn-revision b/.svn-revision index 1d189c5c..256e98ca 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -10222 +10223 diff --git a/src/webserver/src/WebServer.cpp b/src/webserver/src/WebServer.cpp index 9a80e72c..ba005801 100644 --- a/src/webserver/src/WebServer.cpp +++ b/src/webserver/src/WebServer.cpp @@ -797,6 +797,8 @@ UploadFile::UploadFile(CEC_UpDownClient_Tag *tag) : CECID(tag->ID()) nSpeed = tag->SpeedUp(); nTransferredUp = tag->XferUp(); nTransferredDown = tag->XferDown(); + nUploadFile = 0; + tag->UploadFile(nUploadFile); } UploadsInfo *UploadFile::GetContainerInstance() diff --git a/src/webserver/src/WebServer.h b/src/webserver/src/WebServer.h index bf177a74..4042fbda 100644 --- a/src/webserver/src/WebServer.h +++ b/src/webserver/src/WebServer.h @@ -144,14 +144,14 @@ class ServerEntry { uint32 ID() { return nServerIP; } }; +// This is a client we are uploading to, not a file class UploadFile : public CECID { public: wxString sUserName; uint32 nTransferredUp; uint32 nTransferredDown; uint32 nSpeed; - // - // Don't need filename - sharedfiles already have it + uint32 nUploadFile; // ECID of shared file uploading to client UploadFile(CEC_UpDownClient_Tag *tag); diff --git a/src/webserver/src/php_amule_lib.cpp b/src/webserver/src/php_amule_lib.cpp index beb2cbe2..f7bbfc59 100644 --- a/src/webserver/src/php_amule_lib.cpp +++ b/src/webserver/src/php_amule_lib.cpp @@ -894,19 +894,19 @@ void amule_upload_file_prop_get(void *ptr, char *prop_name, PHP_VALUE_NODE *resu result->type = PHP_VAL_INT; if ( strcmp(prop_name, "name") == 0 ) { result->type = PHP_VAL_STRING; - SharedFile *sharedfile = SharedFile::GetContainerInstance()->GetByID(obj->ID()); + SharedFile *sharedfile = SharedFile::GetContainerInstance()->GetByID(obj->nUploadFile); // uploading file we don't share ?! We are either out of sync with core or a shared file has been removed while uploading it if ( !sharedfile ) { SharedFile::GetContainerInstance()->ReQuery(); - sharedfile = SharedFile::GetContainerInstance()->GetByID(obj->ID()); + sharedfile = SharedFile::GetContainerInstance()->GetByID(obj->nUploadFile); } result->str_val = strdup(sharedfile ? (const char *)unicode2UTF8(sharedfile->sFileName) : "???"); } else if ( strcmp(prop_name, "short_name") == 0 ) { result->type = PHP_VAL_STRING; - SharedFile *sharedfile = SharedFile::GetContainerInstance()->GetByID(obj->ID()); + SharedFile *sharedfile = SharedFile::GetContainerInstance()->GetByID(obj->nUploadFile); if ( !sharedfile ) { SharedFile::GetContainerInstance()->ReQuery(); - sharedfile = SharedFile::GetContainerInstance()->GetByID(obj->ID()); + sharedfile = SharedFile::GetContainerInstance()->GetByID(obj->nUploadFile); } wxString short_name; if (sharedfile) { -- 2.11.4.GIT