dm: прямой обмен сообщениями (DM) + soundtouch + архитектура звонков

- src/dm/: dm_core/dm_crypto/dm_mailbox — прямой обмен сообщениями (DM)
- lib/soundtouch-master/: vendored SoundTouch (изменение темпа/высоты аудио)
- doc/dm_arch.md, doc/chat_call_arch.md: архитектура DM и звонков
- tests: test_dm.c, test_dm_e2e.c
- chat: рефакторинг chat_* модулей, member_sync, invite_build
- chatgui/chatgui-android: синхронизация с новым API чата
- lib/u_async, debug_config, utun_instance: сопутствующие изменения
This commit is contained in:
evgeny committed 2026-09-15 21:09:17 +03:00
1 parent 761f64cf76
commit 73fe99b33f
123 files changed
+14095 -1270

No files matched your search

+11
View File
@@ -518,6 +518,10 @@ static void get_next_timeout(struct UASYNC* ua, struct timeval* tv) {
uint64_t now_ms = timeval_to_ms(&now_tv);
if (entry.expiration <= now_ms) {
struct timeout_node* rn = (struct timeout_node*)entry.data;
DEBUG_DEBUG(DEBUG_CATEGORY_TIMERS, "get_next_timeout: root timer '%s' already expired (exp=%llu now=%llu delta=%lldms size=%zu)",
rn ? rn->name : "?", (unsigned long long)entry.expiration,
(unsigned long long)now_ms, (long long)(now_ms - entry.expiration), ua->timeout_heap->size);
tv->tv_sec = 0;
tv->tv_usec = 0;
return;
@@ -1050,6 +1054,13 @@ void uasync_poll(struct UASYNC* ua, int timeout_tb) {
}
}
/* Если ближайший таймер уже истёк (get_next_timeout вернул 0), но heap не пуст —
* опрашиваем немедленно (timeout_ms=0), иначе epoll_wait(-1) заблокирует навсегда,
* а process_timeouts (вызывается только после epoll_wait) никогда не запустится. */
if (timeout_ms == -1 && ua->timeout_heap->size > 0) {
timeout_ms = 0;
}
DEBUG_DEBUG(DEBUG_CATEGORY_SYS, "poll(%d sockets, %zu timers, timeout=%dms)",
socket_count, ua->timeout_heap->size, timeout_ms);