2 display issues with compiled FileZilla

Moderator: Project members

Post Reply
Message
Author
test
150 Opening data channel
Posts: 55
Joined: 2020-03-24 06:36

2 display issues with compiled FileZilla

#1 Post by test » 2020-04-23 16:15

Hi Tim!
You are doing great work! :D

I am facing 2 issues related to display in the compiled FileZilla.

1) While displaying any directory list on remote side after successful connection, it shows question mark (?) on directory icon.

doubt1.png
doubt1.png (101.09 KiB) Viewed 490 times

I am able to successfully create/enter/list/upload/delete/download directories/files. What might be the reason behind it?


2) After downloading/uploading file successfully to/from Storj, File transfer successful, transferred 0 bytes in ..... seconds is displayed in Status Bar

This time of download/upload duration (in seconds) is correctly displayed. But, the downloaded/uploaded file size is always incorrectly displayed as 0 bytes only for Storj file transfer (For FTP/SFTP file transfer, the file size is displayed correctly)
(Even though the file size after Storj download/upload operation is displayed correctly on both local site view as well as remote site view)

doubt2.png
doubt2.png (95.37 KiB) Viewed 491 times

I found out that the backend code behind 2) is function void CControlSocket::LogTransferResultMessage(int nErrorCode, CFileTransferOpData *pData) in file /filezilla/src/engine/ControlSocket.cpp.

That code is:

Code: Select all

void CControlSocket::LogTransferResultMessage(int nErrorCode, CFileTransferOpData *pData)
{
	bool tmp{};

	CTransferStatus const status = engine_.transfer_status_.Get(tmp);
	if (!status.empty() && (nErrorCode == FZ_REPLY_OK || status.madeProgress)) {
		int elapsed = static_cast<int>((fz::datetime::now() - status.started).get_seconds());
		if (elapsed <= 0) {
			elapsed = 1;
		}
		std::wstring time = fz::sprintf(fztranslate("%d second", "%d seconds", elapsed), elapsed);

		int64_t transferred = status.currentOffset - status.startOffset;
		std::wstring size = CSizeFormatBase::Format(&engine_.GetOptions(), transferred, true);

		logmsg::type msgType = logmsg::error;
		std::wstring msg;
		if (nErrorCode == FZ_REPLY_OK) {
			msgType = logmsg::status;
			msg = _("File transfer successful, transferred %s in %s");
		}
		else if ((nErrorCode & FZ_REPLY_CANCELED) == FZ_REPLY_CANCELED) {
			msg = _("File transfer aborted by user after transferring %s in %s");
		}
		else if ((nErrorCode & FZ_REPLY_CRITICALERROR) == FZ_REPLY_CRITICALERROR) {
			msg = _("Critical file transfer error after transferring %s in %s");
		}
		else {
			msg = _("File transfer failed after transferring %s in %s");
		}
		log(msgType, msg, size, time);
	}
	else {
		if ((nErrorCode & FZ_REPLY_CANCELED) == FZ_REPLY_CANCELED) {
			log(logmsg::error, _("File transfer aborted by user"));
		}
		else if (nErrorCode == FZ_REPLY_OK) {
			if (pData->transferInitiated_) {
				log(logmsg::status, _("File transfer successful"));
			}
			else {
				log(logmsg::status, _("File transfer skipped"));
			}
		}
		else if ((nErrorCode & FZ_REPLY_CRITICALERROR) == FZ_REPLY_CRITICALERROR) {
			log(logmsg::error, _("Critical file transfer error"));
		}
		else {
			log(logmsg::error, _("File transfer failed"));
		}
	}
}

I tried replacing

Code: Select all

log(msgType, msg, size, time);
by

Code: Select all

log(msgType, msg, status.currentOffset, time);
Then after new upload/download, I got the message File transfer successful, transferred 0 in .... seconds
which probably means that status.currentOffset is still zero.

The relevant code in my /filezilla/src/fzstorj.cpp is:

Code: Select all

else if (command == "get") {
	size_t pos = arg.find(' ');
	if (pos == std::string::npos) {
		fzprintf(storjEvent::Error, "Bad arguments");
		continue;
	}
	std::string bucket = arg.substr(0, pos);
	size_t pos2 = arg.find(' ', pos + 1);
	if (pos == std::string::npos) {
		fzprintf(storjEvent::Error, "Bad arguments");
		continue;
	}
	auto id = arg.substr(pos + 1, pos2 - pos - 1);
	auto file = arg.substr(pos2 + 1);

	if (file.size() >= 3 && file.front() == '"' && file.back() == '"') {
		file = fz::replaced_substrings(file.substr(1, file.size() - 2), "\"\"", "\"");
	}
			
	ProjectResult project_result = fv_openStorjProject();
	fv_downloadObject(project_result.project, bucket, id, file);
		
	fzprintf(storjEvent::Done);			
}
I am unable to figure out the above.

Kindly help
Thanks!

User avatar
boco
Contributor
Posts: 25334
Joined: 2006-05-01 03:28
Location: Germany

Re: 2 display issues with compiled FileZilla

#2 Post by boco » 2020-04-23 16:25

1) The question marks are normal and mean "unvisited". Other than local directories, remote ones can not be enumerated automatically (process is too heavy on the server). FileZilla simply doesn't know if and what's in them until you visit them once - then they are known until you close FileZilla.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
### END SIGNATURE BLOCK ###

User avatar
botg
Site Admin
Posts: 33242
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: 2 display issues with compiled FileZilla

#3 Post by botg » 2020-04-23 17:17

You need to update the download progress.

test
150 Opening data channel
Posts: 55
Joined: 2020-03-24 06:36

Re: 2 display issues with compiled FileZilla

#4 Post by test » 2020-04-24 08:53

I tried using fzprintf(storjEvent::Transfer, "%u", .....<variable name>.....) in fzstorj.cpp & it worked

Thanks! :D

Post Reply