Skip to content

Comments

Many different optimizations to improve performance and capabilities.#7

Open
drakmor wants to merge 64 commits intops5-payload-dev:masterfrom
drakmor:ps5-payload-dev-master
Open

Many different optimizations to improve performance and capabilities.#7
drakmor wants to merge 64 commits intops5-payload-dev:masterfrom
drakmor:ps5-payload-dev-master

Conversation

@drakmor
Copy link

@drakmor drakmor commented Jan 11, 2026

Sorry about the PR, but it's getting really hard to break it down into feature blocks.
I suggest we discuss it in the comments and remove the unnecessary bits.

drakmor added 28 commits January 9, 2026 00:47
- add buffered control reader, socket tuning, per-connection transfer buffer, and detached thread setup

- implement ASCII transfer mode with CRLF conversion; disable REST/SIZE in ASCII and reset REST on RETR/TYPE

- add upload resume validation and safer STOR seek/EOF checks

- expand listing support: larger LIST buffer, NLST/MLSD/MLST, proper facts/mtime, and fixed MLSD/MLST formatting

- implement PASS/FEAT/OPTS/MDTM/STAT/HELP/MODE/STRU/ALLO/ABOR commands

- add SELF verification toggle and optional verify in ELF extraction

- harden I/O helpers (looped read/write/pread/pwrite, buffered copy) and make buffer sizes configurable

- enable O2/Zen2 PS5 build flags and fix MLST/LIST/data read edge cases
@john-tornblom
Copy link
Contributor

I will comment here on this PR, and suggest you start from a fresh clone of current upstream master and make feature branches that you send individual PRs for.

@john-tornblom
Copy link
Contributor

On second though, could you provide a bullet list of the new capabilities first, and why it is needed. A lot of the ftp protocol is scattered acroos several RFCs, and many features are not really needed. Also, if a new command is not actually implemented, I would prefer to not have it at all, e.g., the authentication commands. All clients I have tested work without those commands.

- add data-channel precheck and unified open/transfer errors
- reuse helpers for PASV/EPSV and PORT/EPRT
- rework LIST/NLST/MLSD path handling and transfer buffer
- support LIST on files and consistent readdir/stat flow
- extend MLST/MLSD facts (OS.unix types, unique, unix.mode/uid/gid) with symlink escaping
- reject directory deletes in DELE
@john-tornblom
Copy link
Contributor

FYI: I've started integrating some of your improvements. Some questions:

  • whats up with the pthread_attr_* shenanigans in srv.c? Seems like this is not really needed?
  • There are some changes not needed, e.g., if(env.data_fd > 0) ---> if(env.data_fd >= 0). fd 0 is stdin and does not need to be closed
  • ftp_prefix_ieq et.al can be replaced with libc alternatives (I've done so in srv.c)

Its gonna take a while for me to integrate all of this. I will get to cmd.c eventually

@drakmor
Copy link
Author

drakmor commented Jan 28, 2026

Hello.

  1. pthread_attr_ remains from the battle with stack leakage; you can either leave the creation with PT_DETACH as is or remove it.
  2. env.data_fd >= 0 for unification, as opposed to -1.
  3. ftp_prefix_ieq yes, thx.

I am currently collecting the issues that arise, and towards the end of the week I will fix what I find and add edits for working with SELF, for example, so that the process is not killed when trying to read certain files.

Added the latest commits to PR

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