Skip to content

Commit

Permalink
core: main - set default send tcp sockets to tls if no tcp is available
Browse files Browse the repository at this point in the history
(cherry picked from commit 8a678c2)
  • Loading branch information
miconda committed Sep 24, 2019
1 parent dcdfc26 commit 7c3cc32
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main.c
Expand Up @@ -1563,12 +1563,20 @@ int main_loop(void)
/* get first ipv4/ipv6 socket*/
if ((si->address.af==AF_INET)&&
((sendipv4_tls==0) ||
(sendipv4_tls->flags&(SI_IS_LO|SI_IS_MCAST))))
(sendipv4_tls->flags&(SI_IS_LO|SI_IS_MCAST)))) {
sendipv4_tls=si;
if(sendipv4_tcp==0) {
sendipv4_tcp=si;
}
}
if( ((sendipv6_tls==0) ||
(sendipv6_tls->flags&(SI_IS_LO|SI_IS_MCAST))) &&
(si->address.af==AF_INET6))
(si->address.af==AF_INET6)) {
sendipv6_tls=si;
if(sendipv6_tcp==0) {
sendipv6_tcp=si;
}
}
}
}
#endif /* USE_TLS */
Expand Down

0 comments on commit 7c3cc32

Please sign in to comment.