One thing, that I stumbled upon working with Drakma, is the treatment of EOL in Chunga.<div>Maybe, (setf chunga:*accept-bogus-eols* t) might help.</div><div><br></div><div>Best,</div><div>Vsevolod<br>
<br><br><div class="gmail_quote">On Thu, Jul 7, 2011 at 10:20 AM, Oleg Sivokon <span dir="ltr"><<a href="mailto:olegsivokon@gmail.com">olegsivokon@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr">Hi Austin. I did try parsing the same XML outside the acceptor function, but using the same code, and it worked. It also worked if I did like you suggested:<div><br></div><div><div class="im"><div>(defun analytics-service ()</div>
<div> (save-parsed-events</div><div> (dom:first-child</div></div><div> (with-input-from-string</div><div><span style="white-space:pre-wrap"> </span>(stream (hunchentoot:raw-post-data</div><div><span style="white-space:pre-wrap"> </span> :request hunchentoot:*request* </div>
<div><span style="white-space:pre-wrap"> </span> :force-text t))</div><div> (cxml:parse-stream stream) </div><div> (cxml-dom:make-dom-builder))))</div><div> "ok")</div></div><div><br>
</div><div>i.e. if I change the acceptor to look like this - no error and the data is parsed and logged, streams closed etc. It only happens in my original code. I also read in docs that </div><div><br></div><div>If, however, you provide a true value for want-stream, the other parameters are ignored and you'll get the content (flexi) stream to read from it yourself. It is then your responsibility to read the correct amount of data, because otherwise you won't be able to return a response to the client. The stream will have its octet position set to 0. If the client provided a Content-Length header, the stream will also have a corresponding bound, so no matter whether the client used chunked encoding or not, you can always read until EOF. </div>
<div><br></div><div>I've verified that content-length is correct, there isn't a null byte (Flash sends null byte if you are using XMLSocket class, but this is an HTTP request made by URLLoader). So it looks like something wrong with the stream generated by Hunchentoot, or, probably CXML doesn't like that particular kind of streams?</div>
<div><br></div><div>Best.</div><div><br></div><font color="#888888"><div>Oleg</div></font></div>
<br>_______________________________________________<br>
tbnl-devel site list<br>
<a href="mailto:tbnl-devel@common-lisp.net">tbnl-devel@common-lisp.net</a><br>
<a href="http://common-lisp.net/mailman/listinfo/tbnl-devel" target="_blank">http://common-lisp.net/mailman/listinfo/tbnl-devel</a><br></blockquote></div><br></div>