Hi, here's the full patchset that I developed against
version 0.6. If I have to post updates I'll probably
post them against this base for now.
Note that these patches supersede all my previous
patches, so you may delete the rest.
I include an explanation of each patch below. Please
apply to a clean 0.6 distribution. All the patches can
be applied in any order except for jymsg-big.diff,
which should be applied last. Most patches are
independent from each other, but I couldn't split
jymsg-big further because it mainly affects
Session.java which is huge.
Warning, the source code must be placed according to
the package. For instance, Session.java should be
placed in directory ymsg/network and not in SNetwork,
and SessionEvent.java should be placed in
ymsg/network/event. I had to do so because Eclipse
won't accept your layout, and because the packages are
overcrowded as they are. Another way around this is to
search and replace the directory names in the patches.
I would really appreciate it if you applied all or most
of these patches to the core distribution, as
maintaining 150+ kB worth of patches is not an easy
task. If you're not fully satisfied with some of the
changes, please let me know why and I'll try to fix that.
And now the patches:
jymsg-big.diff
The "huge patch." Must be applied last as it requires
some of the other patches (namely chat and packets, but
maybe others as well).
1) Properly handle group rename server response. Not by
me, and I don't use this feature. The author authorized
me to distribute this patch, but wishes to remain
anonymous.
2) Changed per-instance ping thread to a static timer
that handles the pings. This reduces thread usage from
4*n to 3*n+1 and should be as effective as the old
implementation (probably more because of the reduced
context switching0.
3) Changed per-event FireEvent thread to a per-instance
queue. This reduces thread usage from 3*n+1 (after
previous patch) to 2*n+2. This speeds up some scenarios
significantly where many events are triggered (like
log-in with large buddy lists), and also fixes the case
where events come off-order, thus confusing the client
application (i.e., user status changes before the user
has been introduced; chat messages before the chat has
been "connected," etc.).
4) Asynchronous log-in. See
http://sourceforge.net/tracker/index.php?func=detail&aid=1106880&group_id=76691&atid=547951
.
5) Asynchronous chat log-in, see previous item.
6) Made status fields volatile to work a bit better in
multi-thread scenarios. Still big parts of the library,
especially Session, need more work on this area. Note
that I'm not thinking about re-entrance, just
sequential multi-thread access to the member fields.
7) Support to create chat rooms and to invite users and
respond to chat invitations.
8) Changed all packet data keys from String to int in
an attempt to reduce static data and overhead (during
comparison). See jymsg-packets below for more information.
9) A few sparse fixes.
jymsg-chat.diff
All the changes necessary to add chat room creation and
user invitation support, except those in Session.java.
jymsg-cryptperf.diff
Same as
http://sourceforge.net/tracker/index.php?func=detail&aid=1170285&group_id=76691&atid=547951
, except for an additional simplification of the byte
to int conversion.
jymsg-entitydecode.diff
Same as
http://sourceforge.net/tracker/index.php?func=detail&aid=1171113&group_id=76691&atid=547951
.
jymsg-msgelem-checks.diff
Perform boundary checks on the input element tags.
These checks are necessary to avoid uncatched
exceptions with malformed color tags.
jymsg-newmail.diff
This one is originally not mine (the original author
authorized me to release the patch, but wishes to
remain anonymous). I maintained it and added a small fix.
It makes the mail count field reflect the real count of
mails in the mail-box, not the one of the last packet.
jymsg-packets.diff
1) Adds a way for the caller to retrieve the
InetSocketAddress of the server (I need this for
logging purposes).
2) See
http://sourceforge.net/tracker/index.php?func=detail&aid=1167916&group_id=76691&atid=547951
.
3) Changed all packet data keys from Strings to
integers. Originally I used shorts, but the compiler
insisted that I had to add casts from integer to short
and that would have made the code ugly. The idea is to
reduce the static data and also make packet data
indexing more effective (still not implemented, but I
might add that feature).
jymsg-serializable.diff
Declares some classes as serializable. Also helps shut
Findbugs up :-)
jymsg-timertask.diff
Simple JDK 1.1 compatible implementation of
java.util.TimerTask. This implementation is not as
featureful as the other, but it's enough to handle
PingTaskS.
jymsg-warn.diff
Fixes miscellaneous Findbugs reported warnings. There
is an important fix for a mishandling of an InputStream
in the EmotesManager. The fix compiles, but it hasn't
been tested because I don't use that code.