diff options
| author | Lars Ingebrigtsen | 2012-02-08 01:04:42 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2012-02-08 01:04:42 +0100 |
| commit | aacaa4191173ca6d1aea3fd4ebb01ea1d5e46e7b (patch) | |
| tree | 6302d500e5ab761183c51859bd856edbf2da9e72 /lisp/url/url-queue.el | |
| parent | 7c4bbb6992b443b0ce569d111fc167ad753e912c (diff) | |
| download | emacs-aacaa4191173ca6d1aea3fd4ebb01ea1d5e46e7b.tar.gz emacs-aacaa4191173ca6d1aea3fd4ebb01ea1d5e46e7b.zip | |
Allow specifying whether to inhibit cookies on a per-URL basis
* url-http.el (url-http-create-request): Don't send cookies unless
requested.
(url-http-parse-headers): Don't store cookies unless requested.
* url.el (url-retrieve): Ditto
* url-queue.el (url-queue-retrieve): Take an optional
`inhibit-cookies' parameter.
* url-parse.el (url): Add the `use-cookies' slot to the URL struct
to be able to keep track of whether to do cookies or not on a
per-URL basis.
Diffstat (limited to 'lisp/url/url-queue.el')
| -rw-r--r-- | lisp/url/url-queue.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el index 976a26635cd..c9c6c4fe69e 100644 --- a/lisp/url/url-queue.el +++ b/lisp/url/url-queue.el | |||
| @@ -50,10 +50,11 @@ | |||
| 50 | 50 | ||
| 51 | (defstruct url-queue | 51 | (defstruct url-queue |
| 52 | url callback cbargs silentp | 52 | url callback cbargs silentp |
| 53 | buffer start-time pre-triggered) | 53 | buffer start-time pre-triggered |
| 54 | inhibit-cookiesp) | ||
| 54 | 55 | ||
| 55 | ;;;###autoload | 56 | ;;;###autoload |
| 56 | (defun url-queue-retrieve (url callback &optional cbargs silent) | 57 | (defun url-queue-retrieve (url callback &optional cbargs silent inhibit-cookies) |
| 57 | "Retrieve URL asynchronously and call CALLBACK with CBARGS when finished. | 58 | "Retrieve URL asynchronously and call CALLBACK with CBARGS when finished. |
| 58 | Like `url-retrieve' (which see for details of the arguments), but | 59 | Like `url-retrieve' (which see for details of the arguments), but |
| 59 | controls the level of parallelism via the | 60 | controls the level of parallelism via the |
| @@ -63,7 +64,8 @@ controls the level of parallelism via the | |||
| 63 | (list (make-url-queue :url url | 64 | (list (make-url-queue :url url |
| 64 | :callback callback | 65 | :callback callback |
| 65 | :cbargs cbargs | 66 | :cbargs cbargs |
| 66 | :silentp silent)))) | 67 | :silentp silent |
| 68 | :inhibit-cookiesp inhibit-cookies)))) | ||
| 67 | (url-queue-setup-runners)) | 69 | (url-queue-setup-runners)) |
| 68 | 70 | ||
| 69 | ;; To ensure asynch behaviour, we start the required number of queue | 71 | ;; To ensure asynch behaviour, we start the required number of queue |
| @@ -131,7 +133,8 @@ controls the level of parallelism via the | |||
| 131 | (ignore-errors | 133 | (ignore-errors |
| 132 | (url-retrieve (url-queue-url job) | 134 | (url-retrieve (url-queue-url job) |
| 133 | #'url-queue-callback-function (list job) | 135 | #'url-queue-callback-function (list job) |
| 134 | (url-queue-silentp job))))) | 136 | (url-queue-silentp job) |
| 137 | (url-queue-inhibit-cookiesp job))))) | ||
| 135 | 138 | ||
| 136 | (defun url-queue-prune-old-entries () | 139 | (defun url-queue-prune-old-entries () |
| 137 | (let (dead-jobs) | 140 | (let (dead-jobs) |