url-http-wait-for-headers-change-function fix for bug#13598
authorGlenn Morris <rgm@gnu.org>
Sat, 16 Feb 2013 02:05:32 +0000 (21:05 -0500)
committerGlenn Morris <rgm@gnu.org>
Sat, 16 Feb 2013 02:05:32 +0000 (21:05 -0500)
* lisp/url/url-http.el (url-http-wait-for-headers-change-function):
Avoid prematurely finding the end of headers when they arrive line-by-line.

lisp/url/ChangeLog
lisp/url/url-http.el

index 72842ad..f8f24de 100644 (file)
@@ -1,3 +1,9 @@
+2013-02-16  Glenn Morris  <rgm@gnu.org>
+
+       * url-http.el (url-http-wait-for-headers-change-function):
+       Avoid prematurely finding the end of headers when they arrive
+       line-by-line.  (Bug#13598)
+
 2013-02-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * url-cache.el (url-cache-create-filename-using-md5): Don't waste your
index 5dd3a75..33fc572 100644 (file)
@@ -1040,7 +1040,9 @@ the end of the document."
          (setq end-of-headers t
                url-http-end-of-headers 0
                old-http t)
-       (when (re-search-forward "^\r*$" nil t)
+       ;; Blank line at end of headers.
+       (when (re-search-forward "^\r?\n" nil t)
+         (backward-char 1)
          ;; Saw the end of the headers
          (url-http-debug "Saw end of headers... (%s)" (buffer-name))
          (setq url-http-end-of-headers (set-marker (make-marker)