emacs-diffs
[Top][All Lists]
Advanced

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

master 5d2bc15: Make timeouts work more reliably in url-retrieve-synchro


From: Lars Ingebrigtsen
Subject: master 5d2bc15: Make timeouts work more reliably in url-retrieve-synchronously
Date: Sun, 19 Jul 2020 16:41:35 -0400 (EDT)

branch: master
commit 5d2bc1543925960009167988523d76fc6d4c805a
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make timeouts work more reliably in url-retrieve-synchronously
    
    * lisp/url/url.el (url-retrieve-synchronously): Ensure that the
    processes have been killed on timeouts before returning the buffer
    (bug#34607).
---
 lisp/url/url.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lisp/url/url.el b/lisp/url/url.el
index 12a8a9c..367af1b 100644
--- a/lisp/url/url.el
+++ b/lisp/url/url.el
@@ -300,8 +300,15 @@ how long to wait for a response before giving up."
              (when quit-flag
                (delete-process proc))
               (setq proc (and (not quit-flag)
-                             (get-buffer-process asynch-buffer)))))))
-      asynch-buffer)))
+                             (get-buffer-process asynch-buffer))))))
+        ;; On timeouts, make sure we kill any pending processes.
+        ;; There may be more than one if we had a redirect.
+        (when (process-live-p proc)
+          (delete-process proc))
+        (when-let ((aproc (get-buffer-process asynch-buffer)))
+          (when (process-live-p aproc)
+            (delete-process aproc)))))
+    asynch-buffer))
 
 ;; url-mm-callback called from url-mm, which requires mm-decode.
 (declare-function mm-dissect-buffer "mm-decode"



reply via email to

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