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

HTTP/1.1 300 Multiple Choices (was: Bug(s)? in current emacs-w3mcvs)



From: Elias Oltmanns <oltmanns@uni-bonn.de> said
Subject: [emacs-w3m:07750] Re: Bug(s)? in current emacs-w3m cvs
Message-ID: <87acpossnh.fsf@denkblock.local>
Date: Mon, 28 Feb 2005 13:47:30 +0000

> > More importantly though, emacs-w3m sometimes has problems with
> > relative links. If I try, for instance, to view [1], I end up on a
> > page informing me that this target doesn't exist anymore - so far so
> > good. Strangely enough, neither can I view the source of this page (by
> > hitting \), nor can I follow the suggested link to another page on the
> > same server. The error message I get is
> > Wrong type argument: stringp, nil
> >
> > Unfortunately I can't come up with a patch for this one. Do you know
> > what causes problems of this kind.
> 
> Sorry, I totally forgot to give you the reference link:
> 
> [1]: http://www.science.uva.nl/research/itf/education.html

I tried it and got an error.
........
Please apply this patch to CVS Head of emacs-w3m.

-- 
Hideyuki SHIRAI (mailto:shirai@meadowy.org)
Index: w3m.el
===================================================================
RCS file: /cvsroot/w3m-shirai/emacs-w3m/w3m.el,v
retrieving revision 1.944
diff -u -u -r1.944 w3m.el
--- w3m.el	2005/02/28 04:10:34	1.944
+++ w3m.el	2005/03/01 01:03:53
@@ -4222,7 +4222,7 @@
 			  nil nil nil url)
 		  (list (w3m-local-content-type url) nil nil nil nil url)))
 	    (w3m-cache-header url header)
-	    (if (memq (car attr) '(300 301 302 303 304 305 306 307))
+	    (if (memq (car attr) '(301 302 303 304 305 306 307))
 		(if (zerop counter)
 		    ;; Redirect counter exceeds `w3m-follow-redirection'.
 		    nil
@@ -4438,7 +4438,7 @@
 		(set-buffer-multibyte nil)
 		(w3m-w3m-retrieve-1 url post-data referer no-cache
 				    (or w3m-follow-redirection 0) handler)))
-      (when (eq (car attr) 200)
+      (when (memq (car attr) '(200 300))
 	(if (or no-decode
 		(w3m-decode-encoded-contents (nth 4 attr)))
 	    (let ((temp-buffer (current-buffer)))
@@ -4495,7 +4495,7 @@
 	(and temp-file
 	     (file-exists-p temp-file)
 	     (delete-file temp-file))
-	(if (memq (car attr) '(300 301 302 303 304 305 306 307))
+	(if (memq (car attr) '(301 302 303 304 305 306 307))
 	    (if (zerop counter)
 		;; Redirect counter exceeds `w3m-follow-redirection'.
 		nil
Sorry, Japaneses only.

http://www.science.uva.nl/research/itf/education.html
を試してみると、

% w3m -dump_extra http://www.science.uva.nl/research/itf/education.html
W3m-current-url: http://www.science.uva.nl/research/itf/education.html
W3m-document-charset: US-ASCII
HTTP/1.1 300 Multiple Choices
Date: Tue, 01 Mar 2005 01:06:44 GMT
Server: Apache/1.3.28 (Unix) PHP/4.3.2 mod_jk/1.2.0 mod_ssl/2.8.15 OpenSSL/0.9.7b
Content-Type: text/html; charset=iso-8859-1
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 356

な感じで、"300" というレスポンスコードが帰って来ています。
http://www.studyinghttp.net/status_code などを読んでもイマイチ理
解できないのですが、素の w3m も firefox も MS-IE も素通しして、
ユーザに選択の機会を与えるようになっているみたいです。

問題なければあとで commit しておきます。