diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
commit | 07fcbb558d797272b9f43547da60beda485873a3 (patch) | |
tree | 77d5da14e9f9d9d8b1d877c70c01296fd3893796 /lisp/url/url-http.el | |
parent | c9bdeff3e45a7ac84a74a81bb048046f82dddc91 (diff) | |
parent | fb81c8c3adf8633f2f617c82f6019aef630860c7 (diff) | |
download | emacs-07fcbb558d797272b9f43547da60beda485873a3.tar.gz |
Merge remote-tracking branch 'origin/master' into athena/unstable
Diffstat (limited to 'lisp/url/url-http.el')
-rw-r--r-- | lisp/url/url-http.el | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 8cebd4e79f6..ba13a17a8fc 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -1292,7 +1292,7 @@ passing it an updated value of CBARGS as arguments. The first element in CBARGS should be a plist describing what has happened so far during the request, as described in the docstring of `url-retrieve' (if in doubt, specify nil). The current buffer -then CALLBACK is executed is the retrieval buffer. +when CALLBACK is executed is the retrieval buffer. Optional arg RETRY-BUFFER, if non-nil, specifies the buffer of a previous `url-http' call, which is being re-attempted. @@ -1494,17 +1494,18 @@ The return value of this function is the retrieval buffer." ;; Sometimes we get a zero-length data chunk after the process has ;; been changed to 'free', which means it has no buffer associated ;; with it. Do nothing if there is no buffer, or 0 length data. - (and (process-buffer proc) - (/= (length data) 0) - (with-current-buffer (process-buffer proc) - (url-http-debug "Calling after change function `%s' for `%S'" url-http-after-change-function proc) - (funcall url-http-after-change-function - (point-max) - (progn - (goto-char (point-max)) - (insert data) - (point-max)) - (length data))))) + (let ((b (process-buffer proc))) + (when (and (buffer-live-p b) (not (zerop (length data)))) + (with-current-buffer b + (url-http-debug "Calling after change function `%s' for `%S'" + url-http-after-change-function proc) + (funcall url-http-after-change-function + (point-max) + (progn + (goto-char (point-max)) + (insert data) + (point-max)) + (length data)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; file-name-handler stuff from here on out |