media_delivery: логирование отправки QUERY_RESP и провалов md_send
This commit is contained in:
1 parent
01b61a457a
commit
55da8fd146
2 files changed
+11
-4
No files matched your search
@@ -412,7 +412,12 @@ static int md_send(struct UTUN_INSTANCE* inst, uint64_t group_id, uint64_t dst_n
|
||||
e->dgram[0] = ETCP_RT_ID_MEDIA_DELIVERY;
|
||||
memcpy(e->dgram + 1, data, len); e->len = (uint16_t)(len + 1);
|
||||
int rc = etcp_route_send(inst, group_id, dst_node_id, e, 1);
|
||||
if (rc != 0) { u_free(e->dgram); queue_entry_free(e); }
|
||||
if (rc != 0) {
|
||||
struct ETCP_CONN* c = topo_group_find_conn_for_node(topo_groups_find(inst->topo_groups, group_id), dst_node_id);
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_MEDIA, "%s: md_send FAIL rc=%d dst=0x%016llx group=0x%016llx route_conn=%p",
|
||||
MD_ID, rc, (unsigned long long)dst_node_id, (unsigned long long)group_id, (void*)c);
|
||||
u_free(e->dgram); queue_entry_free(e);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -492,9 +497,10 @@ static void md_handle_query(struct media_delivery_ctx* md, uint64_t from_node,
|
||||
uint16_t nc = (uint16_t)count;
|
||||
memcpy(resp + num_pos, &nc, 2);
|
||||
|
||||
DEBUG_INFO(DEBUG_CATEGORY_MEDIA, "%s: QUERY from 0x%016llx → %d entries (super=%d)",
|
||||
MD_ID, (unsigned long long)from_node, count, md->is_supernode);
|
||||
md_send(md->inst, TOPO_GROUP_UTUN, from_node, resp, (size_t)off);
|
||||
struct ETCP_CONN* qconn = topo_group_find_conn_for_node(topo_groups_find(md->inst->topo_groups, TOPO_GROUP_UTUN), from_node);
|
||||
int snd_rc = md_send(md->inst, TOPO_GROUP_UTUN, from_node, resp, (size_t)off);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_MEDIA, "%s: QUERY from 0x%016llx → %d entries (super=%d) resp_len=%zu send_rc=%d route_conn=%p",
|
||||
MD_ID, (unsigned long long)from_node, count, md->is_supernode, (size_t)off, snd_rc, (void*)qconn);
|
||||
}
|
||||
|
||||
static void md_handle_have_block(struct media_delivery_ctx* md, uint64_t from_node,
|
||||
|
||||
@@ -274,6 +274,7 @@ static void md_dl_send_query(struct UTUN_INSTANCE* inst, struct media_download*
|
||||
|
||||
void media_download_handle_query_resp(struct UTUN_INSTANCE* inst,
|
||||
const uint8_t* data, size_t len) {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_MEDIA, "%s: QUERY_RESP received len=%zu data=%p", MDL_ID, len, (void*)data);
|
||||
if (!data || len < MEDIA_QUERY_RESP_HDR_SIZE) return;
|
||||
struct media_pkt_query_resp* r = (struct media_pkt_query_resp*)data;
|
||||
struct media_pkt_query_resp_entry* entries = (struct media_pkt_query_resp_entry*)(data + MEDIA_QUERY_RESP_HDR_SIZE);
|
||||
|
||||
Reference in new issue
Block a user