[armedbear-devel] EXT:URL-PATHNAME vs http: as a logical pathname

Hello all, I am trying to compile cl-http on abcl. Mostly got it loading, but have some problems with abcls url-pathnames. Example: CL-USER> (lisp-implementation-version) "1.2.1" "Java_HotSpot(TM)_64-Bit_Server_VM-Apple_Inc.-1.6.0_51-b11-456-11M4508" "x86_64-Mac_OS_X-10.8.4" CL-USER> (lisp-implementation-type) "Armed Bear Common Lisp" CL-USER> (setf (logical-pathname-translations "http") '( ("port;**;*.*" "/Users/karstenpoeck/Documents/workspace/trunk/contrib/kpoeck/port-templa te/**/*.*") ("**;*.*" "/Users/karstenpoeck/Documents/workspace/trunk/**/*.*") ) ) ((#P"HTTP:PORT;**;*.*" #P"/Users/karstenpoeck/Documents/workspace/trunk/contrib/kpoeck/port-temp late/**/*.*") (#P"HTTP:**;*.*" #P"/Users/karstenpoeck/Documents/workspace/trunk/**/*.*")) ;;;; the problem is here CL-USER> (translate-logical-pathname "http:declaration.lisp") #P"http:" If I do the same with httpx: instead of http:, the code loads fine. The reason is probably the following. CL-USER> (type-of (pathname "http:declaration.lisp")) URL-PATHNAME Later starting up cl-hhtp i get: http:www;foo.html has a null authority. http:www;foo.html has a null authority. http:proxy-cache; has a null authority. http:pw;random-seed.lisp has a null authority. java.lang.NullPointerException at sun.net.www.ParseUtil.toURI(ParseUtil.java:261) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnectio n.java:905) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.jav a:836) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnect ion.java:1172) at java.net.URL.openStream(URL.java:1010) at org.armedbear.lisp.Pathname.getInputStream(Pathname.java:2369) .... I completely understand that it is desirable to have (load "http://beta.quicklisp.org/quicklisp.lisp") working, but can't you check for "http://" or "https://" before converting a pathname to an url-pathname? Karsten

On 8/12/13 9:55 PM, Karsten Poeck wrote: […]
I completely understand that it is desirable to have (load "http://beta.quicklisp.org/quicklisp.lisp") working, but can't you check for "http://" or "https://" before converting a pathname to an url-pathname?
A quite reasonable request. URL-PATHNAME objects are actually supposed to be strictly defined as a [URI][1], which we can distinguish by having a "/" immediately after the ":" so I think we are in good shape to implement this in a sane manner that covers all possible cases, not those just with "http" and "https" schemas. Filed as [ticket][#327]. [1]: https://en.wikipedia.org/wiki/URI_scheme#Generic_syntax [#327]: http://lisp.not.org/trac/armedbear/ticket/327 -- "A screaming comes across the sky. It has happened before, but there is nothing to compare to it now."

On Aug 14, 2013, at 0056 , Mark Evenson <evenson@panix.com> wrote:
[] URL-PATHNAME objects are actually supposed to be strictly defined as a [URI][1], which we can distinguish by having a "/" immediately after the ":" so I think we are in good shape to implement this in a sane manner that covers all possible cases, not those just with "http" and "https" schemas.
err "schemes" not "schemas". -- "A screaming comes across the sky. It has happened before but there is nothing to compare to it now."
participants (2)
-
Karsten Poeck
-
Mark Evenson