1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

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).
This commit is contained in:
Dmitry Gutov 2024-06-09 00:52:26 +03:00
parent e9a0256a55
commit e2527dd9fd

View file

@ -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))