From aaeab78dca7103311188a849e028b8d388e2061a Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 9 Jun 2024 00:52:26 +0300 Subject: [PATCH] url-retrieve-synchronously: Fix timeout when connection hangs * lisp/url/url.el (url-retrieve-synchronously): Set url-asynchronous to t when TIMEOUT is non-nil (bug#71295). (cherry picked from commit e2527dd9fd376b15d2f59ae440858b442b069577) --- lisp/url/url.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/url/url.el b/lisp/url/url.el index dea251b453b..0ac2917b213 100644 --- a/lisp/url/url.el +++ b/lisp/url/url.el @@ -235,7 +235,8 @@ If INHIBIT-COOKIES is non-nil, refuse to store cookies. If TIMEOUT is passed, it should be a number that says (in seconds) how long to wait for a response before giving up." (url-do-setup) - (let* (url-asynchronous + (let* (;; Ensure we can stop during connection setup (bug#71295). + (url-asynchronous (not (null timeout))) data-buffer (callback (lambda (&rest _args) (setq data-buffer (current-buffer)) -- 2.39.2