GNU bug report logs -
#22493
25.1.50; open-gnutls-stream doesn't respect :nowait, so the connections are synchronous
Previous Next
Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>
Date: Sat, 30 Jan 2016 04:02:01 UTC
Severity: normal
Found in version 25.1.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #58 received at 22493 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>> +#ifdef HAVE_GNUTLS
>> + /* The TLS connection hasn't been set up yet, so we can't write
>> + anything on the socket. */
>> + if (!NILP (p->gnutls_boot_parameters))
>> + return;
>> +#endif
>>
>> I don't think this is a good idea: you are silently returning here
>> without doing anything; the callers of send_process won't expect
>> that. I think this should signal an error instead.
>
> It's perfectly fine to say
>
> (setq proc (make-network-process ... :nowait t :tls-parameters ...))
> (process-send-string proc)
I think you're right again. I thought I had tested this, but I hadn't:
(progn
(setq proc (make-network-process :name "foo"
:buffer (get-buffer-create "*foo*")
:host "gmane.org"
:service "http"
:nowait t))
(process-send-string proc "GET / HTTP/1.0\n\n"))
With async DNS, this will fail, because the process-send-string happens
before the connection had completed. (And this isn't a TLS socket.) So
I think that (like I said on the emacs-devel threads) we may have to
change the :nowait stuff to allow a more fine-grained control.
So the rule would be if you want a fully async connection, you have to
say ":nowait 'dns" or something, and then put a sentinel on the process
to not do anything until it changes status to "connected". (This is
what url.el does already, which is why I didn't see this before...)
But in the case of TLS connections, then, er, we have to ... do
something.
Ok, here's the scenario. With a non-TLS socket, this is what's going
on:
make-network-process gives us a process in "open", and then when it
changes to "connected" (after connecting the socket) we can start
talking. (This is what url.el does.)
With a TLS socket:
make-network-process gives us a process in "open", and then when it
changes to "connected" (after connecting the socket) we can't start
talking. We have to wait until the TLS has been negotiated. So perhaps
it should only move to the "connected" state after the negotiation has
finished? Or introduce more states?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 9 years and 165 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.