[cxml-devel] READ-TOKEN-3 bad data from CL+SSL stream?

Erik Enge erik.enge at gmail.com
Mon Nov 14 21:20:19 UTC 2005


Using CVS cl-xmpp, cl+ssl and the latest cxml release I get the
following error when trying to parse xml from the ssl stream:


* (defparameter *c* (xmpp:connect-tls :hostname "talk.google.com"
:jid-domain-part "gmail.com"))

<?xml version='1.0' ?><stream:stream to='gmail.com'
xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'
version='1.0'><?xml version="1.0" encoding="UTF-8"?version="1.0"
encoding="UTF-8"><stream:stream from="gmail.com" id="8D040D109BF0BC76"
version="1.0" xmlns:stream="http://etherx.jabber.org/streams"
xmlns="jabber:client"
UNHANDLED: #<XML-ELEMENT STREAM:STREAM (3:0:0) {B6DA4D1}>
><stream:features><starttls
xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><mechanisms
xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>X-GOOGLE-TOKEN</mechanism></mechanisms></stream:features
UNHANDLED: #<XML-ELEMENT STREAM:FEATURES (0:2:0) {B6E5979}>
<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>><proceed
xmlns="urn:ietf:params:xml:ns:xmpp-tls"/
UNHANDLED: #<XML-ELEMENT PROCEED (0:0:0) {B6ECC41}>
<?xml version='1.0' ?><stream:stream to='gmail.com'
xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'
version='1.0'>

*C*

* (xmpp:auth *c* "username" "password" "clxmpp" :sasl-plain)

<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'/>>
debugger invoked on a SIMPLE-ERROR: Unexpected character #\Etb.

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(CXML::READ-TOKEN-3
 #S(CXML::ZSTREAM
    :TOKEN-CATEGORY NIL
    :TOKEN-SEMANTIC NIL
    :INPUT-STACK (#<RUNES::XSTREAM NIL>)))
0] :backtrace
0: (CXML::READ-TOKEN-3
    #S(CXML::ZSTREAM
       :TOKEN-CATEGORY NIL
       :TOKEN-SEMANTIC NIL
       :INPUT-STACK (#<RUNES::XSTREAM NIL>)))
1: (CXML::PEEK-TOKEN
    #S(CXML::ZSTREAM
       :TOKEN-CATEGORY NIL
       :TOKEN-SEMANTIC NIL
       :INPUT-STACK (#<RUNES::XSTREAM NIL>)))
2: (CXML::P/DOCUMENT
    #S(CXML::ZSTREAM
       :TOKEN-CATEGORY NIL
       :TOKEN-SEMANTIC NIL
       :INPUT-STACK (#<RUNES::XSTREAM NIL>))
    #<CL-XMPP::STANZA-HANDLER {B799909}>
    :VALIDATE
    NIL
    :DTD
    NIL
    :ROOT
    NIL
    :ENTITY-RESOLVER
    NIL
    :DISALLOW-INTERNAL-SUBSET
    NIL)
3: (CXML::PARSE-XSTREAM
    #<RUNES::XSTREAM NIL>
    #<CL-XMPP::STANZA-HANDLER {B799909}>)
4: (CL-XMPP::READ-STANZA
    #<CL-XMPP:CONNECTION to talk.google.com:5222 (open) {B75D929}>)
5: ((SB-PCL::FAST-METHOD CL-XMPP:RECEIVE-STANZA (CL-XMPP:CONNECTION))
    #<unavailable argument>
    #<unavailable argument>
    #<CL-XMPP:CONNECTION to talk.google.com:5222 (open) {B75D929}>
    NIL)
6: ((SB-PCL::FAST-METHOD CL-XMPP::HANDLE-CHALLENGE-RESPONSE
                         (CL-XMPP:CONNECTION T T T))
    #<unavailable argument>
    #<unavailable argument>
    #<CL-XMPP:CONNECTION to talk.google.com:5222 (open) {B75D929}>
    "username"
    "password"
    "PLAIN")
7: (SB-INT:EVAL-IN-LEXENV
    (CL-XMPP:AUTH *C* "username" "password" "clxmpp" :SASL-PLAIN)
    #<NULL-LEXENV>)
8: (INTERACTIVE-EVAL
    (CL-XMPP:AUTH *C* "username" "password" "clxmpp" :SASL-PLAIN))
9: (SB-IMPL::REPL-FUN NIL)
10: ((LAMBDA ()))
11: ((LAMBDA ()))
12: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE (LAMBDA #) {ACDA1FD}>)
13: (SB-IMPL::TOPLEVEL-REPL NIL)
14: (SB-IMPL::TOPLEVEL-INIT)
15: ((LABELS SB-IMPL::RESTART-LISP))

0]


Perhaps I'm missing something and have missed a step in how to convert
my stream to an SSL stream.  Here's the code:

  (setf (server-stream connection)
	(cl+ssl:make-ssl-client-stream (server-stream connection))

Then I proceed to write and read to the stream as if it were an
(unsigned-byte 8) stream just like the original one.  Is this correct?

What's that Unknown character #\Etb about?  I would've expected at
this point to get <?xml version='1.0' ?> from the server.

Any pointers would be helpful.

Thanks,
Erik.



More information about the cxml-devel mailing list