diff options
| author | Lars Ingebrigtsen | 2016-01-31 02:32:21 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-01-31 02:32:21 +0100 |
| commit | cecf6c9ac58ecd9ea251241a6b8a18e0e01dbc2a (patch) | |
| tree | 3aeb6ebaa3f1418f48a99502107f1dae2703dd11 /src/gnutls.c | |
| parent | 1f71df7aacf15dbf242c74a4b7a7ac8fe0984a3c (diff) | |
| download | emacs-cecf6c9ac58ecd9ea251241a6b8a18e0e01dbc2a.tar.gz emacs-cecf6c9ac58ecd9ea251241a6b8a18e0e01dbc2a.zip | |
Rework the mechanisms for async GnuTLS connections
* lisp/net/gnutls.el (open-gnutls-stream): Compute the
gnutls-boot parameters and pass them to the process object.
(gnutls-negotiate): New parameter :return-keywords that won't
connect to anything, just compute the keywords.
* lisp/url/url-http.el (url-http): Revert async TLS sentinel
hack, which is no longer necessary.
* src/gnutls.c (Fgnutls_asynchronous_parameters): Rename from
gnutls-mark-process.
* src/process.c (connect_network_socket): If we're connecting to
an asynchronous TLS socket, complete the GnuTLS boot sequence here.
* src/process.h: New parameter gnutls_async_parameters.
Diffstat (limited to 'src/gnutls.c')
| -rw-r--r-- | src/gnutls.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gnutls.c b/src/gnutls.c index d11b11c7c54..06459fb3ccd 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -686,13 +686,16 @@ emacs_gnutls_deinit (Lisp_Object proc) | |||
| 686 | return Qt; | 686 | return Qt; |
| 687 | } | 687 | } |
| 688 | 688 | ||
| 689 | DEFUN ("gnutls-mark-process", Fgnutls_mark_process, Sgnutls_mark_process, 2, 2, 0, | 689 | DEFUN ("gnutls-asynchronous-parameters", Fgnutls_asynchronous_parameters, |
| 690 | doc: /* Mark this process as being a pre-init GnuTLS process. */) | 690 | Sgnutls_asynchronous_parameters, 2, 2, 0, |
| 691 | (Lisp_Object proc, Lisp_Object state) | 691 | doc: /* Mark this process as being a pre-init GnuTLS process. |
| 692 | The second parameter is the list of parameters to feed to gnutls-boot | ||
| 693 | to finish setting up the connection. */) | ||
| 694 | (Lisp_Object proc, Lisp_Object params) | ||
| 692 | { | 695 | { |
| 693 | CHECK_PROCESS (proc); | 696 | CHECK_PROCESS (proc); |
| 694 | 697 | ||
| 695 | XPROCESS (proc)->gnutls_wait_p = !NILP (state); | 698 | XPROCESS (proc)->gnutls_async_parameters = params; |
| 696 | return Qnil; | 699 | return Qnil; |
| 697 | } | 700 | } |
| 698 | 701 | ||
| @@ -1703,7 +1706,7 @@ syms_of_gnutls (void) | |||
| 1703 | make_number (GNUTLS_E_APPLICATION_ERROR_MIN)); | 1706 | make_number (GNUTLS_E_APPLICATION_ERROR_MIN)); |
| 1704 | 1707 | ||
| 1705 | defsubr (&Sgnutls_get_initstage); | 1708 | defsubr (&Sgnutls_get_initstage); |
| 1706 | defsubr (&Sgnutls_mark_process); | 1709 | defsubr (&Sgnutls_asynchronous_parameters); |
| 1707 | defsubr (&Sgnutls_errorp); | 1710 | defsubr (&Sgnutls_errorp); |
| 1708 | defsubr (&Sgnutls_error_fatalp); | 1711 | defsubr (&Sgnutls_error_fatalp); |
| 1709 | defsubr (&Sgnutls_error_string); | 1712 | defsubr (&Sgnutls_error_string); |