Skip to content

Site commands implementation.#571

Merged
hannesdejager merged 2 commits into
bolcom:masterfrom
martin-cowie:site-commands
Jul 19, 2026
Merged

Site commands implementation.#571
hannesdejager merged 2 commits into
bolcom:masterfrom
martin-cowie:site-commands

Conversation

@martin-cowie

Copy link
Copy Markdown
Contributor

Enclosed is the implementation of site commands for libunftp.

The ServerBuilder structure gets a new site_command method to pass a subcommand and a SiteCommandHandler implementor. As a side-effect enum Reply and ReplyCode have become part of the SiteCommandHandler API, and are now fully documented.

The existing site md5 subcommand remains untouched.

All changes are tested with 100% coverage.

I developed this for an ongoing project: https://github.com/martin-cowie/ftp-kafka

@martin-cowie

martin-cowie commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Hi @hannesdejager - happy to discuss any concerns the team may have to progress this PR 🙂

@hannesdejager

Copy link
Copy Markdown
Collaborator

Thanks, Martin! This is a really useful addition, and the implementation is nicely extensible. Also your project looks cool, integrating with Kafka.

I may make a couple of small adjustments post merge to align the new API with the existing builder conventions. In particular, I’d like configuration problems—such as duplicate or invalid SITE command names and incompatible builder ordering—to be reported through ServerBuilder::build() rather than by panicking. I may also tighten command-name validation and clarify that custom SITE handlers run after authentication.

These are API-hardening refinements; the overall design and implementation of your contribution will remain unchanged. Thanks again for contributing this!

Lastly, do you really need storage_features in SiteCommandContext. It is already available inside the storage field. Trying to limit public API exposure.

@hannesdejager
hannesdejager merged commit d831218 into bolcom:master Jul 19, 2026
8 checks passed
@hannesdejager

Copy link
Copy Markdown
Collaborator

Actually I was wondering if registration of sub-commands should perhaps just override.

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