From 41234a21bf7d6713491ce60501bbf2d211fbac8e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 1 Oct 2022 14:50:22 +0200 Subject: [PATCH] Fix url-retrieve-synchronously on very short timeouts * 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/url/url.el b/lisp/url/url.el index d08ff04eda9..b4ece5faeb2 100644 --- a/lisp/url/url.el +++ b/lisp/url/url.el @@ -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)) -- 2.39.2