quality: extract shared client connect/session setup and delete preamble #323

Closed
opened 2026-09-23 02:10:50 +02:00 by TapTap · 1 comment
Owner

The connect_transfer_client + protocol_session_init/set_io_timeout/set_ssl/bind sequence is copy-pasted 3x (client_manifest.c:475-487, client_send.c:940-952, client_send.c:1832-1845), and send_dry_run_remote/send_files_multithreaded duplicate the files-from/missing-args preamble.

Work: add client_connect_and_bind_session(config, &session) and a shared prepare helper; have both paths reuse SendFilesState.

The `connect_transfer_client` + `protocol_session_init/set_io_timeout/set_ssl/bind` sequence is copy-pasted 3x (`client_manifest.c:475-487`, `client_send.c:940-952`, `client_send.c:1832-1845`), and `send_dry_run_remote`/`send_files_multithreaded` duplicate the files-from/missing-args preamble. **Work:** add `client_connect_and_bind_session(config, &session)` and a shared prepare helper; have both paths reuse `SendFilesState`.
TapTap added the quality label 2026-09-23 02:10:50 +02:00
Author
Owner

Fixed in PR #329. client_connect_and_bind_session() + client_prepare_files_from() replace the three copy-pasted session-setup blocks and the duplicated files-from preamble (client_send.c/client_manifest.c); connect-failure cleanup preserved and a pre-existing missing_args OOM leak fixed. Closing as completed.

Fixed in PR #329. `client_connect_and_bind_session()` + `client_prepare_files_from()` replace the three copy-pasted session-setup blocks and the duplicated files-from preamble (client_send.c/client_manifest.c); connect-failure cleanup preserved and a pre-existing `missing_args` OOM leak fixed. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#323