Subject: bug#49449: 28: TLS connection never gets to "open" stage

From: Eli Zaretskii <[email-masked]>
Date: Sun, 11 Jul 2021 09:49:03 +0300

> From: Mattias Engdegård <[email-masked]>
> Date: Sat, 10 Jul 2021 21:44:21 +0200
> Cc: [email-masked], [email-masked]
> 
> 10 juli 2021 kl. 21.31 skrev Eli Zaretskii <[email-masked]>:
> 
> > That's my question: why cannot the sentinel be called in this case?
> > what prevents it from being called?
> 
> In the failing case, wait_reading_process_output calls gnutls_try_handshake early on, which succeeds and this leads to finish_after_tls_connection being called. Here, we have the condition
> 
>   else if ((fd_callback_info[p->outfd].flags & NON_BLOCKING_CONNECT_FD) == 0)
> 
> which gates further progress, but this condition is false because the flags have NON_BLOCKING_CONNECT_FD set.

Thanks.  A potentially silly question: why not reset the
NON_BLOCKING_CONNECT_FD bit before we call finish_after_tls_connection
from that place?