[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6407: URL: error when handling redirects
From: |
David Reitter |
Subject: |
bug#6407: URL: error when handling redirects |
Date: |
Fri, 11 Jun 2010 15:38:53 -0400 |
A simple call to `url-http' results in an error when handling a certain kind of
redirect.
The call would be
(url-http url 'foo-function (list t )))
and the trace, the HTTP buffer and a partial explanation of the problem follow
below:
===========
Debugger entered--Lisp error: (wrong-type-argument listp t)
car(t)
(eq (car events) :redirect)
(if (eq (car events) :redirect) (setq old-redirects (1+ old-redirects)))
(while events (if (eq ... :redirect) (setq old-redirects ...)) (and (setq
events ...) (setq events ...)))
(let ((events ...) (old-redirects 0)) (while events (if ... ...) (and ...
...)) (< old-redirects url-max-redirections))
(and (> url-max-redirections 0) (let (... ...) (while events ... ...) (<
old-redirects url-max-redirections)))
(or (< url-max-redirections 0) (and (> url-max-redirections 0) (let ... ...
...)))
(if (or (< url-max-redirections 0) (and ... ...)) (progn (setf ... ...) (set
... ...) (url-mark-buffer-as-dead buffer)) (url-http-debug "Maximum
redirections reached") (setf (car url-callback-arguments) (nconc ... ...))
(setq success t))
(let ((url-request-method url-http-method) (url-request-data url-http-data)
(url-request-extra-headers url-http-extra-headers)) (if (or ... ...) (progn ...
... ...) (url-http-debug "Maximum redirections reached") (setf ... ...) (setq
success t)))
(progn (if (string-match "\\([^ ]+\\)[ ]" redirect-uri) (setq
redirect-uri ...)) (if (string-match "^<\\(.*\\)>$" redirect-uri) (setq
redirect-uri ...)) (if (not ...) (setq redirect-uri ...)) (let (... ... ...)
(if ... ... ... ... ...)))
(if redirect-uri (progn (if ... ...) (if ... ...) (if ... ...) (let ... ...)))
(when redirect-uri (if (string-match "\\([^ ]+\\)[ ]" redirect-uri) (setq
redirect-uri ...)) (if (string-match "^<\\(.*\\)>$" redirect-uri) (setq
redirect-uri ...)) (if (not ...) (setq redirect-uri ...)) (let (... ... ...)
(if ... ... ... ... ...)))
(let ((redirect-uri ...)) (case url-http-response-status (300 nil) (... ...)
(303 ...) (304 ... ... ...) (305 ...) (otherwise nil)) (when redirect-uri (if
... ...) (if ... ...) (if ... ...) (let ... ...)))
(cond ((eql class ...) (url-mark-buffer-as-dead buffer) (error "HTTP
responses in class 1xx not supported (%d)" url-http-response-status)) ((eql
class ...) (case url-http-response-status ... ...)) ((eql class ...) (let ...
... ...)) ((eql class ...) (case url-http-response-status ... ... ... ... ...
... ... ... ... ... ... ... ... ... ... ... ...) (when success ...)) ((eql
class ...) (setq success t) (case url-http-response-status ... ... ... ... ...
...) (when success ...)) (t (error "Unknown class of HTTP response code: %d
(%d)" class url-http-response-status)))
(case class (1 (url-mark-buffer-as-dead buffer) (error "HTTP responses in
class 1xx not supported (%d)" url-http-response-status)) (2 (case
url-http-response-status ... ...)) (3 (let ... ... ...)) (4 (case
url-http-response-status ... ... ... ... ... ... ... ... ... ... ... ... ...
... ... ... ...) (when success ...)) (5 (setq success t) (case
url-http-response-status ... ... ... ... ... ...) (when success ...))
(otherwise (error "Unknown class of HTTP response code: %d (%d)" class
url-http-response-status)))
(let ((buffer ...) (class nil) (success nil)) (setq class (/
url-http-response-status 100)) (url-http-debug "Parsed HTTP headers: class=%d
status=%d" class url-http-response-status) (url-http-handle-cookies) (case
class (1 ... ...) (2 ...) (3 ...) (4 ... ...) (5 ... ... ...) (otherwise ...))
(if (not success) (url-mark-buffer-as-dead buffer)) (url-http-debug "Finished
parsing HTTP headers: %S" success) (widen) success)
url-http-parse-headers()
url-http-content-length-after-change-function(434 1327 893)
url-http-wait-for-headers-change-function(1 1327 1326)
url-http-generic-filter(#<process aquamacs.org> "HTTP/1.0 302 RD
\nLocation:
http://utility.loganwifi.com/port-redirectDAZ7.asp?UI=01f981&NI=0050e801f981&UIP=192.168.1.10&MA=58B0357F2DA0&RN=898&PORT=898&RAD=yes&TUN=no&CC=no&PMS=no&OS=http://aquamacs.org%2Fcgi-bin%2Fcurrentversion.cgi%3Fsess%3D237567792%26seq%3D3138%26beta%3D1%26ver%3D2.0a%26vbt%3D2010-06-10%26obof%3D0%26tab%3D1%26gssm%3D0%26tgssm%3D1%26ssm%3D0%26mm%3Demacs-lisp-mode%26os%3D10.3.1%26cpu%3Di386
\nContent-Length: 888
\n
\n<HTML>\n<!--access
procedure=nx.1-->\n<!--ndxid=01f981-->\n<!--protocol=https-->\n<!--ndxhost=nomadprime.subscribe.loganwifi.com-->\n<!--ndxport=1112-->\n<!--<?xml
version=\"1.0\"
encoding=\"UTF-8\"?>\n<WISPAccessGatewayParam\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\nxsi:noNamespaceSchemaLocation=\"http://www.acmewisp.com/WISPAccessGatewayParam.xsd\">\n<Proxy>\n<MessageType>110</MessageType>\n<ResponseCode>200</ResponseCode>\n<NextURL><![CDATA[http://utility.loganwifi.com/port-redirectDAZ7.asp?UI=01f981&NI=0050e801f981&UIP=192.168.1.10&MA=58B0357F2DA0&RN=898&PORT=898&RAD=yes&TUN=no&CC=no&PMS=no&OS=http://aquamacs.org%2Fcgi-bin%2Fcurrentversion.cgi%3Fsess%3D237567792%26seq%3D3138%26beta%3D1%26ver%3D2.0a%26vbt%3D2010-06-10%26obof%3D0%26tab%3D1%26gssm%3D0%26tgssm%3D1%26ssm%3D0%26mm%3Demacs-lisp-mode%26os%3D10.3.1%26cpu%3Di386]]></NextURL>\n</Proxy>\n</WISPAccessGatewayParam>-->\n</HTML>")
execute-extended-command(nil)
call-interactively(execute-extended-command nil nil)
==================
The " *url...*" buffer looks like this:
HTTP/1.0 302 RD
Location:
http://utility.loganwifi.com/port-redirectDAZ7.asp?UI=01f981&NI=0050e801f981&UIP=192.168.1.10&MA=58B0357F2DA0&RN=898&PORT=898&RAD=yes&TUN=no&CC=no&PMS=no&OS=http://aquamacs.org%2Fcgi-bin%2Ftruncated.cgi
Content-Length: 888
=====
In parse-http-headers, redirect-uri is set (an correct), but code like the
following seems to expect something special in url-callback-arguments:
;; Check existing number of redirects
(if (or (< url-max-redirections 0)
(and (> url-max-redirections 0)
(let ((events (car url-callback-arguments))
(old-redirects 0))
(while events
(if (eq (car events) :redirect)
(setq old-redirects (1+ old-redirects)))
(and (setq events (cdr events))
(setq events (cdr events))))
(< old-redirects url-max-redirections))))
My `url-callback-arguments' here is just the callback args list that was
originally used for the url-http request as above.
I am unable to replicate due to a lack of redirecting Wifi network. This
happened at Logan airport, before signing in for the Wifi, and I reproduced the
error many times (didn't get it to work at all). I ran it in Aquamacs 2.0,
i.e., Emacs 23.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#6407: URL: error when handling redirects,
David Reitter <=