diff options
| author | Lars Ingebrigtsen | 2016-02-01 03:26:09 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-01 03:26:09 +0100 |
| commit | 42ef3013781146c62ece536c10c50bb5a5dc1f78 (patch) | |
| tree | e58515ca7ee2275ea3f98c9b8a3d4489faf26498 /src | |
| parent | 072d5357c15587af00eeba31033ef5b83d014223 (diff) | |
| download | emacs-42ef3013781146c62ece536c10c50bb5a5dc1f78.tar.gz emacs-42ef3013781146c62ece536c10c50bb5a5dc1f78.zip | |
Always boot TLS if given parameters
* src/process.c (connect_network_socket): If we have the TLS
parameters, then boot the socket.
Diffstat (limited to 'src')
| -rw-r--r-- | src/gnutls.c | 2 | ||||
| -rw-r--r-- | src/process.c | 23 | ||||
| -rw-r--r-- | src/process.h | 2 |
3 files changed, 14 insertions, 13 deletions
diff --git a/src/gnutls.c b/src/gnutls.c index a0b6e0df68b..fb3c3c22777 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -695,7 +695,7 @@ to finish setting up the connection. */) | |||
| 695 | { | 695 | { |
| 696 | CHECK_PROCESS (proc); | 696 | CHECK_PROCESS (proc); |
| 697 | 697 | ||
| 698 | XPROCESS (proc)->gnutls_async_parameters = params; | 698 | XPROCESS (proc)->gnutls_boot_parameters = params; |
| 699 | return Qnil; | 699 | return Qnil; |
| 700 | } | 700 | } |
| 701 | 701 | ||
diff --git a/src/process.c b/src/process.c index 13f4b6aa85e..8849b20172f 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -710,7 +710,7 @@ make_process (Lisp_Object name) | |||
| 710 | 710 | ||
| 711 | #ifdef HAVE_GNUTLS | 711 | #ifdef HAVE_GNUTLS |
| 712 | p->gnutls_initstage = GNUTLS_STAGE_EMPTY; | 712 | p->gnutls_initstage = GNUTLS_STAGE_EMPTY; |
| 713 | p->gnutls_async_parameters = Qnil; | 713 | p->gnutls_boot_parameters = Qnil; |
| 714 | #endif | 714 | #endif |
| 715 | 715 | ||
| 716 | /* If name is already in use, modify it until it is unused. */ | 716 | /* If name is already in use, modify it until it is unused. */ |
| @@ -3304,16 +3304,17 @@ void connect_network_socket (Lisp_Object proc, Lisp_Object ip_addresses) | |||
| 3304 | 3304 | ||
| 3305 | #ifdef HAVE_GNUTLS | 3305 | #ifdef HAVE_GNUTLS |
| 3306 | /* Continue the asynchronous connection. */ | 3306 | /* Continue the asynchronous connection. */ |
| 3307 | if (!NILP (p->gnutls_async_parameters) && p->is_non_blocking_client) { | 3307 | if (!NILP (p->gnutls_boot_parameters)) |
| 3308 | Lisp_Object boot, params = p->gnutls_async_parameters; | 3308 | { |
| 3309 | Lisp_Object boot, params = p->gnutls_boot_parameters; | ||
| 3309 | 3310 | ||
| 3310 | p->gnutls_async_parameters = Qnil; | 3311 | p->gnutls_boot_parameters = Qnil; |
| 3311 | boot = Fgnutls_boot (proc, XCAR (params), XCDR (params)); | 3312 | boot = Fgnutls_boot (proc, XCAR (params), XCDR (params)); |
| 3312 | if (NILP (boot) || STRINGP (boot)) { | 3313 | if (NILP (boot) || STRINGP (boot)) { |
| 3313 | pset_status (p, Qfailed); | 3314 | pset_status (p, Qfailed); |
| 3314 | deactivate_process (proc); | 3315 | deactivate_process (proc); |
| 3316 | } | ||
| 3315 | } | 3317 | } |
| 3316 | } | ||
| 3317 | #endif | 3318 | #endif |
| 3318 | 3319 | ||
| 3319 | } | 3320 | } |
| @@ -3831,7 +3832,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3831 | #ifdef HAVE_GNUTLS | 3832 | #ifdef HAVE_GNUTLS |
| 3832 | tem = Fplist_get (contact, QCtls_parameters); | 3833 | tem = Fplist_get (contact, QCtls_parameters); |
| 3833 | CHECK_LIST (tem); | 3834 | CHECK_LIST (tem); |
| 3834 | p->gnutls_async_parameters = tem; | 3835 | p->gnutls_boot_parameters = tem; |
| 3835 | #endif | 3836 | #endif |
| 3836 | 3837 | ||
| 3837 | unbind_to (count, Qnil); | 3838 | unbind_to (count, Qnil); |
| @@ -5891,7 +5892,7 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, | |||
| 5891 | #ifdef HAVE_GNUTLS | 5892 | #ifdef HAVE_GNUTLS |
| 5892 | /* The TLS connection hasn't been set up yet, so we can't write | 5893 | /* The TLS connection hasn't been set up yet, so we can't write |
| 5893 | anything on the socket. */ | 5894 | anything on the socket. */ |
| 5894 | if (p->gnutls_async_parameters) | 5895 | if (p->gnutls_boot_parameters) |
| 5895 | return; | 5896 | return; |
| 5896 | #endif | 5897 | #endif |
| 5897 | 5898 | ||
diff --git a/src/process.h b/src/process.h index 828330ba9df..c7531576915 100644 --- a/src/process.h +++ b/src/process.h | |||
| @@ -106,7 +106,7 @@ struct Lisp_Process | |||
| 106 | 106 | ||
| 107 | #ifdef HAVE_GNUTLS | 107 | #ifdef HAVE_GNUTLS |
| 108 | Lisp_Object gnutls_cred_type; | 108 | Lisp_Object gnutls_cred_type; |
| 109 | Lisp_Object gnutls_async_parameters; | 109 | Lisp_Object gnutls_boot_parameters; |
| 110 | #endif | 110 | #endif |
| 111 | 111 | ||
| 112 | /* Pipe process attached to the standard error of this process. */ | 112 | /* Pipe process attached to the standard error of this process. */ |