[jdev] Public Server with Compression Available
JD Conley
jd.conley at coversant.net
Mon Jan 9 20:12:25 CST 2006
I thought I'd fire off a little update. I've heard from four different
client project developers. They were all able to get zlib based
compression working with only a few little stumbling blocks. There are
some truly impressive compression ratios being generated over time! I'll
let them divulge that information, though.
Here were some of our stumbling blocks:
1) If you have control over the zlib header and checksum footer for
DEFLATE (only supported by some libraries) you need to make sure you
include them.
2) Make sure you flush your deflater instance so it completely
compresses the input buffer. If you're using the reference
implementation (http://www.zlib.net/) this is done by passing a
Z_SYNC_FLUSH. You don't want to do a Z_FINISH, as you should preserve
the dictionary for the entire XMPP stream for better compression.
3) Keep an instance of your inflater and deflater around for each socket
connection.
4) Don't assume that one read from a socket will yield you something
that can be inflated. Also don't assume once you get an inflated buffer
that it will be a stanza.
If anybody else wants to test on beta.soapbox.net, feel free. The server
is still running (and has S2S enabled now).
-JD Conley
More information about the JDev
mailing list