aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2018-06-24 21:21:56 +0200
committerLars Ingebrigtsen2018-06-24 21:21:56 +0200
commitfea8c7d181babe6de7daedfef07b291f8dda2322 (patch)
tree00aa225bb2255d402b5ecd2423443929e643dcd5
parentc8745d95cffc348da7ae1e7f6a6c07ec2f4b2f3f (diff)
downloademacs-fea8c7d181babe6de7daedfef07b291f8dda2322.tar.gz
emacs-fea8c7d181babe6de7daedfef07b291f8dda2322.zip
Tweak previous gnutls change for efficiency
* src/gnutls.c (Fgnutls_peer_status): Minor optimisation to avoid computing the topmost certificate twice.
-rw-r--r--src/gnutls.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gnutls.c b/src/gnutls.c
index 5a178472ceb..92956923db3 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1268,18 +1268,16 @@ The return value is a property list with top-level keys :warnings and
1268 { 1268 {
1269 Lisp_Object certs = Qnil; 1269 Lisp_Object certs = Qnil;
1270 1270
1271 /* Return the host certificate in its own element for
1272 compatibility reasons. */
1273 result = nconc2 (result, list2
1274 (intern (":certificate"),
1275 gnutls_certificate_details (XPROCESS (proc)->gnutls_certificates[0])));
1276
1277 /* Return all the certificates in a list. */ 1271 /* Return all the certificates in a list. */
1278 for (int i = 0; i < XPROCESS (proc)->gnutls_certificates_length; i++) 1272 for (int i = 0; i < XPROCESS (proc)->gnutls_certificates_length; i++)
1279 certs = nconc2 (certs, list1 (gnutls_certificate_details 1273 certs = nconc2 (certs, list1 (gnutls_certificate_details
1280 (XPROCESS (proc)->gnutls_certificates[i]))); 1274 (XPROCESS (proc)->gnutls_certificates[i])));
1281 1275
1282 result = nconc2 (result, list2 (intern (":certificates"), certs)); 1276 result = nconc2 (result, list2 (intern (":certificates"), certs));
1277
1278 /* Return the host certificate in its own element for
1279 compatibility reasons. */
1280 result = nconc2 (result, list2 (intern (":certificate"), XCAR (certs)));
1283 } 1281 }
1284 1282
1285 state = XPROCESS (proc)->gnutls_state; 1283 state = XPROCESS (proc)->gnutls_state;