|
|
|
|
@ -372,7 +372,8 @@ static int session_open(struct UTUN_INSTANCE *inst, const struct stream_descript
|
|
|
|
|
struct stream_session *s = session_find(service, d->group_id, d->source_node_id); |
|
|
|
|
int created = s == NULL; |
|
|
|
|
if (s && (publisher || s->descriptor.source_epoch != d->source_epoch || (!s->source && !!s->optimizer != automatic))) { |
|
|
|
|
DEBUG_WARN(DEBUG_CATEGORY_STREAM, "stream source already owned with another publication/epoch"); return STREAM_ERR_STATE; |
|
|
|
|
DEBUG_WARN(DEBUG_CATEGORY_STREAM, "stream instance conflicts with publication/epoch/selection mode automatic=%d existing_auto=%d", |
|
|
|
|
automatic, s->optimizer != NULL); return STREAM_ERR_STATE; |
|
|
|
|
} |
|
|
|
|
struct STREAM_HANDLE *h = u_calloc(1, sizeof(*h)); |
|
|
|
|
if (!h) { DEBUG_ERROR(DEBUG_CATEGORY_STREAM, "stream handle allocation failed"); return STREAM_ERR_MEMORY; } |
|
|
|
|
@ -702,10 +703,10 @@ int stream_get_candidates(const struct STREAM_HANDLE *h, struct stream_candidate
|
|
|
|
|
if (node->node_id == inst->node_id || !stream_member_online(inst, group->group_id, node->node_id)) continue; |
|
|
|
|
struct TOPO_NODE *identity = topo_node_registry_find(inst->topo_groups, node->node_id); |
|
|
|
|
int source = node->node_id == s->descriptor.source_node_id; |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_STREAM, "stream candidate peer=%llx type=%u source=%d online=1", |
|
|
|
|
DEBUG_TRACE(DEBUG_CATEGORY_STREAM, "stream candidate peer=%llx type=%u source=%d online=1", |
|
|
|
|
(unsigned long long)node->node_id, identity ? identity->client_type : UINT8_MAX, source); |
|
|
|
|
if (identity && identity->client_type == CLIENT_TYPE_MOBILE && !source) { |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_STREAM, "stream candidate excluded peer=%llx reason=mobile_relay", |
|
|
|
|
DEBUG_TRACE(DEBUG_CATEGORY_STREAM, "stream candidate excluded peer=%llx reason=mobile_relay", |
|
|
|
|
(unsigned long long)node->node_id); continue; |
|
|
|
|
} |
|
|
|
|
struct stream_member_state state; |
|
|
|
|
@ -716,7 +717,7 @@ int stream_get_candidates(const struct STREAM_HANDLE *h, struct stream_candidate
|
|
|
|
|
} |
|
|
|
|
if (!found) { u_free(candidates); candidates = NULL; } |
|
|
|
|
*out = candidates; *count = found; |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_STREAM, "stream candidates source=%llx eligible=%zu BGP=%zu", |
|
|
|
|
DEBUG_TRACE(DEBUG_CATEGORY_STREAM, "stream candidates source=%llx eligible=%zu BGP=%zu", |
|
|
|
|
(unsigned long long)s->descriptor.source_node_id, found, capacity); |
|
|
|
|
return STREAM_OK; |
|
|
|
|
} |
|
|
|
|
|