emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

url-http: bug of mis-judgement as http 0.9


From: Shun-ichi GOTO
Subject: url-http: bug of mis-judgement as http 0.9
Date: Mon, 13 Nov 2006 16:55:11 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.0.90 (i386-msvc-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.00-dev (KIKU)

I've encountered a strange error in the process filter and it also said
"HTTP/0.9 How I hate thee!" although my server is not 0.9.

I found a bug of mis-detecting of a version (1.0, 1.1 or 0.9) of response.
This bug appears on the first call of the process filter with a
string data which does not have complete line (it means without \n).
In my case, process filter was called with string data: "HTTP/1.".
Therfore url-http-wait-for-headers-change-function<f> judged
the response is not http 1.0/1.1 before first line is completed.

Here is a example patch to fix this.

Index: url-http.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/url/url-http.el,v
retrieving revision 1.41
diff -u -r1.41 url-http.el
--- url-http.el 10 Nov 2006 17:09:01 -0000      1.41
+++ url-http.el 13 Nov 2006 07:32:11 -0000
@@ -933,7 +933,8 @@
            (old-http nil)
            (content-length nil))
        (goto-char (point-min))
-       (if (not (looking-at "^HTTP/[1-9]\\.[0-9]"))
+       (if (and (looking-at ".*\n")    ; have one line at least
+                (not (looking-at "^HTTP/[1-9]\\.[0-9]")))
            ;; Not HTTP/x.y data, must be 0.9
            ;; God, I wish this could die.
            (setq end-of-headers t

--- Regards,
 Shun-ichi Goto  <address@hidden>
   R&D Group, TAIYO Corp., Tokyo, JAPAN






reply via email to

[Prev in Thread] Current Thread [Next in Thread]