Subject: bug#78928: 30.1; url-queue-retrieve should use the url-request-* variables

From: Rahguzar <[email-masked]>
Date: Mon, 30 Jun 2025 17:19:03 +0500

I am attaching patch with this email.

[email-masked] (GNU bug Tracking System) writes:

> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
>  [email-masked]
>
> If you wish to submit further information on this problem, please
> send it to [email-masked].
>
> Please do not send mail to [email-masked] unless you wish
> to report a problem with the Bug-tracking system.
>From 42bcd5d75859edfc13ace4c287fc80493b80cfc9 Mon Sep 17 00:00:00 2001
From: Rahguzar <[email-masked]>
Date: Mon, 30 Jun 2025 14:58:06 +0500
Subject: [PATCH] * lisp/url/url-queue.el: Better compatibility with
 url-retrieve

(url-queue): New slots to hold request related variables.
(url-queue-retrieve): Capture the request related variables.
(url-queue-start-retrieve): Let bind the request related
variables.  (Bug#78928)
---
 lisp/url/url-queue.el | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el
index 746648e0aa1..d528dc7631e 100644
--- a/lisp/url/url-queue.el
+++ b/lisp/url/url-queue.el
@@ -53,7 +53,8 @@ url-queue-progress-timer
 (cl-defstruct url-queue
   url callback cbargs silentp
   buffer start-time pre-triggered
-  inhibit-cookiesp context-buffer)
+  inhibit-cookiesp context-buffer
+  request-data request-method request-extra-headers)
 
 ;;;###autoload
 (defun url-queue-retrieve (url callback &optional cbargs silent inhibit-cookies)
@@ -63,13 +64,17 @@ url-queue-retrieve
 `url-queue-parallel-processes' sets the number of concurrent processes.
 The variable `url-queue-timeout' sets a timeout."
   (setq url-queue
-	(append url-queue
-		(list (make-url-queue :url url
-				      :callback callback
-				      :cbargs cbargs
-				      :silentp silent
-				      :inhibit-cookiesp inhibit-cookies
-                                      :context-buffer (current-buffer)))))
+        (append url-queue
+                (list (make-url-queue
+                       :url url
+                       :callback callback
+                       :cbargs cbargs
+                       :silentp silent
+                       :inhibit-cookiesp inhibit-cookies
+                       :context-buffer (current-buffer)
+                       :request-data url-request-data
+                       :request-method url-request-method
+                       :request-extra-headers url-request-extra-headers))))
   (url-queue-setup-runners))
 
 ;; To ensure asynch behavior, we start the required number of queue
@@ -155,13 +160,16 @@ url-queue-remove-jobs-from-host
 
 (defun url-queue-start-retrieve (job)
   (setf (url-queue-buffer job)
-	(ignore-errors
+        (ignore-errors
           (with-current-buffer (if (buffer-live-p
                                     (url-queue-context-buffer job))
                                    (url-queue-context-buffer job)
                                  (current-buffer))
-	    (let ((url-request-noninteractive t)
-                  (url-allow-non-local-files t))
+            (let ((url-request-noninteractive t)
+                  (url-allow-non-local-files t)
+                  (url-request-data (url-queue-request-data job))
+                  (url-request-method (url-queue-request-method job))
+                  (url-request-extra-headers (url-queue-request-extra-headers job)))
               (url-retrieve (url-queue-url job)
                             #'url-queue-callback-function (list job)
                             (url-queue-silentp job)
-- 
2.50.0