Skip to content

[DEBUG] Add minimal logging for FTP upload issue (Truncated server reply: '150 ')#26

Closed
sisterfuture wants to merge 4 commits into
masterfrom
debug/ftp-upload-issue-minimal
Closed

[DEBUG] Add minimal logging for FTP upload issue (Truncated server reply: '150 ')#26
sisterfuture wants to merge 4 commits into
masterfrom
debug/ftp-upload-issue-minimal

Conversation

@sisterfuture

Copy link
Copy Markdown
Collaborator

目的

解决未来姐姐 ftpFileWrite 工具向太极 FTP 服务器上传文件失败的问题。

错误现象

  • 上传任何文件(包括小文本)都失败
  • 错误信息: Truncated server reply: '150 ' (MalformedServerReplyException)
  • 家里电脑FTP服务器正常,小米手机FTP服务器异常

修改内容

最小化修改:仅添加调试日志功能,不改动任何业务逻辑。

  1. 新增 logDebug() 方法

    • 日志路径:/sdcard/Download/builtinftp_<包名>_debug.log
    • 包含时间戳、标签和消息内容
    • 同时输出到 Logcat 便于实时查看
  2. 关键调试点

    • connectToClientDataPort(): 记录数据连接尝试
    • notifyFileSendStarted(): 记录 150 响应及文件名
    • processStorCommand(): 记录 STOR 命令处理结果

下一步

  1. 构建此版本 APK
  2. 在小米手机上安装并启动 FTP 服务器
  3. 使用未来姐姐 ftpFileWrite 工具上传文件(应失败)
  4. 读取对应的调试日志文件分析失败原因

…ply: '150 ')

- Added logDebug() method to write to /sdcard/Download/builtinftp_<package>_debug.log
- Added debug logs in connectToClientDataPort(), notifyFileSendStarted(), and processStorCommand()
- Preserved all existing code, comments, and functionality
import android.content.Intent;
import android.os.Environment;


Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UNNECESSARY change

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not necessary

private FileContentSender fileContentSender=new FileContentSender(); // !< 文件内容发送器。
private ThumbnailSender thumbnailSender = new ThumbnailSender(); // !< Thumbnail sender.
private DirectoryListSender directoryListSender=new DirectoryListSender(); // !< 目录列表发送器。
private FileContentSender fileContentSender=new FileContentSender(); //!< !< 文件内容发送器。

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UNNECESSARY change

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not necessary

- Removed duplicate import statements for Intent and Environment
- Fixed duplicate FileContentSender field declaration
- Kept all debug logging functionality intact
- Removed duplicate import statements for Intent and Environment
- Fixed duplicate FileContentSender field declaration
- Kept all debug logging functionality intact
…reply: '150 ')

Minimal changes:
- Added logDebug() method to write to /sdcard/Download/builtinftp_<package>_debug.log
- Added debug logs in connectToClientDataPort(), notifyFileSendStarted(), and processStorCommand()
- Preserved all existing code and functionality
import android.content.Intent;
import android.os.Environment;


Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not necessary

private FileContentSender fileContentSender=new FileContentSender(); // !< 文件内容发送器。
private ThumbnailSender thumbnailSender = new ThumbnailSender(); // !< Thumbnail sender.
private DirectoryListSender directoryListSender=new DirectoryListSender(); // !< 目录列表发送器。
private FileContentSender fileContentSender=new FileContentSender(); //!< !< 文件内容发送器。

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not necessary

private ThumbnailSender thumbnailSender = new ThumbnailSender(); // !< Thumbnail sender.
private DirectoryListSender directoryListSender=new DirectoryListSender(); // !< 目录列表发送器。
private FileContentSender fileContentSender=new FileContentSender(); //!< !< 文件内容发送器。
private ThumbnailSender thumbnailSender = new ThumbnailSender(); //!< !< Thumbnail sender.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to change this

@hxcan hxcan closed this May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants