[JDEV] Conference messages cut off

Horace Sequeira Horace.Sequeira at morganstanley.com
Wed Sep 26 11:34:37 CDT 2001


You are  welcome. We are happy to contribute to this very useful and very cool
product: Jabber. Consider it as our small contribution to the community (very
small in comparison to all the great stuff that comes down the pipe to us from
jdev and jabber.org).

We traced down the cause of the problem, if you like, we could share that with
you. It might save you a little time.We were not sure if posting the details on
jdev was the apropriate thing to do.


Jeremie wrote:

> Excellent catch!  I'm not sure I would have ever found this and sincerely
> appreciate the amount of time you put into tracking it down.
>
> I just checked in a patch which does something similiar to below, and I'll
> be testing it on a solaris box this afternoon.  I'm going to have to
> re-read the xmlnode cdata code over again to make sure I understand why it
> makes a difference in this one case, but I'll make sure any argument order
> assumptions get fixed (I hope I haven't done this anywhere else as well
> :).
>
> Many thanks from myself and others bitten by this bug,
>
> Jer
>
> On Wed, 26 Sep 2001, Horace Sequeira wrote:
>
> >
> > We have had the same problem running on Solaris 8 using Jabber 1.4.1 and
> > Conference 0.4.1
> > We have tracked the problem to the function xmlnode_insert_node()  in the
> > file xmlnode.c of the
> > Jabber server.
> >
> > The fix to the problem is to change the following statement in the
> > function xmlnode_insert_data() :
> >
> > xmlnode_insert_cdata(parent, xmlnode_get_data(node),
> > xmlnode_get_datasz(node));
> >
> > This statement will work if the function xmlnode_get_datasz() is evaluated
> > before
> > xmlnode_get_data(). This is clearly not the case on my version of the
> > jabber server compiled on Solaris with gcc. The 'C' standard does not
> > specify the order of evaluation of functions/expresssions that are passed
> > as parameters to a function, it only says that they will be evaluated -
> > the order of which  is implementation  dependent (which explains why it
> > works on some systems).
> >
> > To fix the problem we changed the statement to the following:
> >
> >    int dataSize
> >    ...
> >     dataSize = xmlnode_get_datasz(node);
> >     xmlnode_insert_cdata(parent, xmlnode_get_data(node), dataSize);
> >
> > to ensures that xmlnode_get_datasz() is evaluated first.
> >
> > This works for us; if there is another fix for this please let us know.
> >
> >
> > Jens Alfke wrote:
> >
> > > On Thursday, September 20, 2001, at 10:35 PM, jabber at msg.net wrote:
> > >
> > > > I am also  getting conference messages truncated, often at the first
> > > > byte
> > > > of a one-liner. Using JabberIM I will type something like:
> > > >
> > > >       I see this problem too, looks like it is a bug in the server?
> > > >
> > > > And what the participants see and what I get echoed back is just:
> > > >
> > > >       I
> > >
> > > I haven't seen this exact behavior. What I see is that messages get
> > > truncated at XML metacharacters ( <, >, ', ", &). In my client I
> > > preprocess messages to convert these to more innocuous characters such
> > > as curly quotes.
> > >
> > > --Jens
> > >
> > > _______________________________________________
> > > jdev mailing list
> > > jdev at jabber.org
> > > http://mailman.jabber.org/listinfo/jdev
> >
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev




More information about the JDev mailing list