|
|
|
@ -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; |
|
|
|
e->dgram[0] = ETCP_RT_ID_MEDIA_DELIVERY; |
|
|
|
memcpy(e->dgram + 1, data, len); e->len = (uint16_t)(len + 1); |
|
|
|
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); |
|
|
|
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; |
|
|
|
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; |
|
|
|
uint16_t nc = (uint16_t)count; |
|
|
|
memcpy(resp + num_pos, &nc, 2); |
|
|
|
memcpy(resp + num_pos, &nc, 2); |
|
|
|
|
|
|
|
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_MEDIA, "%s: QUERY from 0x%016llx → %d entries (super=%d)", |
|
|
|
struct ETCP_CONN* qconn = topo_group_find_conn_for_node(topo_groups_find(md->inst->topo_groups, TOPO_GROUP_UTUN), from_node); |
|
|
|
MD_ID, (unsigned long long)from_node, count, md->is_supernode); |
|
|
|
int snd_rc = md_send(md->inst, TOPO_GROUP_UTUN, from_node, resp, (size_t)off); |
|
|
|
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, |
|
|
|
static void md_handle_have_block(struct media_delivery_ctx* md, uint64_t from_node, |
|
|
|
|