fix: address PR #200 review issues
CI / lint (pull_request) Failing after 22s
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
CI / lint (pull_request) Failing after 22s
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
- Restore PROTOCOL_VERSION to a forward-compatible 2.1.0 and document wire format - Add NULL guard to config_delete - Add pipeline cancellation flag and cancellation-aware queue helper - Join running threads before destroying pipeline contexts on creation failure - Fix NULL dereference and memory leaks in manifest/chunk handling - Fix TLS/TCP socket fd leak on connect error paths - Add compression-level range validation (1-22) - Close previous log file before opening a new one - Use getline for unbounded pattern-file lines - Fix thread-unsafe localtime() and add log level bounds check - Fix file_load_data to clean up data on read size mismatch - Add hard ceiling to decompression buffer growth - Fix mkdir_r bounds check and restore glob comments - Add send_str NULL guard and mutex-protect bandwidth limiter - Update AGENTS.md for per-thread io_ssl contract
This commit is contained in:
@@ -206,7 +206,7 @@ tea pr close <number> --repo TapTap/FastSync
|
||||
|
||||
## Common pitfalls
|
||||
|
||||
- **`__thread` on shared SSL context**: io_ssl must NOT be thread-local — worker threads inherit the SSL context from the main thread. Use regular `static SSL* io_ssl`.
|
||||
- **Per-thread SSL context**: `io_ssl` is stored per-thread (`static __thread SSL* io_ssl`). Each thread that performs protocol I/O must call `io_set_ssl()` to install its own SSL object before using `send_*` / `receive_*` primitives. The main thread's SSL context is not automatically inherited by worker threads.
|
||||
- **SSL WANT_READ/WANT_WRITE retry**: Always retry on `SSL_ERROR_WANT_READ` and `SSL_ERROR_WANT_WRITE` in `send_n_data`/`receive_n_data`. Removing these breaks TLS multithreaded transfers.
|
||||
- **clang-format version**: The CI image uses clang-format 18. Always format inside the CI Docker container for exact match.
|
||||
- **Merge order matters**: Merge the most comprehensive branch first, then smaller ones, to minimize conflicts when creating a combined branch.
|
||||
|
||||
Reference in New Issue
Block a user