Hello,
I think this question has more to do with Slime, but I'm Cc'ing Drakma because it might be related. I'm in a situation where drakma:http-request seems to get stuck as soon as I want to retreive the BODY of a request. To simplify consider something like this:
(defun foo () (multiple-value-bind (body status headers from-uri from-stream must-close reason) (http-request ...) (values body headers)))
With *header-stream* set to standard output, I can see the transaction going on until the end, but then the Slime repl doesn't return. I can type comma and then slime commands, C-c C-c has no effect, and if I type something in the repl buffer, I get this on the XEmacs minibuffer window:
; pipelined request... (swank:listener-eval " ")
(note the CR)
On the contrary, if I comment out the (values ...) form in my function, the request completes and Slime gives me the prompt back.
Any hint on what's going on would be appreciated. And BTW, how do I get of such a situation in Slime ?
Thanks !
I wrote:
I'm in a situation where drakma:http-request seems to get stuck as soon as I want to retreive the BODY of a request.
One additionnal piece of information: if I set :force-binary, the problem goes away. The server is sending a content type of UTF-8. My XEmacs (21.4) can't handle UTF-8, but I don't think it's a problem (I think some displayed characters would be messed up, that's all).
Hi Didier. I've tried you code for google.com - works for me.
It is unlikely from my point of view that the problem is in drakma. Looks like slime can't print you values. There are plenty of ways you can isolate the root of the problem.
Try to save values returned by http-request in variables to avoid printing them by slime:
(defun foo () (multiple-value-bind (body status headers from-uri from-stream must-close reason) (http-request "http://google.com") (setq b body h headers) nil ;;(values body headers) ))
Then you may just evaluate b or h and see what happens. If the printing of srting assigned to b leads to troubles, you may find problematic part of the string place by printing only part of string (splitting it to halves or just print it char by char)
You also may try you code without slime, running it directly in you lisp.
Or you can use :force-binary and then save returned array to file and then alanyze it.
Regards, -Anton
Didier Verna:
Hello,
I think this question has more to do with Slime, but I'm Cc'ing Drakma because it might be related. I'm in a situation where drakma:http-request seems to get stuck as soon as I want to retreive the BODY of a request. To simplify consider something like this:
(defun foo () (multiple-value-bind (body status headers from-uri from-stream must-close reason) (http-request ...) (values body headers)))
With *header-stream* set to standard output, I can see the transaction going on until the end, but then the Slime repl doesn't return. I can type comma and then slime commands, C-c C-c has no effect, and if I type something in the repl buffer, I get this on the XEmacs minibuffer window:
; pipelined request... (swank:listener-eval " ")
(note the CR)
On the contrary, if I comment out the (values ...) form in my function, the request completes and Slime gives me the prompt back.
Any hint on what's going on would be appreciated. And BTW, how do I get of such a situation in Slime ?
Thanks !
Anton Vodonosov vodonosov@mail.ru wrote:
It is unlikely from my point of view that the problem is in drakma.
I agree. I investigated a little further (dumped the body to a file etc) and couldn't find any particular character that would cause the problem in it. However, since then, I discovered that the problem doesn't occur when I use ACL as the Lisp engine. I normally use SBCL, which probably has something to do with the problem, then.
I'm also sure that Slime has its part in it in some way. Running the same code directly in the Lisp engine (either ACL or SBCL BTW) works fine. On the other hand, running Slime / SBCL within XEmacs (either in an X frame, or on a tty) makes the problem appear.
I'll continue investigating...