On Fri, 12 Oct 2007 00:05:46 -0400, "Andrei Stebakov" lispercat@gmail.com wrote:
I run across this error time after time but it's really hard to reproduce but I can replicate exactly the same backtrace of the problem if instead of some valid http domain I choose any fake one. If I run: (drakma:http-request "http://some-fake-domain.com" :method :get :parameters `(("param1" . "text")))
The backtrace will be:
The value 0 is not of type (OR (SINGLE-FLOAT (0.0)) (DOUBLE-FLOAT (0.0d0)) (INTEGER 1)). [Condition of type TYPE-ERROR]
Restarts: 0: [ABORT] Return to SLIME's top level. 1: [ABORT] Exit debugger, returning to top level.
Backtrace: 0: (RANDOM 0) 1: (USOCKET::GET-RANDOM-HOST-BY-NAME "some-fake-domain.com") 2: (USOCKET:SOCKET-CONNECT "some-fake-domain.com" 80) 3: (DRAKMA:HTTP-REQUEST "http://some-fake-domain.com") 4: (SB-INT:SIMPLE-EVAL-IN-LEXENV (DRAKMA:HTTP-REQUEST "http://some-fake-domain.com" :METHOD :GET :PARAMETERS '(("param1" . "text"))) #<NULL-LEXENV>) 5: ((LAMBDA ()))
In my case it looks like sometimes even for the real domain it calls (RANDOM 0) which gives this log. Even if the domain is wrong do you think it should throw an exception? I use SBCL 1.0.5. with the latest drakma and usocket (usocket-0.3.2).
I'm afraid this looks like a usocket problem and you should ask on their mailing list. Andreas Fuchs and others convinced me to switch Drakma from trivial-sockets to usocket, and one of their arguments was that trivial-sockets is unmaintained while usocket has an active developer community. So, you can now check if they were right... :)
Cheers, Edi.