[QUALITY][low] Merge leftovers: dead server.c receive_files(), dead utils.c mkdir_r(), misleading return comments, =-form/missing-arg CLI diagnostics #260

Closed
opened 2026-09-05 12:08:21 +02:00 by TapTap · 1 comment
Owner

Found by code-quality scan of dev (9f8b588).

  1. src/server/server.c:104-236 receive_files() - dead 132-line duplicate of receiver.c receiver_process() (no prototype, zero callers). Delete or re-route. Also handler() cleanup paths skip protocol_session_unbind() (server.c:266-271,278-285,322-339).
  2. src/shared/utils.c:86-123 mkdir_r() - exported dead code superseded by file.c secure primitives. Delete (and utils.h:8 declaration).
  3. src/client/client_cli.c:60-61,73-74,105-106 misleading "Returns true/false" comments on functions returning 0/-1.
  4. src/client/client_cli.c:453-471 find_table_option_with_equals only accepts =-form for --compress-choice/--compress-level; other OPT_STRING/OPT_ULL options reject =-form as "Unknown option" (e.g. --suffix=.bak, --max-size=2G). Make all table value-options accept --opt=value.
  5. ~14 options (client_cli.c:670-829) misreport missing argument as "Unknown option"; unify with the --max-alloc/--debug "missing argument for X" pattern.

Add/extend unit tests for CLI diagnostics and =form handling.

Found by code-quality scan of `dev` (9f8b588). 1. src/server/server.c:104-236 `receive_files()` - dead 132-line duplicate of receiver.c `receiver_process()` (no prototype, zero callers). Delete or re-route. Also `handler()` cleanup paths skip `protocol_session_unbind()` (server.c:266-271,278-285,322-339). 2. src/shared/utils.c:86-123 `mkdir_r()` - exported dead code superseded by file.c secure primitives. Delete (and utils.h:8 declaration). 3. src/client/client_cli.c:60-61,73-74,105-106 misleading "Returns true/false" comments on functions returning 0/-1. 4. src/client/client_cli.c:453-471 `find_table_option_with_equals` only accepts `=`-form for --compress-choice/--compress-level; other OPT_STRING/OPT_ULL options reject `=`-form as "Unknown option" (e.g. `--suffix=.bak`, `--max-size=2G`). Make all table value-options accept `--opt=value`. 5. ~14 options (client_cli.c:670-829) misreport missing argument as "Unknown option"; unify with the --max-alloc/--debug "missing argument for X" pattern. Add/extend unit tests for CLI diagnostics and =form handling.
Author
Owner

Resolved on dev (HEAD f7c6c91).

Fixed on dev via fix/quality-cleanup (beb681c, 1d61a14): deleted dead server.c receive_files() and utils.c mkdir_r(); fixed misleading return comments; =form now accepted for all table value options; missing-arg diagnostics unified. CLI tests added.

CI run #461: all jobs green (lint, build-and-test, sanitizers address+undefined, fuzz-build, coverage, valgrind). Unit 25/25, integration 83 passed / 10 skipped / 1 xpassed. Closing.

**Resolved on `dev`** (HEAD f7c6c91). Fixed on dev via fix/quality-cleanup (beb681c, 1d61a14): deleted dead server.c receive_files() and utils.c mkdir_r(); fixed misleading return comments; =form now accepted for all table value options; missing-arg diagnostics unified. CLI tests added. CI run #461: all jobs green (lint, build-and-test, sanitizers address+undefined, fuzz-build, coverage, valgrind). Unit 25/25, integration 83 passed / 10 skipped / 1 xpassed. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#260