From jakob at resfarm.de Fri Mar 19 18:36:55 2010 From: jakob at resfarm.de (Jakob Reschke) Date: Fri, 19 Mar 2010 19:36:55 +0100 Subject: [cl-xmpp-devel] patch: connect-tls broken Message-ID: <2f9f12b71003191136wbbe9014m837b953e18120d1c@mail.gmail.com> Hi, with the most recent CVS version, connect-tls was broken for me. Connect calls Make-instance 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))))) From jakob at resfarm.de Fri Mar 19 19:08:25 2010 From: jakob at resfarm.de (Jakob Reschke) Date: Fri, 19 Mar 2010 20:08:25 +0100 Subject: [cl-xmpp-devel] patch: connect-tls broken In-Reply-To: <2f9f12b71003191136wbbe9014m837b953e18120d1c@mail.gmail.com> References: <2f9f12b71003191136wbbe9014m837b953e18120d1c@mail.gmail.com> Message-ID: <2f9f12b71003191208m7633e576oecb8ca6c765d7fd7@mail.gmail.com> Hi, with the most recent CVS version, connect-tls was broken for me. Connect calls Make-instance 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))))) From stassats at gmail.com Tue Mar 30 17:48:18 2010 From: stassats at gmail.com (Stas Boukarev) Date: Tue, 30 Mar 2010 10:48:18 -0700 Subject: [cl-xmpp-devel] patch: connect-tls broken In-Reply-To: <2f9f12b71003191136wbbe9014m837b953e18120d1c@mail.gmail.com> References: <2f9f12b71003191136wbbe9014m837b953e18120d1c@mail.gmail.com> Message-ID: <9f0fec111003301048m4c9788a8gcfa54d13f33836ad@mail.gmail.com> On Fri, Mar 19, 2010 at 11:36 AM, Jakob Reschke wrote: > Hi, > > with the most recent CVS version, connect-tls was broken for me. > > Connect calls Make-instance 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))))) > > _______________________________________________ > cl-xmpp-devel mailing list > cl-xmpp-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/cl-xmpp-devel > I sent a patch for this before, but it wasn't applied. Can you try it instead? http://common-lisp.net/pipermail/cl-xmpp-devel/2008-August/000295.html -- With best regards, Stas.