]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix url-retrieve-synchronously on very short timeouts
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 1 Oct 2022 12:50:22 +0000 (14:50 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 1 Oct 2022 12:51:07 +0000 (14:51 +0200)
* lisp/url/url.el (url-retrieve-synchronously): Don't kill the
process buffer unless we made one (bug#58218).  This makes HTTP
free connection marking work on premature timeouts.

lisp/url/url.el

index d08ff04eda988bd4db7a328afcbd72aa2048c670..b4ece5faeb2b210bd7c1386b7ca44bffda397381 100644 (file)
@@ -280,7 +280,9 @@ how long to wait for a response before giving up."
               ;; Querying over consumer internet in the US takes 100
               ;; ms, so split the difference.
               (accept-process-output nil 0.05)))
-        (unless (eq data-buffer proc-buffer)
+        ;; Kill the process buffer on redirects.
+        (when (and data-buffer
+                   (not (eq data-buffer proc-buffer)))
           (let (kill-buffer-query-functions)
             (kill-buffer proc-buffer)))))
     data-buffer))