From: Dmitry Gutov Date: Sat, 8 Jun 2024 21:52:26 +0000 (+0300) Subject: url-retrieve-synchronously: Fix timeout when connection hangs X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=aaeab78dca7103311188a849e028b8d388e2061a;p=emacs.git 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) --- 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))