summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2017-09-13 20:10:51 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2017-09-13 20:11:02 +0200
commit63398071471f6cd6b006d3c35d2d83c597549e4a (patch)
tree2bfcc3ed4f1770dc1a5312b04a63082632f53fb2
parent4ab44f75d6ad7eb378c85c111ea1006076cf994b (diff)
downloademacs-63398071471f6cd6b006d3c35d2d83c597549e4a.tar.gz
Make gnutls-verify-error work again with url-retrieve-synchronously
* lisp/url/url-gw.el (url-open-stream): Only use :nowait if we're doing async connections (bug#26835). * lisp/url/url-parse.el (url): Add an asynchronous slot. * lisp/url/url.el (url-asynchronous): New variable. (url-retrieve-internal): Store the value. (url-retrieve-synchronously): Bind the variable.
-rw-r--r--lisp/url/url-gw.el6
-rw-r--r--lisp/url/url-parse.el3
-rw-r--r--lisp/url/url.el4
3 files changed, 10 insertions, 3 deletions
diff --git a/lisp/url/url-gw.el b/lisp/url/url-gw.el
index 28acde64203..716b7c0a6e0 100644
--- a/lisp/url/url-gw.el
+++ b/lisp/url/url-gw.el
@@ -24,6 +24,7 @@
;;; Code:
(require 'url-vars)
+(require 'url-parse)
;; Fixme: support SSH explicitly or via a url-gateway-rlogin-program?
@@ -245,8 +246,9 @@ overriding the value of `url-gateway-method'."
name buffer host service
:type gw-method
;; Use non-blocking socket if we can.
- :nowait (featurep 'make-network-process
- '(:nowait t))))
+ :nowait (and (featurep 'make-network-process)
+ (url-asynchronous url-current-object)
+ '(:nowait t))))
(`socks
(socks-open-network-stream name buffer host service))
(`telnet
diff --git a/lisp/url/url-parse.el b/lisp/url/url-parse.el
index 4738163f0bc..ef8e17dd13d 100644
--- a/lisp/url/url-parse.el
+++ b/lisp/url/url-parse.el
@@ -36,7 +36,8 @@
target attributes fullness))
(:copier nil))
type user password host portspec filename target attributes fullness
- silent (use-cookies t))
+ silent (use-cookies t)
+ (asynchronous t))
(defsubst url-port (urlobj)
"Return the port number for the URL specified by URLOBJ.
diff --git a/lisp/url/url.el b/lisp/url/url.el
index be6377ceb3a..a6145d3f5f3 100644
--- a/lisp/url/url.el
+++ b/lisp/url/url.el
@@ -119,6 +119,8 @@ variable in the original buffer as a forwarding pointer.")
(defvar url-retrieve-number-of-calls 0)
(autoload 'url-cache-prune-cache "url-cache")
+(defvar url-asynchronous t
+ "Bind to nil before calling `url-retrieve' to signal :nowait connections.")
;;;###autoload
(defun url-retrieve (url callback &optional cbargs silent inhibit-cookies)
@@ -190,6 +192,7 @@ URL-encoded before it's used."
(unless (url-type url)
(error "Bad url: %s" (url-recreate-url url)))
(setf (url-silent url) silent)
+ (setf (url-asynchronous url) url-asynchronous)
(setf (url-use-cookies url) (not inhibit-cookies))
;; Once in a while, remove old entries from the URL cache.
(when (zerop (% url-retrieve-number-of-calls 1000))
@@ -232,6 +235,7 @@ how long to wait for a response before giving up."
(let ((retrieval-done nil)
(start-time (current-time))
+ (url-asynchronous nil)
(asynch-buffer nil))
(setq asynch-buffer
(url-retrieve url (lambda (&rest ignored)