diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2016-01-31 01:34:45 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2016-01-31 01:34:45 +0100 |
commit | 0f47153b97ae31b82366a857ec2f937c1580b637 (patch) | |
tree | a5e3bbc672c6d3f0ddcf11ae8c648eafa1a847e8 /src/gnutls.c | |
parent | cc45809152ab596deb2115369116e573d43c219a (diff) |
Implement asynchronous GnuTLS connections
* doc/misc/emacs-gnutls.texi (Help For Developers): Mention
the nowait parameter.
* lisp/net/gnutls.el (open-gnutls-stream): Allow asynchronous
connections with the new nowait parameter.
* lisp/net/network-stream.el (network-stream-open-tls): Pass
on :nowait to open-gnutls-stream.
* lisp/url/url-http.el (url-http): Don't overwrite the
sentinel created by open-gnutls-stream.
* src/gnutls.c (Fgnutls_mark_process): New function.
* src/process.c (send_process): Don't write to GnuTLS sockets that
haven't been initialised yed.
* src/process.h: New slot gnutls_wait_p.
Diffstat (limited to 'src/gnutls.c')
-rw-r--r-- | src/gnutls.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gnutls.c b/src/gnutls.c index 01a5983d3b..d11b11c7c5 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -686,6 +686,16 @@ emacs_gnutls_deinit (Lisp_Object proc) return Qt; } +DEFUN ("gnutls-mark-process", Fgnutls_mark_process, Sgnutls_mark_process, 2, 2, 0, + doc: /* Mark this process as being a pre-init GnuTLS process. */) + (Lisp_Object proc, Lisp_Object state) +{ + CHECK_PROCESS (proc); + + XPROCESS (proc)->gnutls_wait_p = !NILP (state); + return Qnil; +} + DEFUN ("gnutls-get-initstage", Fgnutls_get_initstage, Sgnutls_get_initstage, 1, 1, 0, doc: /* Return the GnuTLS init stage of process PROC. See also `gnutls-boot'. */) @@ -1693,6 +1703,7 @@ syms_of_gnutls (void) make_number (GNUTLS_E_APPLICATION_ERROR_MIN)); defsubr (&Sgnutls_get_initstage); + defsubr (&Sgnutls_mark_process); defsubr (&Sgnutls_errorp); defsubr (&Sgnutls_error_fatalp); defsubr (&Sgnutls_error_string); |