[drakma-devel] Re: New version 0.4.4 (Was: Couple of problems)

Ivan Toshkov ivan at toshkov.org
Sun Sep 24 22:12:35 UTC 2006


On 9/24/06, Edi Weitz <edi at agharta.de> wrote:
> Hi!
>
> On Sun, 24 Sep 2006 09:41:04 +0300, "Ivan Toshkov" <ivan at toshkov.org> wrote:
>
> > First of all, thank you Edi Weitz for your excellent libraries.  I
> > find them simple to use, well thought out, and with excellent
> > documentation.  Again, a big thank you.
>
> You're welcome... :)
>
> > And thanks to whoever is working on porting Drakma.
>
> I think that's me... :)

Right.  I was under the wrong impression that the port was done by
Zach Beane, because I read about it on his blog.

>
> > I found a couple of problems:
> >
> > Drakma cannot receive cookies from localhost.  After a short
> > investigation I found that the problem was with the method
> > VALID-COOKIE-DOMAIN-P, which insist to have at least 2 dots in the
> > normalized domain name.  As a workaround I used 127.0.0.1 instead of
> > localhost.
>
> Thanks for the report, I've released a new version (0.4.4) which fixes
> this.
>

Great.  And I already have another one.  The funcall

(drakma:http-request "http://www.openrdf.org/sesame/servlets/listRepositories")

returns:

NIL
200
((:CACHE-CONTROL . "no-cache") (:EXPIRES . "0") (:PRAGMA . "no-cache")
  (:CONTENT-TYPE . "text/xml") (:DATE . "Sun, 24 Sep 2006 21:52:34 GMT")
 (:SERVER . "Apache-Coyote/1.1") (:CONNECTION . "close"))
#<URI http://www.openrdf.org/sesame/servlets/listRepositories>
#<FLEXI-STREAMS:FLEXI-IO-STREAM {B579D01}>
T

while the browser shows a small XML.  I traced the problem to the
READ-BODY function, which assumes (perhaps rightly so) that if the
content length header is missing the stream must be a chunked stream.
In this case it's not and so READ-BODY returns NIL.

(please check my excuse for not providing any patches at the bottom of
this email.)

> > The other problem is with an incomplete implementation of
> > flexi-streams under CMUCL.  The call:
> >
> >> (drakma:http-request "http://www.google.com/" :parameters '(("q" . "something")))
> >
> > works normally, but
> >
> >> (drakma:http-request "http://www.google.com/search" :parameters '(("q" . "something")))
> >
> > gives:
> >
> > No matching method for the generic function
> > #<STANDARD-GENERIC-FUNCTION INPUT-STREAM-P (2) {58E17501}>, when called with
> > arguments (#<FLEXI-STREAMS::VECTOR-OUTPUT-STREAM {5834F8FD}>).
> >    [Condition of type PCL::NO-APPLICABLE-METHOD-ERROR]
> >
> >   0: ("DEFMETHOD NO-APPLICABLE-METHOD (T)" #<#1=unused-arg> #<#1#>
> > #<STANDARD-GENERIC-FUNCTION INPUT-STREAM-P (2) {58E17501}>
> > (#<FLEXI-STREAMS::VECTOR-OUTPUT-STREAM {5834F8FD}>))
> >   1: (FLEXI-STREAMS:MAKE-FLEXI-STREAM
> > #<FLEXI-STREAMS::VECTOR-OUTPUT-STREAM {5834F8FD}> :EXTERNAL-FORMAT
> > :LATIN-1)
> >   2: (FLEXI-STREAMS:STRING-TO-OCTETS "q" :EXTERNAL-FORMAT :LATIN-1 :START ...)
> >   3: (DRAKMA::URL-ENCODE "q" :LATIN-1)
> >   4: (DRAKMA::ALIST-TO-URL-ENCODED-STRING (("q" . "something")) :LATIN-1)
> >   5: (DRAKMA:HTTP-REQUEST #<URI http://www.google.com/search>
> > :PARAMETERS (("q" . "something")))
> >
> > I don't have time at the moment to see if anything else is missing
> > and to give patches.  For this case though the workaround seems to
> > be as simple as:
> >
> > (defmethod input-stream-p ((s flexi-streams::vector-output-stream)) nil)
>
> If I understand the Gray streams proposal correctly, this isn't an
> incompleteness in FLEXI-STREAMS, but a problem in CMUCL's Gray streams
> implementation.  Are you using the newest version of CMUCL?

CMUCL 19c.

> Have you asked on their mailing list?

I haven't.  Please check the excuse again :)

> (It is also not clear to me why the problem only surfaces with the longer URL because URL-ENCODE has to be
> called in both cases.)

I thought it was caused by the :parameters keyword, but I actually
haven't looked at the code.

>
> Cheers,
> Edi.
>

EXCUSE: I have to make this legacy Lisp app to talk to a Java web app
and I have to do it by Tuesday for a demo.  So I don't have the time
to do "the right thing" right now and I'm doing the minimal fixes
required.

Cheers,
Ivan

-- 
"...Please don't assume Lisp is only useful for Animation and Graphics,
AI, Bioinformatics, B2B and E-Commerce, Data Mining, EDA/Semiconductor
applications, Expert Systems, Finance, Intelligent Agents, Knowledge
Management, Mechanical CAD, Modeling and Simulation, Natural Language,
Optimization, Research, Risk Analysis, Scheduling, Telecom, and Web
Authoring just because these are the only things they happened to
list."
  -- Kent Pitman



More information about the Drakma-devel mailing list