unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* url-http: bug of mis-judgement as http 0.9
@ 2006-11-13  7:55 Shun-ichi GOTO
  2006-11-15 23:09 ` Magnus Henoch
  0 siblings, 1 reply; 2+ messages in thread
From: Shun-ichi GOTO @ 2006-11-13  7:55 UTC (permalink / raw)


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  <gotoh@taiyo.co.jp>
   R&D Group, TAIYO Corp., Tokyo, JAPAN

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: url-http: bug of mis-judgement as http 0.9
  2006-11-13  7:55 url-http: bug of mis-judgement as http 0.9 Shun-ichi GOTO
@ 2006-11-15 23:09 ` Magnus Henoch
  0 siblings, 0 replies; 2+ messages in thread
From: Magnus Henoch @ 2006-11-15 23:09 UTC (permalink / raw)


Shun-ichi GOTO <gotoh@taiyo.co.jp> writes:

> 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.

I installed your patch.  Thanks!

Magnus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-15 23:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-13  7:55 url-http: bug of mis-judgement as http 0.9 Shun-ichi GOTO
2006-11-15 23:09 ` Magnus Henoch

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).