[cl-xmpp-cvs] CVS cl-xmpp
jstecklina
jstecklina at common-lisp.net
Sat Mar 3 18:42:08 UTC 2007
Update of /project/cl-xmpp/cvsroot/cl-xmpp
In directory clnet:/tmp/cvs-serv3081
Modified Files:
cl-xmpp.lisp
Log Message:
Fixed READ-STANZA for recent CXML versions. Kludge. Please improve.
--- /project/cl-xmpp/cvsroot/cl-xmpp/cl-xmpp.lisp 2006/08/28 21:17:08 1.28
+++ /project/cl-xmpp/cvsroot/cl-xmpp/cl-xmpp.lisp 2007/03/03 18:42:08 1.29
@@ -1,4 +1,4 @@
-;;;; $Id: cl-xmpp.lisp,v 1.28 2006/08/28 21:17:08 jstecklina Exp $
+;;;; $Id: cl-xmpp.lisp,v 1.29 2007/03/03 18:42:08 jstecklina Exp $
;;;; $Source: /project/cl-xmpp/cvsroot/cl-xmpp/cl-xmpp.lisp,v $
;;;; See the LICENSE file for licensing information.
@@ -316,6 +316,16 @@
(when stanza-callback
(car (funcall stanza-callback stanza connection :dom-repr dom-repr)))))))
+;;; XXX: Kludge. Newer versions of CXML rebind *namespace-bindings*
+;;; inside of parse-xstream, so the old method of augmenting
+;;; *namespace-bindings* inside of read-stanza does not work any
+;;; longer. - Julian Stecklina (Mar 03, 2007)
+
+(unless (assoc #"stream" cxml::*initial-namespace-bindings*
+ :test #'runes:rod=)
+ (push (cons #"stream" #"http://etherx.jabber.org/streams")
+ cxml::*initial-namespace-bindings*))
+
(defun read-stanza (connection)
(unless (server-xstream connection)
(setf (server-xstream connection)
@@ -327,13 +337,9 @@
:uri nil))))
(force-output (server-stream connection))
(catch 'stanza
- (let ((cxml::*namespace-bindings*
- (acons #"stream"
- #"http://etherx.jabber.org/streams"
- cxml::*namespace-bindings*)))
- (cxml::parse-xstream (server-xstream connection)
- (make-instance 'stanza-handler))
- (runes::write-xstream-buffer (server-xstream connection)))))
+ (cxml::parse-xstream (server-xstream connection)
+ (make-instance 'stanza-handler))
+ (runes::write-xstream-buffer (server-xstream connection))))
(defmacro with-xml-stream ((stream connection) &body body)
"Helper macro to make it easy to control outputting XML
More information about the Cl-xmpp-cvs
mailing list