Subject: bug#22493: 25.1.50; open-gnutls-stream doesn't respect :nowait, so the connections are synchronous

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 05 Feb 2016 13:36:06 +1100

Eli Zaretskii <[email-masked]> writes:

>> So we call gnutls_boot after the connection has happened.  I originally
>> did this with a sentinel on a process, but that doesn't really work,
>> because the callers of make_network_process want their own sentinels on
>> the process.  So I call gnutls_boot from the C layer instead of from a
>> sentinel.
>> 
>> No matter how we call gnutls_boot, it will currently hang Emacs while
>> it's transferring all those certificates back and forth.
>
> That last sentence is exactly the point I was trying to make all
> along: we have to wait for this, therefore any time savings from
> running gnutls_boot in the background are minor or even non-existent.
> So I question the need for complicating the heck out of the underlying
> code, for no practical gain.

I describe the call chain, and why it's necessary to have the
gnutls_boot called from the C layer.  If you see anything wrong with the
logic I described, please let me know.

And as I've said repeatedly, gnutls_boot is only synchronous now as a
quirk of our implementation, and making it async is the next step I am
going to take.  But it's a separate issue, and will be dealt with once
the first round of changes are in.

> Why shouldn't we assume that the problem you saw in erc is the tip of
> an iceberg, and the other places are happy exceptions?  Who knows how
> many other packages are out there that are like erc?

That's why :async 'dns.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no