15 Replies Latest reply on Nov 7, 2010 2:14 PM by Mani Obhrai

    XEP-0138: Stream Compression

    Juga Paazmaya KeyContributor

      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.

        • Re: XEP-0138: Stream Compression
          Guenther Niess KeyContributor
          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.

            • Re: XEP-0138: Stream Compression
              Juga Paazmaya KeyContributor
              2009.08.02 23:15:22 ConnectionHandler:                  
              java.io.IOException: Unknown error. Error code : 1                 
              at org.apache.mina.filter.support.Zlib.inflate(Zlib.java:136)                 
              at org.apache.mina.filter.CompressionFilter.messageReceived(CompressionFilter.java :159)                 
              at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)                 
              at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)                 
              at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)                 
              at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :239)                 
              at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:283)                 
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)                 
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)                 
              at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)                  
              at java.lang.Thread.run(Unknown Source)

               

               

              This is Openfire 3.6.4.

              Stream compression fails after the client receives the  <compressed xmlns="http://jabber.org/protocol/compress" /> message.

                • Re: XEP-0138: Stream Compression
                  Guenther Niess KeyContributor
                  Do you know any working client or libary to reproduce it? Maybe I can start to implement zlib compression for Smack too.
                    • Re: XEP-0138: Stream Compression
                      Guenther Niess KeyContributor
                      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.

                      • Re: XEP-0138: Stream Compression
                        Juga Paazmaya KeyContributor

                        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.

                         

                        Anyway, the compression code will be in XIFF as soon as it works.

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

                          • Re: XEP-0138: Stream Compression
                            Guenther Niess KeyContributor

                            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).
                    • Re: XEP-0138: Stream Compression
                      mikeycmccarthy Silver

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

                      • Re: XEP-0138: Stream Compression
                        Mani Obhrai Bronze

                        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