[JDEV] jabberd 1.4.2: problems with yahoo-t / msn-t

Matthias Wimmer jabber at matthias-wimmer.de
Tue Feb 26 05:13:26 CST 2002


Hi Peter!

Peter Fales schrieb am 2002-02-25 17:06:44:
> MSN Transport has been broken for me since upgrading to jabberd-1.4.2.  I've
> tried switching back and forth a few times, and it consistently works under
> 1.4.1 and fails (Remote Server Error) under 1.4.2.  Is this related to 
> same problem?  What did you do to fix Yahoo?  Can the same fix be
> applied to MSN transport?

Maybe I should check my MSN transport too - I don't use it myself
because I don't have a passport account :)

When yahoo-transport is receiving a <presence> it checks if there is
already a connection for that user to the Yahoo! server. The sessions
are saved in a hash. If no session exists it starts a new one, this is
done in yahoo_session_create (sessions.c).
The problems is: yahoo-t checks for an existing session ... does some
other things ... connects to the yahoo server ... does some other things
... inserts the session to the hash.

With the new jabberd the transport often gets two presence tags from the
same user at nearly the same time. Because jabberd is (sort of)
multithreaded these two <presence> tags are handled "at the same time".
If the session for the first <presence> is not yet in the hash the
second <presence> is also handled and yahoo-transport starts a second
connect to the yahoo server. The yahoo server then disconnects the first
session and yahoo-transport responds by sending an unavailable back to
the user.

I "fixed" the problem by changing the execution chain for <presence>:
yahoo-t checks for an existing session ... does some other things
... (new:) checks again for an existing session ... connects to the
yahoo server ... (earlier:) inserts the session to the hash ... does
some other things. (See the changes in yahoo_session_create in sessions.c in
my version of yahoo-t)

Maybe I should note that this is only a "quick fix". Better would be to
introduce mutexes to secure data structures while they are not in a
consistent state.


Tot kijk
   Matthais
-- 
Fon: +49-(0)70 0770 07770               http://matthias-wimmer.de/
Fax: +49-(0)89 312 88 654               jabber:mawis at charente.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20020226/738fb2a8/attachment-0002.pgp>


More information about the JDev mailing list