From kcrosbie at ravenpack.com Thu Nov 29 10:25:18 2007 From: kcrosbie at ravenpack.com (Kevin Crosbie) Date: Thu, 29 Nov 2007 11:25:18 +0100 Subject: [cl-xmpp-devel] [Fwd: Ending an session] Message-ID: <474E938E.6070401@ravenpack.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've been using cl-xmpp to do some work with eJabberd. I was putting a little work into error handling, so I removed the line from receive-stanza: (error "Received error" stanza) instead I provided a handle method that dispatched on xmpp-protocol-error. This worked fine, and in most cases, I can continue afterwards. There are two exceptions however: 1. If the server is killed for some reason, I get the error: Error: Document not well-formed: Bad nesting. "stream:stream" / (:EOF) [condition type: WELL-FORMEDNESS-VIOLATION] in receive stanza 2. If I login with the same details simultaneously I see a "Conflict: Replaced by new connection" error being handled and straight away, the same error: Error: Document not well-formed: Bad nesting. "stream:stream" / (:EOF) [condition type: WELL-FORMEDNESS-VIOLATION] This, I assume is due to the server having sent the tag: which the client should interpret as the end of the session, but instead is thrown as an error by cxml or klacks because it doesn't see it as having been opened. My questions are: * Am I correct in my assumption? * If not, what is causing the Bad nesting error * If I am correct, how can I go about fixing this? One would imagine that the server-source should retain enough information about the context of the xml document to know that this tag matches a previously opened tag. Best Regards, Kevin Crosbie Software Engineer -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHTpONEdUcNFP15iMRApuuAKC9rNQW/uRhWYlxmNcgNjcPcE6iRgCfXKZ5 Agcs1egbPmH+2fQ8cvK2AUI= =PmhL -----END PGP SIGNATURE----- From david at lichteblau.com Thu Nov 29 10:52:39 2007 From: david at lichteblau.com (David Lichteblau) Date: Thu, 29 Nov 2007 11:52:39 +0100 Subject: [cl-xmpp-devel] [Fwd: Ending an session] In-Reply-To: <474E938E.6070401@ravenpack.com> References: <474E938E.6070401@ravenpack.com> Message-ID: <20071129105238.GA12490@radon> Quoting Kevin Crosbie (kcrosbie at ravenpack.com): > Error: Document not well-formed: Bad nesting. "stream:stream" / (:EOF) > [condition type: WELL-FORMEDNESS-VIOLATION] > > This, I assume is due to the server having sent the tag: > I believe the error message says that was expected, and EOF seen instead. Are you sure the server actually sends a closing tag? Perhaps it just closed the connection. (It would be better to handle that without erroring out, of course. I could try to add an end-of-file condition to cxml that is more specific than WELL-FORMEDNESS-VIOLATION for this purpose.) Might as well be a bug somewhere in cl-xmpp, of course. d. From kcrosbie at ravenpack.com Thu Nov 29 11:23:04 2007 From: kcrosbie at ravenpack.com (Kevin Crosbie) Date: Thu, 29 Nov 2007 12:23:04 +0100 Subject: [cl-xmpp-devel] [Fwd: Ending an session] In-Reply-To: <20071129105238.GA12490@radon> References: <474E938E.6070401@ravenpack.com> <20071129105238.GA12490@radon> Message-ID: <474EA118.6090503@ravenpack.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thanks for the reply David, David Lichteblau wrote: > I believe the error message says that was > expected, and EOF seen instead. Are you sure the server actually > sends a closing tag? Perhaps it just closed the connection. (It > would be better to handle that without erroring out, of course. I > could try to add an end-of-file condition to cxml that is more > specific than WELL-FORMEDNESS-VIOLATION for this purpose.) > In the second case, that of the server being killed, I think you're correct. In the first case, that of a conflict, I used Wireshark and verified that the server sent: Replaced by new connection So it looks like it is sending the The error: Error: Document not well-formed: Bad nesting. "stream:stream" / (:EOF) [condition type: WELL-FORMEDNESS-VIOLATION] is thrown, but I wonder is this because the socket is closed by the server at this point. > > Might as well be a bug somewhere in cl-xmpp, of course. Perhaps cl-xmpp needs to catch the :EOF and throw stream closed or stop the receive-stanza-loop, something that a cl-xmpp client can deal with. Kevin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHTqEYEdUcNFP15iMRAu7MAJ9/B4ocaH4UET6IU+W2hjGFtfznOgCeOQzQ zVmpWC83D2LpubGGJwUU2Qo= =K5zB -----END PGP SIGNATURE-----