Skip navigation
7093 Views 15 Replies Latest reply: Nov 7, 2010 2:14 PM by Mani Obhrai RSS
Juga Paazmaya KeyContributor 266 posts since
Oct 23, 2007
Currently Being Moderated

Jul 30, 2009 6:58 AM

XEP-0138: Stream Compression

I am starting to work on this in XIFF.

I was hoping someone to join the effort by adding this feature to Openfire...

 

Specification: http://xmpp.org/extensions/xep-0138.html

Primarily I will be doing the zlib part.

 

Anyone interested?

 

Perhaps this could be then added to Spark as well and wherever applicable.

  • Guenther Niess KeyContributor 305 posts since
    Jun 19, 2008
    Currently Being Moderated
    Jul 30, 2009 8:54 AM (in response to Juga Paazmaya)
    Re: XEP-0138: Stream Compression
    Hi Juga,
    I was hoping someone to join the effort by adding this feature to Openfire...

     

    Specification: http://xmpp.org/extensions/xep-0138.html

    Primarily I will be doing the zlib part.

     

    Anyone interested?

    The zlib method should already be implemented in Openfire. Please try it and write if you get troubles.

      • Guenther Niess KeyContributor 305 posts since
        Jun 19, 2008
        Currently Being Moderated
        Aug 3, 2009 7:59 AM (in response to Juga Paazmaya)
        Re: XEP-0138: Stream Compression
        Do you know any working client or libary to reproduce it? Maybe I can start to implement zlib compression for Smack too.
        • Guenther Niess KeyContributor 305 posts since
          Jun 19, 2008
          Currently Being Moderated
          Aug 3, 2009 8:41 AM (in response to Guenther Niess)
          Re: XEP-0138: Stream Compression
          Ups, Smack already provides stream compression and it worked with my Openfire installation:

          05:31:09 PM RCV  (870314914):

          <?xml version='1.0' encoding='UTF-8'?>

          <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="cs.uni-potsdam.de" id="c88d53b7" xml:lang="en" version="1.0">

            <stream:features>

            <compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression>

            <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/>

            <session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>

          </stream:features>

          05:31:09 PM SENT (870314914):

          <iq id="rsrR1-0" type="set">

            <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>SmackTest</resource></bind>

          </iq>


          05:31:09 PM RCV  (870314914):

          <iq type="result" id="rsrR1-0" to="cs.uni-potsdam.de/c88d53b7">

            <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>alice@cs.uni-potsdam.de/SmackTest</jid></bind>

          </iq>


          05:31:09 PM SENT (870314914):

          <iq id="rsrR1-1" type="set">

            <session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>

          </iq>


          05:31:09 PM RCV  (870314914):

          <iq type="result" id="rsrR1-1" to="alice@cs.uni-potsdam.de/SmackTest">

            <session xmlns="urn:ietf:params:xml:ns:xmpp-session"/>

          </iq>


          05:31:09 PM SENT (870314914):

          <compress xmlns='http://jabber.org/protocol/compress'><method>zlib</method></compress>


          05:31:09 PM RCV  (870314914):

          <compressed xmlns='http://jabber.org/protocol/compress'/>


          05:31:09 PM SENT (870314914):

          <stream:stream to="cs.uni-potsdam.de" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">


          05:31:09 PM SENT (870314914):

          <iq id="rsrR1-2" type="get">

            <query xmlns="jabber:iq:roster"></query>

          </iq>

          ...

          If you will share your sources and help me to get it running, then I could reproduce your problem and will try to help you with the Openfire part.

          • Guenther Niess KeyContributor 305 posts since
            Jun 19, 2008
            Currently Being Moderated
            Aug 4, 2009 3:16 AM (in response to Juga Paazmaya)
            Re: XEP-0138: Stream Compression

            Paazmaya wrote:

             

            At least Miranda has an advanced setting for compression.

            The error most prorably occured due to wrong format of data I had sent to the server.

            Anyhow the server should reply with

             

            <stream:error>
              <undefined-condition xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
              <failure xmlns='http://jabber.org/protocol/compress'/>
                <processing-failed/>
              </failure>
            </stream:error>
            </stream:stream>

             

             

            Where the condition seems to be just this undefined.

            Perhaps the new version of  rfc 3920, part 5.8, will allow this to be more precise.

            I agree with you and will try to find where the Exception is thrown. Therefore I would like to get your code to find and fix the problem but maybe I'll find it myself.

            Could you record the first message, as is, that is transfered between the client and the server, once the compression has been negotiated?

            For the stanza

            <stream:stream to="pappanoa.de" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">

            the attached screenshot shows the sended raw data (encryption disabled).
            Attachments:
                • karthik Bronze 54 posts since
                  Mar 15, 2009
                  Currently Being Moderated
                  Jan 19, 2010 1:01 PM (in response to Juga Paazmaya)
                  Re: XEP-0138: Stream Compression

                  Hi Juga,

                   

                  I am running into the same problem when trying to use compression with OpenFire.

                   

                  Looking at the binary you posted, it seems like the only differences are at byte 3 and at the last 4 bytes.  From the ZLib RFC (http://www.ietf.org/rfc/rfc1950.txt), it seems like these are Adler32 checksums, so it would seem like the Flash player method for computing the Adler32 is off?

                   

                  I'm looking into this now, please let me know if you've made progress since your last post!

                   

                  Cheers,

                  Karthiki

                    • karthik Bronze 54 posts since
                      Mar 15, 2009
                      Currently Being Moderated
                      Jan 19, 2010 3:29 PM (in response to Juga Paazmaya)
                      Re: XEP-0138: Stream Compression

                      Hi Juga,

                       

                      I tried using FZLib (http://www.wizhelp.com/fzlib/index.html) which is a port of JZLib in ActionScript after seeing that Smack was using JZLib (see XMPPConnection.java in Smack).

                       

                      I tried using the same settings for the deflate that Smack is using and then compared the byte output to ByteArray.compress() and indeed there is a few bytes difference.  But, when I send the FZLib output byte data to the server, it still doesn't work!  There must be something going on here, will keep looking into it.

                       

                      Karthik

  • mikeycmccarthy Silver 187 posts since
    Jan 7, 2009
    Currently Being Moderated
    Nov 3, 2010 2:32 AM (in response to Juga Paazmaya)
    Re: XEP-0138: Stream Compression

    btw - this post here - http://community.igniterealtime.org/message/207347#207347 details what we've looked at so far.

  • Mani Obhrai Bronze 9 posts since
    Nov 1, 2010
    Currently Being Moderated
    Nov 7, 2010 2:14 PM (in response to Juga Paazmaya)
    Re: XEP-0138: Stream Compression

    We have this working in XIFF 3.0.0 against an unmodified Openfire 3.6.4, using as3zlib. Please contact me so we can talk about getting this included in trunk!

     

    Mani

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points