Don't create tunnel connections to targets we're already talking to. Policy is only one connection per id.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4137 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-01-19 00:02:31 +00:00
parent 0af1bcf110
commit 77df158178

View File

@ -2311,6 +2311,12 @@ static void _tf_ssb_connection_tunnel_callback(
tf_ssb_connection_t* tf_ssb_connection_tunnel_create(tf_ssb_t* ssb, const char* portal_id, int32_t request_number, const char* target_id)
{
if (tf_ssb_connection_get(ssb, target_id))
{
/* Already have a possibly more direct connection to target. */
return NULL;
}
tf_ssb_connection_t* connection = tf_ssb_connection_get(ssb, portal_id);
JSContext* context = ssb->context;