[cl-xmpp-devel] patch: connect-tls broken

Jakob Reschke jakob at resfarm.de
Fri Mar 19 18:36:55 UTC 2010


Hi,

with the most recent CVS version, connect-tls was broken for me.

Connect calls Make-instance <specified connection class> and supplies
:stanza-callback together with the equally named keyword argument for
Connect.  In the defclass of xmpp:connection, stanza-callback's
initform is 'default-stanza-callback, which seems reasonable.  But in
connect, by default nil was supplied for make-instance, leaving the
connection without any stanza-callback.  Connect-tls needs to receive
a stanza from the server, but without a stanza-callback,
receive-stanza always returns nil.  That's why Connect-tls raises an
no-applicable-method-error (nil instead of a received stanza).

I fixed the issue by passing :stanza-callback initarg and value only
if something non-nil has been supplied to Connect.  I'm using an
appending loop that checks the initargs of Connect.  I'm appending a
diff.

best regards
Jakob

cvs diff: Diffing .
Index: cl-xmpp.lisp
===================================================================
RCS file: /project/cl-xmpp/cvsroot/cl-xmpp/cl-xmpp.lisp,v
retrieving revision 1.35
diff -r1.35 cl-xmpp.lisp
101,106c101,104
<          (connection (make-instance class
<                                     :jid-domain-part jid-domain-part
<                                     :server-stream stream
<                                     :hostname hostname
<                                     :port            port
<                                     :stanza-callback stanza-callback)))
---
>          (connection (apply #'make-instance class
>                           (loop for keyword in (list :jid-domain-part :server-stream :hostname :port :stanza-callback)
>                                and value in (list jid-domain-part stream hostname port stanza-callback)
>                                when value append (list keyword value)))))




More information about the cl-xmpp-devel mailing list