summaryrefslogtreecommitdiff
path: root/lisp/url
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <larsi@gnus.org>2010-10-01 16:05:25 +0200
committerLars Magne Ingebrigtsen <larsi@gnus.org>2010-10-01 16:05:25 +0200
commit6ca26f1d7fd69a2d02c689295b952f54857d7827 (patch)
tree481c6f291810ee186d7e22580ccaf8500da2d5e6 /lisp/url
parent4cacd822d198d85848348ae85c08fb56f6525116 (diff)
downloademacs-6ca26f1d7fd69a2d02c689295b952f54857d7827.tar.gz
(url-http-async-sentinel): Check that the buffer is still alive before
switching to it.
Diffstat (limited to 'lisp/url')
-rw-r--r--lisp/url/ChangeLog5
-rw-r--r--lisp/url/url-http.el29
2 files changed, 20 insertions, 14 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index cddfa38cc00..f5a0a2f4b5d 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * url-http.el (url-http-async-sentinel): Check that the buffer is
+ still alive before switching to it.
+
2010-09-25 Julien Danjou <julien@danjou.info>
* url-cache.el (url-cache-create-filename): Ensure no-port and
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index bd0a3de98a5..655ea387c8d 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -1244,20 +1244,21 @@ CBARGS as the arguments."
(declare (special url-callback-arguments))
;; We are performing an asynchronous connection, and a status change
;; has occurred.
- (with-current-buffer (process-buffer proc)
- (cond
- (url-http-connection-opened
- (url-http-end-of-document-sentinel proc why))
- ((string= (substring why 0 4) "open")
- (setq url-http-connection-opened t)
- (process-send-string proc (url-http-create-request)))
- (t
- (setf (car url-callback-arguments)
- (nconc (list :error (list 'error 'connection-failed why
- :host (url-host (or url-http-proxy url-current-object))
- :service (url-port (or url-http-proxy url-current-object))))
- (car url-callback-arguments)))
- (url-http-activate-callback)))))
+ (when (buffer-name (process-buffer proc))
+ (with-current-buffer (process-buffer proc)
+ (cond
+ (url-http-connection-opened
+ (url-http-end-of-document-sentinel proc why))
+ ((string= (substring why 0 4) "open")
+ (setq url-http-connection-opened t)
+ (process-send-string proc (url-http-create-request)))
+ (t
+ (setf (car url-callback-arguments)
+ (nconc (list :error (list 'error 'connection-failed why
+ :host (url-host (or url-http-proxy url-current-object))
+ :service (url-port (or url-http-proxy url-current-object))))
+ (car url-callback-arguments)))
+ (url-http-activate-callback))))))
;; Since Emacs 19/20 does not allow you to change the
;; `after-change-functions' hook in the midst of running them, we fake