Browse Source

MT#63317 eliminate sockets shut down test

If we clear the sockets from the endpoint map during monologue shutdown,
we can guarantee that no sockets present in an endpoint map are ever
closed.

Change-Id: I4e3b6f39d51145fbfaebbe0bc412d8f001bbb053
pull/2018/head
Richard Fuchs 2 months ago
parent
commit
e121a1e289
2 changed files with 3 additions and 11 deletions
  1. +2
    -10
      daemon/call.c
  2. +1
    -1
      daemon/call_interfaces.c

+ 2
- 10
daemon/call.c View File

@ -807,16 +807,6 @@ static struct endpoint_map *__hunt_endpoint_map(struct call_media *media, unsign
if (em->logical_intf != media->logical_intf)
continue;
// any of our sockets shut down?
for (__auto_type k = em->intf_sfds.head; k; k = k->next) {
struct sfd_intf_list *il = k->data;
for (__auto_type j = il->list.head; j; j = j->next) {
stream_fd *sfd = j->data;
if (sfd->socket.fd == -1)
return NULL;
}
}
if ((em->wildcard || always_reuse) && em->num_ports >= num_ports
&& em->intf_sfds.length >= want_interfaces)
{
@ -5604,6 +5594,8 @@ void monologue_destroy(struct call_monologue *monologue) {
while ((sfd = t_queue_pop_head(&ps->sfds)))
stream_fd_release(sfd);
}
if (m->endpoint_map)
t_queue_clear_full(&m->endpoint_map->intf_sfds, free_release_sfd_intf_list);
m->endpoint_map = NULL;
}


+ 1
- 1
daemon/call_interfaces.c View File

@ -2813,7 +2813,7 @@ static void ng_stats_stream(ng_command_ctx_t *ctx, parser_arg list, const struct
dict = parser->list_add_dict(list);
if (ps->selected_sfd) {
if (ps->selected_sfd && ps->selected_sfd->socket.local.address.family) {
parser->dict_add_int(dict, "local port", ps->selected_sfd->socket.local.port);
parser->dict_add_str_dup(dict, "local address",
STR_PTR(sockaddr_print_buf(&ps->selected_sfd->socket.local.address)));


Loading…
Cancel
Save