1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-09 13:10:57 -08:00
emacs/lisp/url
Peder O. Klingenberg a2d71cecae Emulate more dynamic bindings in request buffers
Many variables were copied from the dynamic environment to the request
buffer, which allowed them to influence the handling of requests and
responses.  But some were not, notably some of the mime-related
variables, and the user-agent and privacy variables.  This made them
unreliable when dynamically bound around a call to `url-retrieve'; they
would have the desired effect when reusing an existing connection, but
not when url-http opened a new connection.  In the case of reused
connections, the request construction happens in the dynamic scope of
`url-http', but in the case where a fresh connection is needed, request
construction happens outside that dynamic scope.

This commit adds the remaining variables used in request construction to
the set of buffer local variables mirroring the dynamic values from
url-http, and adds a comment describing the mechanism used and how avoid
the pitfall of inconsistent handling of dynamic bindings.

* lisp/url/url-http.el (url-http-extensions-header): New internal-ish
variable.
(url-http-create-request): Use the new variable instead of the global
one.
(url-http-idle-sentinel): Debug-log when the connection closes.
(url-http): Set up more buffer-local variants of dynamic variables in
the buffer used for the request, and add comment describing why this
copying is needed.

(Bug#61916)
2025-07-26 12:09:07 +03:00
..
ChangeLog.1
url-auth.el
url-cache.el
url-cid.el
url-cookie.el Allow nil as valid value for 'url-cookie-save-interval' 2025-05-17 11:26:23 +03:00
url-dav.el Prefer incf to cl-incf in remaining files 2025-02-26 02:57:03 +01:00
url-domsuf.el
url-expand.el
url-file.el
url-ftp.el
url-future.el
url-gw.el
url-handlers.el
url-history.el Remove redundant constant nil argument to gethash 2025-03-29 14:59:09 +01:00
url-http.el Emulate more dynamic bindings in request buffers 2025-07-26 12:09:07 +03:00
url-imap.el
url-irc.el
url-ldap.el
url-mailto.el
url-methods.el
url-misc.el
url-news.el
url-nfs.el
url-parse.el url-parse.el: correct code for Windows paths (bug#76982) 2025-04-28 08:19:06 +02:00
url-privacy.el
url-proxy.el
url-queue.el Prefer incf to cl-incf in remaining files 2025-02-26 02:57:03 +01:00
url-tramp.el
url-util.el
url-vars.el
url.el