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

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.
parent 899cb7cb
2012-03-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
* url-queue.el (url-queue-kill-job): Make sure that the callback
is always called, even if we have a timeout.
2012-03-11 Chong Yidong <cyd@gnu.org>
* url-http.el (url-http-end-of-document-sentinel): Handle
......
......@@ -156,9 +156,20 @@ The variable `url-queue-timeout' sets a timeout."
(while (setq process (get-buffer-process (url-queue-buffer job)))
(set-process-sentinel process 'ignore)
(ignore-errors
(delete-process process))))
(ignore-errors
(kill-buffer (url-queue-buffer job)))))
(delete-process process)))))
;; Call the callback with an error message to ensure that the caller
;; is notified that the job has failed.
(with-current-buffer
(if (bufferp (url-queue-buffer job))
;; Use the (partially filled) process buffer it it exists.
(url-queue-buffer job)
;; If not, just create a new buffer, which will probably be
;; killed again by the caller.
(generate-new-buffer " *temp*"))
(apply (url-queue-callback job)
(cons (list :error (list 'error 'url-queue-timeout
"Queue timeout exceeded"))
(url-queue-cbargs job)))))
(provide 'url-queue)
......
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