feat: media_async + media_index modules, media_files table, tests
- media_async: thread-per-task async engine with primitives (sha256, sign, copy, uuid, file_size) - media_index: media_files DB table with register_async for indexing chunks - chat_msg: async media submission via register_async, simplified chat_msg_submit fields - voice_recorder/attachment_sender: write single file (no chunk splitting on caller side) - inputbar/messagelist: updated to new simplified submit interface - test_media_async: 4-thread stress test (200K ops / 2 sec, 0 errors) - test_media_index: 9 cases covering commit edge cases + async flow - build: Makefile.am, CMakeLists.txt, utun_sources.cmake updated
This commit is contained in:
1 parent
ce5a84da24
commit
65dbfa6813
43 files changed
+1983
-391
No files matched your search
@@ -509,6 +509,15 @@ void utun_instance_destroy(struct UTUN_INSTANCE *instance) {
|
||||
// Cleanup routing module (unbinds from etcp_router before etcp_router_destroy)
|
||||
routing_destroy(instance);
|
||||
|
||||
// Cleanup media delivery (unbinds from etcp_router before etcp_router_destroy)
|
||||
if (instance->md.initialized) {
|
||||
media_delivery_destroy(instance);
|
||||
}
|
||||
|
||||
// Cleanup media async engine
|
||||
media_async_destroy(instance->media_async);
|
||||
instance->media_async = NULL;
|
||||
|
||||
// Cleanup NAT (unbinds from etcp_router before etcp_router_destroy)
|
||||
if (instance->nat_tr.initialized) {
|
||||
nat_transport_destroy(instance);
|
||||
@@ -636,6 +645,17 @@ int utun_instance_init(struct UTUN_INSTANCE *instance) {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_NAT, "NAT transport init failed (non-fatal)");
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize media delivery
|
||||
if (media_delivery_init(instance) != 0) {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_GENERAL, "media_delivery init failed (non-fatal)");
|
||||
}
|
||||
|
||||
// Initialize media async engine
|
||||
instance->media_async = media_async_create();
|
||||
if (!instance->media_async) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_GENERAL, "media_async create failed");
|
||||
}
|
||||
|
||||
// Note: TUN socket is already registered in tun_init()
|
||||
|
||||
|
||||
Reference in new issue
Block a user