aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab2012-02-10 12:36:42 +0100
committerAndreas Schwab2012-02-10 12:36:42 +0100
commitd7c5e1622f63d19d7bfc6a7beb15142a6814b7ea (patch)
tree4e51c259401893a6eaed5b21e2a67c0235c02be0
parent5f5e4ea10c87285ed92c62b5dfdaebe8eb3e1df2 (diff)
downloademacs-d7c5e1622f63d19d7bfc6a7beb15142a6814b7ea.tar.gz
emacs-d7c5e1622f63d19d7bfc6a7beb15142a6814b7ea.zip
* url-http.el (url-http-clean-headers): Return the number of
removed characters. (url-http-wait-for-headers-change-function): Adjust end position after cleaning the headers. (Bug#10768)
-rw-r--r--lisp/url/ChangeLog7
-rw-r--r--lisp/url/url-http.el13
2 files changed, 15 insertions, 5 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index d7a22b72123..8f0cbcb2594 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,10 @@
12012-02-10 Andreas Schwab <schwab@linux-m68k.org>
2
3 * url-http.el (url-http-clean-headers): Return the number of
4 removed characters.
5 (url-http-wait-for-headers-change-function): Adjust end position
6 after cleaning the headers. (Bug#10768)
7
12012-02-10 Glenn Morris <rgm@gnu.org> 82012-02-10 Glenn Morris <rgm@gnu.org>
2 9
3 * url-queue.el (url-queue-retrieve): Doc fix. 10 * url-queue.el (url-queue-retrieve): Doc fix.
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index b2f93f093e6..6653176d7e9 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -354,11 +354,14 @@ request.")
354;; Parsing routines 354;; Parsing routines
355(defun url-http-clean-headers () 355(defun url-http-clean-headers ()
356 "Remove trailing \r from header lines. 356 "Remove trailing \r from header lines.
357This allows us to use `mail-fetch-field', etc." 357This allows us to use `mail-fetch-field', etc.
358Return the number of characters removed."
358 (declare (special url-http-end-of-headers)) 359 (declare (special url-http-end-of-headers))
359 (goto-char (point-min)) 360 (let ((end (marker-position url-http-end-of-headers)))
360 (while (re-search-forward "\r$" url-http-end-of-headers t) 361 (goto-char (point-min))
361 (replace-match ""))) 362 (while (re-search-forward "\r$" url-http-end-of-headers t)
363 (replace-match ""))
364 (- end url-http-end-of-headers)))
362 365
363(defun url-http-handle-authentication (proxy) 366(defun url-http-handle-authentication (proxy)
364 (declare (special status success url-http-method url-http-data 367 (declare (special status success url-http-method url-http-data
@@ -1054,7 +1057,7 @@ the end of the document."
1054 (setq url-http-end-of-headers (set-marker (make-marker) 1057 (setq url-http-end-of-headers (set-marker (make-marker)
1055 (point)) 1058 (point))
1056 end-of-headers t) 1059 end-of-headers t)
1057 (url-http-clean-headers))) 1060 (setq nd (- nd (url-http-clean-headers)))))
1058 1061
1059 (if (not end-of-headers) 1062 (if (not end-of-headers)
1060 ;; Haven't seen the end of the headers yet, need to wait 1063 ;; Haven't seen the end of the headers yet, need to wait