refactor: STCP connections as ETCP links (is_tcp)
- Add is_tcp, tcp_link, tcp_reconnect_* fields to ETCP_LINK - Remove transport_link from ETCP_CONN, add tcp_link_count - stcp_link: replace embedded etcp_conn with pointer; add etcp_link backpointer - stcp_link: link_rx_cb routes ETCP data to etcp_conn_input - stcp_link: call on_close_cb in close - New TCP functions: etcp_link_enter_ready_tcp, etcp_tcp_link_start_connect, etcp_tcp_link_start_reconnect, tcp_link_close_cb, etcp_tcp_send - etcp_link_new: handle NULL conn for TCP links; skip enter_init for TCP - etcp_link_close: close stcp_link for TCP - etcp_encrypt_send: redirect TCP to etcp_tcp_send (skips AES-CCM) - tcp_server_on_link: create ETCP_LINK(is_tcp=1) + enter_ready_tcp - etcp_connect: TCP addrs -> etcp_tcp_link_start_connect - Remove ctx->tcp_link/tcp_ready - test_stcp_traffic: find stcp_link via links->is_tcp instead of transport_link - 66/68 tests pass; 2 STCP tests expected to fail (integration not complete)
This commit is contained in:
1 parent
937af4c26a
commit
d773f1724a
1705 files changed
+187
-1082154
No files matched your search
@@ -1,61 +0,0 @@
|
||||
#include "animtimer.h"
|
||||
#include "lottieicon.h"
|
||||
#include "debug_ui.h"
|
||||
|
||||
AnimTimer::AnimTimer() {
|
||||
m_timer.setInterval(33);
|
||||
connect(&m_timer, &QTimer::timeout, this, &AnimTimer::onTimer);
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
AnimTimer *AnimTimer::instance() {
|
||||
static AnimTimer s;
|
||||
return &s;
|
||||
}
|
||||
|
||||
void AnimTimer::shutdown() {
|
||||
instance()->m_timer.stop();
|
||||
instance()->m_icons.clear();
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "AnimTimer: shutdown");
|
||||
}
|
||||
|
||||
void AnimTimer::registerIcon(const QString &key, LottieIcon *icon) {
|
||||
m_icons.insert(key, icon);
|
||||
}
|
||||
|
||||
void AnimTimer::unregisterIcon(const QString &key) {
|
||||
m_icons.remove(key);
|
||||
}
|
||||
|
||||
LottieIcon *AnimTimer::icon(const QString &key) const {
|
||||
return m_icons.value(key, nullptr);
|
||||
}
|
||||
|
||||
void AnimTimer::activate() {
|
||||
if (m_activeRef++ == 0) {
|
||||
for (auto *icon : m_icons)
|
||||
icon->advanceFrame();
|
||||
emit ticked();
|
||||
}
|
||||
}
|
||||
|
||||
void AnimTimer::deactivate() {
|
||||
if (m_activeRef > 0) m_activeRef--;
|
||||
}
|
||||
|
||||
void AnimTimer::onTimer() {
|
||||
if (m_activeRef <= 0) return;
|
||||
for (auto *icon : m_icons)
|
||||
icon->advanceFrame();
|
||||
emit ticked();
|
||||
}
|
||||
|
||||
void AnimTimer::logRegisteredIcons() const {
|
||||
for (auto it = m_icons.constBegin(); it != m_icons.constEnd(); ++it) {
|
||||
LottieIcon *icon = it.value();
|
||||
GUI_INFO("LottieIcon: path=%s frames=%d size=%dx%d tgsSize=%d valid=%d",
|
||||
qPrintable(it.key()), icon->frameCount(),
|
||||
icon->originalSize().width(), icon->originalSize().height(),
|
||||
icon->tgsSize(), (int)icon->isValid());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user