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/process.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/process.c')
| -rw-r--r-- | src/process.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c index a30dd23077c..55264058340 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -715,6 +715,7 @@ make_process (Lisp_Object name) | |||
| 715 | 715 | ||
| 716 | #ifdef HAVE_GNUTLS | 716 | #ifdef HAVE_GNUTLS |
| 717 | p->gnutls_initstage = GNUTLS_STAGE_EMPTY; | 717 | p->gnutls_initstage = GNUTLS_STAGE_EMPTY; |
| 718 | p->gnutls_async_parameters = Qnil; | ||
| 718 | #endif | 719 | #endif |
| 719 | 720 | ||
| 720 | /* If name is already in use, modify it until it is unused. */ | 721 | /* If name is already in use, modify it until it is unused. */ |
| @@ -3305,6 +3306,14 @@ void connect_network_socket (Lisp_Object proc, Lisp_Object ip_addresses) | |||
| 3305 | max_process_desc = inch; | 3306 | max_process_desc = inch; |
| 3306 | 3307 | ||
| 3307 | set_network_socket_coding_system (proc); | 3308 | set_network_socket_coding_system (proc); |
| 3309 | |||
| 3310 | #ifdef HAVE_GNUTLS | ||
| 3311 | if (!NILP (p->gnutls_async_parameters) && p->is_non_blocking_client) { | ||
| 3312 | Fgnutls_boot (proc, Fcar (p->gnutls_async_parameters), | ||
| 3313 | Fcdr (p->gnutls_async_parameters)); | ||
| 3314 | p->gnutls_async_parameters = Qnil; | ||
| 3315 | } | ||
| 3316 | #endif | ||
| 3308 | } | 3317 | } |
| 3309 | 3318 | ||
| 3310 | 3319 | ||
| @@ -5817,7 +5826,9 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, | |||
| 5817 | error ("Output file descriptor of %s is closed", SDATA (p->name)); | 5826 | error ("Output file descriptor of %s is closed", SDATA (p->name)); |
| 5818 | 5827 | ||
| 5819 | #ifdef HAVE_GNUTLS | 5828 | #ifdef HAVE_GNUTLS |
| 5820 | if (p->gnutls_wait_p) | 5829 | /* The TLS connection hasn't been set up yet, so we can't write |
| 5830 | anything on the socket. */ | ||
| 5831 | if (p->gnutls_async_parameters) | ||
| 5821 | return; | 5832 | return; |
| 5822 | #endif | 5833 | #endif |
| 5823 | 5834 | ||