emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 6339807: Make gnutls-verify-error work again with u


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 6339807: Make gnutls-verify-error work again with url-retrieve-synchronously
Date: Wed, 13 Sep 2017 14:11:06 -0400 (EDT)

branch: master
commit 63398071471f6cd6b006d3c35d2d83c597549e4a
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    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.
---
 lisp/url/url-gw.el    | 6 ++++--
 lisp/url/url-parse.el | 3 ++-
 lisp/url/url.el       | 4 ++++
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/lisp/url/url-gw.el b/lisp/url/url-gw.el
index 28acde6..716b7c0 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 4738163..ef8e17d 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 be6377c..a6145d3 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]