aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2012-03-14 03:44:09 +0100
committerLars Magne Ingebrigtsen2012-03-14 03:44:09 +0100
commitcc2ab7327027e47a0a5dff2fb8c1051a866baf40 (patch)
treefc1ca578f18d2bac371b088645a63202d04529e6
parent899cb7cb68e9845e787291c4ba8ba8fa692be605 (diff)
downloademacs-cc2ab7327027e47a0a5dff2fb8c1051a866baf40.tar.gz
emacs-cc2ab7327027e47a0a5dff2fb8c1051a866baf40.zip
Always call the callback when timing out url-queue jobs
* url-queue.el (url-queue-kill-job): Make sure that the callback is always called, even if we have a timeout.
-rw-r--r--lisp/url/ChangeLog5
-rw-r--r--lisp/url/url-queue.el17
2 files changed, 19 insertions, 3 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 960649bdbc9..ff6a6e6f805 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,8 @@
12012-03-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * url-queue.el (url-queue-kill-job): Make sure that the callback
4 is always called, even if we have a timeout.
5
12012-03-11 Chong Yidong <cyd@gnu.org> 62012-03-11 Chong Yidong <cyd@gnu.org>
2 7
3 * url-http.el (url-http-end-of-document-sentinel): Handle 8 * url-http.el (url-http-end-of-document-sentinel): Handle
diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el
index 6e4cedddaf3..46124717fed 100644
--- a/lisp/url/url-queue.el
+++ b/lisp/url/url-queue.el
@@ -156,9 +156,20 @@ The variable `url-queue-timeout' sets a timeout."
156 (while (setq process (get-buffer-process (url-queue-buffer job))) 156 (while (setq process (get-buffer-process (url-queue-buffer job)))
157 (set-process-sentinel process 'ignore) 157 (set-process-sentinel process 'ignore)
158 (ignore-errors 158 (ignore-errors
159 (delete-process process)))) 159 (delete-process process)))))
160 (ignore-errors 160 ;; Call the callback with an error message to ensure that the caller
161 (kill-buffer (url-queue-buffer job))))) 161 ;; is notified that the job has failed.
162 (with-current-buffer
163 (if (bufferp (url-queue-buffer job))
164 ;; Use the (partially filled) process buffer it it exists.
165 (url-queue-buffer job)
166 ;; If not, just create a new buffer, which will probably be
167 ;; killed again by the caller.
168 (generate-new-buffer " *temp*"))
169 (apply (url-queue-callback job)
170 (cons (list :error (list 'error 'url-queue-timeout
171 "Queue timeout exceeded"))
172 (url-queue-cbargs job)))))
162 173
163(provide 'url-queue) 174(provide 'url-queue)
164 175