|
|
|
|
@ -168,6 +168,10 @@ int dm_route_group(struct UTUN_INSTANCE* inst, uint64_t peer, uint64_t preferred
|
|
|
|
|
/* Router владеет entry после вызова, в том числе при ошибке. */ |
|
|
|
|
static int dm_route_send(struct dm_state* dm, uint64_t group_id, uint64_t dst, uint8_t subcmd, |
|
|
|
|
const uint8_t* body, size_t body_len) { |
|
|
|
|
if (!etcp_router_conn_get(dm->inst, group_id, dst, ETCP_RT_ID_DM)) { |
|
|
|
|
DEBUG_ERROR(DEBUG_CATEGORY_DM, "%s: router channel allocation failed peer=%llu", DM_ID, (unsigned long long)dst); |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
if (!etcp_router_send_q_has_room(dm->inst, group_id, dst, ETCP_RT_ID_DM)) { |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_DM, "%s: send deferred by backpressure peer=%llu", DM_ID, (unsigned long long)dst); |
|
|
|
|
return -1; |
|
|
|
|
|