comparison lisp/url/url-http.el @ 110803:e5dfbfe93896

url-http.el (url-http-end-of-document-sentinel): Protect against the process buffer being killed.
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Thu, 07 Oct 2010 13:40:42 +0200
parents d131be972bc8
children 417b1e4d63cd
comparison
equal deleted inserted replaced
110802:e544f6cc2447 110803:e5dfbfe93896
872 ;; Sentinel used for old HTTP/0.9 or connections we know are going 872 ;; Sentinel used for old HTTP/0.9 or connections we know are going
873 ;; to die as the 'end of document' notifier. 873 ;; to die as the 'end of document' notifier.
874 (url-http-debug "url-http-end-of-document-sentinel in buffer (%s)" 874 (url-http-debug "url-http-end-of-document-sentinel in buffer (%s)"
875 (process-buffer proc)) 875 (process-buffer proc))
876 (url-http-idle-sentinel proc why) 876 (url-http-idle-sentinel proc why)
877 (with-current-buffer (process-buffer proc) 877 (when (buffer-name (process-buffer proc))
878 (goto-char (point-min)) 878 (with-current-buffer (process-buffer proc)
879 (if (not (looking-at "HTTP/")) 879 (goto-char (point-min))
880 ;; HTTP/0.9 just gets passed back no matter what 880 (if (not (looking-at "HTTP/"))
881 (url-http-activate-callback) 881 ;; HTTP/0.9 just gets passed back no matter what
882 (if (url-http-parse-headers) 882 (url-http-activate-callback)
883 (url-http-activate-callback))))) 883 (if (url-http-parse-headers)
884 (url-http-activate-callback))))))
884 885
885 (defun url-http-simple-after-change-function (st nd length) 886 (defun url-http-simple-after-change-function (st nd length)
886 ;; Function used when we do NOT know how long the document is going to be 887 ;; Function used when we do NOT know how long the document is going to be
887 ;; Just _very_ simple 'downloaded %d' type of info. 888 ;; Just _very_ simple 'downloaded %d' type of info.
888 (declare (special url-http-end-of-headers)) 889 (declare (special url-http-end-of-headers))