debug: вычистить логи из категории DEBUG_CATEGORY_DEBUG (удалить дампы, перекатегоризовать ERROR-проверки в ETCP)
This commit is contained in:
1 parent
6777c7173d
commit
449a193cb5
6 files changed
+3
-21
No files matched your search
@@ -410,9 +410,6 @@ static int md_send(struct UTUN_INSTANCE* inst, uint64_t group_id, uint64_t dst_n
|
||||
if (!inst || !data || len == 0) return -1;
|
||||
struct TOPO_GROUP* grp = inst->topo_groups ? topo_groups_find(inst->topo_groups, group_id) : NULL;
|
||||
struct ETCP_CONN* conn = grp ? topo_group_find_conn_for_node(grp, dst_node_id) : NULL;
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "%s: send dst=0x%016llx group=0x%016llx subcmd=0x%02x len=%zu conn=%p",
|
||||
MD_ID, (unsigned long long)dst_node_id, (unsigned long long)group_id,
|
||||
(unsigned)data[0], len, (void*)conn);
|
||||
if (!conn)
|
||||
DEBUG_WARN(DEBUG_CATEGORY_MEDIA, "%s: no conn to 0x%016llx group=0x%016llx subcmd=0x%02x — packet queued, no route",
|
||||
MD_ID, (unsigned long long)dst_node_id, (unsigned long long)group_id, (unsigned)data[0]);
|
||||
|
||||
@@ -89,9 +89,6 @@ static int md_dl_send(struct UTUN_INSTANCE* inst, uint64_t group_id, uint64_t ds
|
||||
if (!inst || !inst->topo_groups || !inst->connections) { DEBUG_WARN(DEBUG_CATEGORY_GENERAL, "%s: md_dl_send: no routing (inst=%p topo=%p conn=%p)", MDL_ID, (void*)inst, (void*)(inst ? inst->topo_groups : NULL), (void*)(inst ? inst->connections : NULL)); return -1; }
|
||||
{ struct TOPO_GROUP* grp = topo_groups_find(inst->topo_groups, group_id);
|
||||
struct ETCP_CONN* gc = grp ? topo_group_find_conn_for_node(grp, dst) : NULL;
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "%s: send dst=0x%016llx group=0x%016llx subcmd=0x%02x len=%zu grp=%p conn=%p",
|
||||
MDL_ID, (unsigned long long)dst, (unsigned long long)group_id,
|
||||
(unsigned)data[0], len, (void*)grp, (void*)gc);
|
||||
if (!gc)
|
||||
DEBUG_WARN(DEBUG_CATEGORY_GENERAL, "%s: no conn to 0x%016llx subcmd=0x%02x — packet queued, no route",
|
||||
MDL_ID, (unsigned long long)dst, (unsigned)data[0]);
|
||||
|
||||
@@ -935,10 +935,6 @@ static void router_deliver(struct ETCP_ROUTER_CONN* rconn, struct ETCP_CONN* con
|
||||
DEBUG_TRACE(DEBUG_CATEGORY_ETCPROUTE, "router_deliver: svc_id=%u len=%zu flags=%02x src=%016llx dst=%016llx",
|
||||
rconn->svc_id, payload_len, rx_flags, (unsigned long long)rconn->remote_node_id,
|
||||
(unsigned long long)inst->node_id);
|
||||
if (rconn->svc_id == ETCP_RT_ID_MEDIA_DELIVERY) {
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "router_deliver: MEDIA pkt len=%zu subcmd=0x%02x from %016llx",
|
||||
payload_len, payload_len > 0 ? payload[0] : 0, (unsigned long long)rconn->remote_node_id);
|
||||
}
|
||||
rconn->c_pkts_rcvd++;
|
||||
cb(conn, svc_entry);
|
||||
}
|
||||
|
||||
@@ -67,9 +67,6 @@ int sock_collect_views(struct UTUN_INSTANCE* inst, struct sock_view* out, int ma
|
||||
if (!v->public_ip4 && local_public) v->public_ip4 = v->local_ip4;
|
||||
v->role = local_public ? SOCK_ROLE_DIRECT : (v->is_eim ? SOCK_ROLE_DIRECT : SOCK_ROLE_NAT);
|
||||
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "sock_view[%d] sock=%s type=%d nat=%d role=%d inet=%d priv=%d eim=%d tcp=%d local=%08x public=%08x",
|
||||
n - 1, s->name, s->type, s->nat_type, v->role, v->has_inet, v->has_priv, v->is_eim, v->is_tcp,
|
||||
v->local_ip4, v->public_ip4);
|
||||
s = s->next;
|
||||
}
|
||||
return n;
|
||||
|
||||
@@ -93,8 +93,6 @@ static void socks_etcp_read_callback(socket_t sock, void* arg) {
|
||||
// pubkey пира, создать TCP-линк и поднять его (ready).
|
||||
void tcp_server_on_link(struct stcp_link *link, struct ETCP_SOCKET *tcp_sock) {
|
||||
struct UTUN_INSTANCE *inst = tcp_sock->instance;
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "tcp_server_on_link: link=%p tcp_sock=%p inst=%p inst->ua=%p",
|
||||
(void*)link, (void*)tcp_sock, (void*)inst, (void*)(inst ? inst->ua : NULL));
|
||||
const uint8_t *pubkey = stcp_link_get_peer_pubkey(link);
|
||||
if (!pubkey) { DEBUG_ERROR(DEBUG_CATEGORY_ETCP, "tcp_server_on_link: no peer pubkey"); return; }
|
||||
uint64_t node_id = sc_derive_node_id_from_pubkey(pubkey);
|
||||
@@ -1170,15 +1168,12 @@ void etcp_link_close(struct ETCP_LINK* link) {
|
||||
void etcp_link_enter_ready_tcp(struct ETCP_LINK *link) {
|
||||
if (!link || !link->etcp) return;
|
||||
struct ETCP_CONN *etcp = link->etcp;
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "enter_ready_tcp: link=%p etcp=%p inst=%p ua=%p conn_state=%d tcp_link=%p",
|
||||
(void*)link, (void*)etcp, (void*)etcp->instance, (void*)(etcp->instance ? etcp->instance->ua : NULL),
|
||||
etcp->state, (void*)link->tcp_link);
|
||||
|
||||
/* reinit только при смене reset_id пира — синхронизация через etcp_conn_apply_peer_reset_id */
|
||||
if (link->tcp_link) {
|
||||
uint64_t peer_rid = stcp_link_get_peer_reset_id(link->tcp_link);
|
||||
etcp_conn_apply_peer_reset_id(etcp, peer_rid);
|
||||
if (etcp->state == 2) { DEBUG_ERROR(DEBUG_CATEGORY_DEBUG, "enter_ready_tcp: conn DELETED after apply_reset, link=%p", (void*)link); return; }
|
||||
if (etcp->state == 2) { DEBUG_ERROR(DEBUG_CATEGORY_ETCP, "enter_ready_tcp: conn DELETED after apply_reset, link=%p", (void*)link); return; }
|
||||
|
||||
link->peer_device_type = stcp_link_get_peer_device_type(link->tcp_link);
|
||||
{ uint16_t peer_ka = stcp_link_get_peer_keepalive_interval(link->tcp_link);
|
||||
@@ -1194,7 +1189,7 @@ void etcp_link_enter_ready_tcp(struct ETCP_LINK *link) {
|
||||
etcp->tcp_link_count++;
|
||||
if (link->tcp_link) { const uint8_t* ed = stcp_link_get_peer_ed25519_pubkey(link->tcp_link); if (ed) memcpy(etcp->peer_ed25519_pubkey, ed, SC_PUBKEY_SIZE); }
|
||||
if (etcp->initialized == 0) etcp_conn_ready(etcp);
|
||||
if (etcp->state == 2) { DEBUG_ERROR(DEBUG_CATEGORY_DEBUG, "enter_ready_tcp: conn DELETED after conn_ready, link=%p", (void*)link); return; }
|
||||
if (etcp->state == 2) { DEBUG_ERROR(DEBUG_CATEGORY_ETCP, "enter_ready_tcp: conn DELETED after conn_ready, link=%p", (void*)link); return; }
|
||||
etcp_link_send_keepalive(link);
|
||||
start_keepalive_timer(link);
|
||||
loadbalancer_link_ready(link);
|
||||
|
||||
@@ -70,7 +70,7 @@ static int etcp_all_links_down(struct ETCP_CONN* etcp) {
|
||||
|
||||
void start_keepalive_timer(struct ETCP_LINK* link) {
|
||||
if (!link || !link->etcp || !link->etcp->instance || !link->etcp->instance->ua) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_DEBUG, "start_keepalive_timer: BAD link=%p etcp=%p inst=%p ua=%p",
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_ETCP, "start_keepalive_timer: BAD link=%p etcp=%p inst=%p ua=%p",
|
||||
(void*)link, (void*)(link ? link->etcp : NULL),
|
||||
(void*)(link && link->etcp ? link->etcp->instance : NULL),
|
||||
(void*)(link && link->etcp && link->etcp->instance ? link->etcp->instance->ua : NULL));
|
||||
|
||||
Reference in new issue
Block a user