Squashed 'external/toxcore/c-toxcore/' changes from 59d3f6674..76bc4c496

76bc4c496 refactor: TCP connection netprof objects are now owned by Messenger

git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: 76bc4c496d407cbbd11f0a0d9d3eebfbf64ccd2c
This commit is contained in:
Green Sky
2025-03-19 11:19:59 +01:00
parent 72325822b8
commit 119bd4fb1d
15 changed files with 96 additions and 65 deletions

View File

@ -7418,7 +7418,7 @@ static bool init_gc_tcp_connection(const GC_Session *c, GC_Chat *chat)
const Messenger *m = c->messenger;
chat->tcp_conn = new_tcp_connections(chat->log, chat->mem, chat->rng, m->ns, chat->mono_time, chat->self_secret_key.enc,
&m->options.proxy_info);
&m->options.proxy_info, c->tcp_np);
if (chat->tcp_conn == nullptr) {
return false;
@ -8274,6 +8274,7 @@ GC_Session *new_dht_groupchats(Messenger *m)
c->messenger = m;
c->announces_list = m->group_announce;
c->tcp_np = m->tcp_np;
networking_registerhandler(m->net, NET_PACKET_GC_LOSSLESS, &handle_gc_udp_packet, m);
networking_registerhandler(m->net, NET_PACKET_GC_LOSSY, &handle_gc_udp_packet, m);