Commit a345ff6b authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen
Browse files

Implement a new url parameter `url-request-noninteractive'

* url-http.el (url-http): Respect `url-request-noninteractive'.

* url-queue.el (url-queue-start-retrieve): Fetching through
url-queue should always be noninteractive.

* url-vars.el (url-request-noninteractive): New variable.
parent c43b706a
2014-11-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
* NEWS: Mention `url-request-noninteractive'.
2014-11-19 Leo Liu <sdl.web@gmail.com>
* NEWS: Mention new macro define-advice.
......
......@@ -262,14 +262,20 @@ plain text parts, if display of HTML email is possible; customize the
** In sh-mode, you can now use `sh-shell' as a file-local variable to
specify the type of shell in use (bash, csh, etc).
** The URL package accepts now the protocols "ssh", "scp" and "rsync".
** URL
*** The URL package accepts now the protocols "ssh", "scp" and "rsync".
When `url-handler-mode' is enabled, file operations for these
protocols as well as for "telnet" and "ftp" are passed to Tramp.
** The URL package allows customizing the `url-user-agent' string.
*** The URL package allows customizing the `url-user-agent' string.
The new `url-user-agent' variable can be customized to be a string or
a function.
*** The new interface variable `url-request-noninteractive' can be used
to specify that we're running in a noninteractive context, and that
we should not be queried about things like TLS certificate validity.
** Tramp
*** New connection method "nc", which allows to access dumb busyboxes.
......
2014-11-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
* url-http.el (url-http): Respect `url-request-noninteractive'.
* url-queue.el (url-queue-start-retrieve): Fetching through
url-queue should always be noninteractive.
* url-vars.el (url-request-noninteractive): New variable.
2014-11-14 David Reitter <david.reitter@gmail.com>
* url-domsuf.el (url-domsuf-parse-file): Read compressed
......
......@@ -40,6 +40,7 @@
(defvar url-http-data)
(defvar url-http-end-of-headers)
(defvar url-http-extra-headers)
(defvar url-http-noninteractive)
(defvar url-http-method)
(defvar url-http-no-retry)
(defvar url-http-process)
......@@ -1201,6 +1202,9 @@ overriding the value of `url-gateway-method'."
(cl-check-type url vector "Need a pre-parsed URL.")
(let* ((host (url-host (or url-using-proxy url)))
(port (url-port (or url-using-proxy url)))
(nsm-noninteractive (or url-request-noninteractive
(and (boundp 'url-http-noninteractive)
url-http-noninteractive)))
(connection (url-http-find-free-connection host port gateway-method))
(buffer (or retry-buffer
(generate-new-buffer
......@@ -1232,6 +1236,7 @@ overriding the value of `url-gateway-method'."
url-http-process
url-http-method
url-http-extra-headers
url-http-noninteractive
url-http-data
url-http-target-url
url-http-no-retry
......@@ -1241,6 +1246,7 @@ overriding the value of `url-gateway-method'."
(setq url-http-method (or url-request-method "GET")
url-http-extra-headers url-request-extra-headers
url-http-noninteractive url-request-noninteractive
url-http-data url-request-data
url-http-process connection
url-http-chunked-length nil
......
......@@ -133,10 +133,11 @@ The variable `url-queue-timeout' sets a timeout."
(defun url-queue-start-retrieve (job)
(setf (url-queue-buffer job)
(ignore-errors
(url-retrieve (url-queue-url job)
#'url-queue-callback-function (list job)
(url-queue-silentp job)
(url-queue-inhibit-cookiesp job)))))
(let ((url-request-noninteractive t))
(url-retrieve (url-queue-url job)
#'url-queue-callback-function (list job)
(url-queue-silentp job)
(url-queue-inhibit-cookiesp job))))))
(defun url-queue-prune-old-entries ()
(let (dead-jobs)
......
......@@ -209,6 +209,9 @@ document."
"A list of extra headers to send with the next request.
Should be an assoc list of headers/contents.")
(defvar url-request-noninteractive nil
"If non-nil, the request is done in a noninteractive context.")
(defvar url-request-method nil "The method to use for the next request.")
(defvar url-mime-encoding-string (and (fboundp 'zlib-available-p)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment