fix: bugs #194 and #193 #197

Closed
TapTap wants to merge 0 commits from fix/bugs-v2 into dev
Owner

Fixes

Issue #194: TCP client only accepts IPv4 addresses, not hostnames

Problem: only parses dotted-decimal IPv4 addresses, so hostnames like fail.

Fix: Replaced with in both (transport_tcp.c) and (transport_tls.c). The new code:

  • Resolves hostnames via DNS (supports both IPv4 and IPv6)
  • Iterates over all resolved addresses, trying each until a connection succeeds
  • Creates the socket with the correct address family
  • Added getter for use by TLS code

Also changed struct from to to support both IPv4 and IPv6 addresses.

Issue #193: --progress output missing in multithreaded mode

Problem: The progress callback () was only called in single-threaded mode (). In multithreaded mode (), progress was not reported.

Fix:

  • Added , , and fields to
  • Created a that runs as a separate thread during multithreaded sends
  • The sender thread accumulates byte counts under the mutex after each chunk
  • The progress thread prints periodic status every second (matching single-threaded behavior)
  • Progress thread exits cleanly when is set

Files changed

  • src/shared/transport_tcp.h - sockaddr_storage, tcp_get_contimeout_sec
  • src/shared/transport_tcp.c - getaddrinfo, deferred socket creation
  • src/shared/transport_tls.c - getaddrinfo for TLS connections
  • src/shared/transport_ssh.c - ss_family instead of sin_family
  • src/shared/multiprocessing.h - progress fields
  • src/shared/multiprocessing.c - init/destroy progress fields
  • src/client/client_send.c - progress thread, sender progress tracking
  • tests/test_transport_tcp.c - updated for new Client init behavior
## Fixes ### Issue #194: TCP client only accepts IPv4 addresses, not hostnames **Problem:** only parses dotted-decimal IPv4 addresses, so hostnames like fail. **Fix:** Replaced with in both (transport_tcp.c) and (transport_tls.c). The new code: - Resolves hostnames via DNS (supports both IPv4 and IPv6) - Iterates over all resolved addresses, trying each until a connection succeeds - Creates the socket with the correct address family - Added getter for use by TLS code Also changed struct from to to support both IPv4 and IPv6 addresses. ### Issue #193: --progress output missing in multithreaded mode **Problem:** The progress callback () was only called in single-threaded mode (). In multithreaded mode (), progress was not reported. **Fix:** - Added , , and fields to - Created a that runs as a separate thread during multithreaded sends - The sender thread accumulates byte counts under the mutex after each chunk - The progress thread prints periodic status every second (matching single-threaded behavior) - Progress thread exits cleanly when is set ### Files changed - `src/shared/transport_tcp.h` - sockaddr_storage, tcp_get_contimeout_sec - `src/shared/transport_tcp.c` - getaddrinfo, deferred socket creation - `src/shared/transport_tls.c` - getaddrinfo for TLS connections - `src/shared/transport_ssh.c` - ss_family instead of sin_family - `src/shared/multiprocessing.h` - progress fields - `src/shared/multiprocessing.c` - init/destroy progress fields - `src/client/client_send.c` - progress thread, sender progress tracking - `tests/test_transport_tcp.c` - updated for new Client init behavior
TapTap added 1 commit 2026-07-30 18:58:29 +02:00
fix: bugs #194 (hostname resolution) and #193 (multithreaded progress)
CI / lint (pull_request) Failing after 2s
CI / build-and-test (pull_request) Has been skipped
CI / sanitizers (address) (pull_request) Has been skipped
CI / sanitizers (undefined) (pull_request) Has been skipped
CI / fuzz-build (pull_request) Has been skipped
CI / coverage (pull_request) Has been skipped
CI / valgrind (pull_request) Has been skipped
efc7e062e3
TapTap closed this pull request 2026-07-30 19:38:34 +02:00
Some checks are pending
CI / lint (pull_request) Failing after 2s
CI / build-and-test (pull_request) Has been skipped
CI / sanitizers (address) (pull_request) Has been skipped
CI / sanitizers (undefined) (pull_request) Has been skipped
CI / fuzz-build (pull_request) Has been skipped
CI / coverage (pull_request) Has been skipped
CI / valgrind (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#197