[JDEV] Jabber message delivered to wrong recipient

Matthias Wimmer m at tthias.net
Sat Oct 11 08:55:41 CDT 2003

Hi List!

Matthias Wimmer schrieb am 2003-10-10 22:45:23:
> I am aware of this problem for some time, as it can happen on my server
> (amessage) as well. I described the cause for this problem in:
> http://mailman.jabber.org/pipermail/jdev/2003-August/016267.html
> Just yesterday I had the time to search for a solution of this problem
> and have written some code that detects missdirected packets so they are
> not delivered to wrong users. I'll publish this patch soon to be
> discussed.

Actually the fix for this problem is very small, just one line in jadc2s
has to be changed. With this patch jadc2s (the client connection manager
used at jabber.org as well as on some other bigger servers) checks if a
connection is owned by the user that is the expected receipient of a
packet. If not its bounced to the session manager that than knows that
the connection of the former user does not longer exist.

Tot kijk

--- jadc2s/connect.c	2003-09-23 00:28:16.000000000 +0200
+++ jadc2s-fromcheck/connect.c	2003-10-11 15:42:33.000000000 +0200
@@ -246,7 +246,7 @@
     log_debug(ZONE,"sm sent us a chunk for %s", cid);
     /* either bounce or send the chunk to the client */
-    if(target->fd >= 0)
+    if(target->fd >= 0 && j_strcmp(jid_full(target->smid), str) == 0)
         chunk_write(target, chunk, NULL, NULL, NULL);
         chunk_write(c, chunk, str, cid, "error");

For kibibytes see:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20031011/8c01e339/attachment-0002.pgp>

More information about the JDev mailing list