fix: address PR #200 review issues
CI / lint (pull_request) Successful in 22s
CI / sanitizers (address) (pull_request) Successful in 37s
CI / sanitizers (undefined) (pull_request) Successful in 36s
CI / fuzz-build (pull_request) Successful in 13s
CI / coverage (pull_request) Successful in 31s
CI / build-and-test (pull_request) Successful in 1m15s
CI / valgrind (pull_request) Successful in 33s

- 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:
2026-08-02 09:20:10 +02:00
parent 1064ae6c19
commit 05a74770ca
16 changed files with 344 additions and 68 deletions
+19 -3
View File
@@ -135,11 +135,27 @@ void handler(int file_descriptor) {
return;
}
thrd_t receiver, writer;
if (thrd_create(&receiver, receive_thread, context) != thrd_success ||
thrd_create(&writer, write_thread, context) != thrd_success) {
bool receiver_created = false;
bool writer_created = false;
receiver_created = (thrd_create(&receiver, receive_thread, context) == thrd_success);
if (receiver_created)
writer_created = (thrd_create(&writer, write_thread, context) == thrd_success);
if (!receiver_created || !writer_created) {
perror("Error creating Threads");
if (receiver_created) {
mtx_lock(&context->mutex);
context->cancelled = true;
cnd_broadcast(&context->condition_not_full);
cnd_broadcast(&context->condition_not_empty);
mtx_unlock(&context->mutex);
close(file_descriptor);
thrd_join(receiver, NULL);
} else {
close(file_descriptor);
}
if (writer_created)
thrd_join(writer, NULL);
pipeline_context_receiver_destroy(context);
close(file_descriptor);
return;
}
thrd_join(receiver, NULL);