diff options
| author | Lars Magne Ingebrigtsen | 2014-12-12 12:32:42 +0100 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2014-12-12 12:32:42 +0100 |
| commit | 88f3dbc46545d1f699dd3f2aba8156cf1cdaa500 (patch) | |
| tree | 588c4e137d9a7796dbb5df202aea64a46b9c8fa3 | |
| parent | 3431e82d16af3d5130f0218efd5fafaa797ed28a (diff) | |
| download | emacs-88f3dbc46545d1f699dd3f2aba8156cf1cdaa500.tar.gz emacs-88f3dbc46545d1f699dd3f2aba8156cf1cdaa500.zip | |
Remove more (fboundp 'gnutls-available-p)
* lisp/net/network-stream.el (network-stream-open-starttls): No need to
check for the availability of `gnutls-available-p'.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/net/network-stream.el | 18 |
2 files changed, 10 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0410b226e00..9c70947fa15 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2014-12-12 Lars Magne Ingebrigtsen <larsi@gnus.org> | 1 | 2014-12-12 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 2 | ||
| 3 | * net/network-stream.el (network-stream-open-starttls): No need to | ||
| 4 | check for the availability of `gnutls-available-p'. | ||
| 5 | |||
| 3 | * files.el (directory-files-recursively): Don't follow symlinks to | 6 | * files.el (directory-files-recursively): Don't follow symlinks to |
| 4 | other directories. | 7 | other directories. |
| 5 | 8 | ||
diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index a1e9729bac3..9e4b0bab6ac 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el | |||
| @@ -225,8 +225,6 @@ asynchronously, if possible." | |||
| 225 | (capabilities (network-stream-command stream capability-command | 225 | (capabilities (network-stream-command stream capability-command |
| 226 | eo-capa)) | 226 | eo-capa)) |
| 227 | (resulting-type 'plain) | 227 | (resulting-type 'plain) |
| 228 | (builtin-starttls (and (fboundp 'gnutls-available-p) | ||
| 229 | (gnutls-available-p))) | ||
| 230 | starttls-available starttls-command error) | 228 | starttls-available starttls-command error) |
| 231 | 229 | ||
| 232 | ;; First check whether the server supports STARTTLS at all. | 230 | ;; First check whether the server supports STARTTLS at all. |
| @@ -237,14 +235,14 @@ asynchronously, if possible." | |||
| 237 | ;; connection. | 235 | ;; connection. |
| 238 | (when (and starttls-command | 236 | (when (and starttls-command |
| 239 | (setq starttls-available | 237 | (setq starttls-available |
| 240 | (or builtin-starttls | 238 | (or (gnutls-available-p) |
| 241 | (and (or require-tls | 239 | (and (or require-tls |
| 242 | (plist-get parameters :use-starttls-if-possible)) | 240 | (plist-get parameters :use-starttls-if-possible)) |
| 243 | (starttls-available-p)))) | 241 | (starttls-available-p)))) |
| 244 | (not (eq (plist-get parameters :type) 'plain))) | 242 | (not (eq (plist-get parameters :type) 'plain))) |
| 245 | ;; If using external STARTTLS, drop this connection and start | 243 | ;; If using external STARTTLS, drop this connection and start |
| 246 | ;; anew with `starttls-open-stream'. | 244 | ;; anew with `starttls-open-stream'. |
| 247 | (unless builtin-starttls | 245 | (unless (gnutls-available-p) |
| 248 | (delete-process stream) | 246 | (delete-process stream) |
| 249 | (setq start (with-current-buffer buffer (point-max))) | 247 | (setq start (with-current-buffer buffer (point-max))) |
| 250 | (let* ((starttls-extra-arguments | 248 | (let* ((starttls-extra-arguments |
| @@ -277,7 +275,7 @@ asynchronously, if possible." | |||
| 277 | (network-stream-command stream starttls-command eoc))) | 275 | (network-stream-command stream starttls-command eoc))) |
| 278 | (and response (string-match success-string response))) | 276 | (and response (string-match success-string response))) |
| 279 | ;; The server said it was OK to begin STARTTLS negotiations. | 277 | ;; The server said it was OK to begin STARTTLS negotiations. |
| 280 | (if builtin-starttls | 278 | (if (gnutls-available-p) |
| 281 | (let ((cert (network-stream-certificate host service parameters))) | 279 | (let ((cert (network-stream-certificate host service parameters))) |
| 282 | (condition-case nil | 280 | (condition-case nil |
| 283 | (gnutls-negotiate :process stream :hostname host | 281 | (gnutls-negotiate :process stream :hostname host |
| @@ -326,7 +324,7 @@ asynchronously, if possible." | |||
| 326 | (delete-process stream) | 324 | (delete-process stream) |
| 327 | (setq stream nil)) | 325 | (setq stream nil)) |
| 328 | ;; Check certificate validity etc. | 326 | ;; Check certificate validity etc. |
| 329 | (when builtin-starttls | 327 | (when (gnutls-available-p) |
| 330 | (setq stream (nsm-verify-connection | 328 | (setq stream (nsm-verify-connection |
| 331 | stream host service | 329 | stream host service |
| 332 | (eq resulting-type 'tls) | 330 | (eq resulting-type 'tls) |
| @@ -356,22 +354,20 @@ asynchronously, if possible." | |||
| 356 | (defun network-stream-open-tls (name buffer host service parameters) | 354 | (defun network-stream-open-tls (name buffer host service parameters) |
| 357 | (with-current-buffer buffer | 355 | (with-current-buffer buffer |
| 358 | (let* ((start (point-max)) | 356 | (let* ((start (point-max)) |
| 359 | (use-builtin-gnutls (and (fboundp 'gnutls-available-p) | ||
| 360 | (gnutls-available-p))) | ||
| 361 | (stream | 357 | (stream |
| 362 | (funcall (if use-builtin-gnutls | 358 | (funcall (if (gnutls-available-p) |
| 363 | 'open-gnutls-stream | 359 | 'open-gnutls-stream |
| 364 | 'open-tls-stream) | 360 | 'open-tls-stream) |
| 365 | name buffer host service)) | 361 | name buffer host service)) |
| 366 | (eoc (plist-get parameters :end-of-command))) | 362 | (eoc (plist-get parameters :end-of-command))) |
| 367 | ;; Check certificate validity etc. | 363 | ;; Check certificate validity etc. |
| 368 | (when (and use-builtin-gnutls stream) | 364 | (when (and (gnutls-available-p) stream) |
| 369 | (setq stream (nsm-verify-connection stream host service))) | 365 | (setq stream (nsm-verify-connection stream host service))) |
| 370 | (if (null stream) | 366 | (if (null stream) |
| 371 | (list nil nil nil 'plain) | 367 | (list nil nil nil 'plain) |
| 372 | ;; If we're using tls.el, we have to delete the output from | 368 | ;; If we're using tls.el, we have to delete the output from |
| 373 | ;; openssl/gnutls-cli. | 369 | ;; openssl/gnutls-cli. |
| 374 | (when (and (null use-builtin-gnutls) | 370 | (when (and (not (gnutls-available-p)) |
| 375 | eoc) | 371 | eoc) |
| 376 | (network-stream-get-response stream start eoc) | 372 | (network-stream-get-response stream start eoc) |
| 377 | (goto-char (point-min)) | 373 | (goto-char (point-min)) |