(De)compression (ZLib) problem with Openfire

When I try to get data from the Openfire server (ZLib compressed data) from the Dart front, it throws an Exception that refers to incomplete data or an incorrect header check. I tried several decompression methods (inflating and gzip) from other languages also, but now works.

More specifically, for example, when the server sends a ping message to me after some delay, my code stops working because of an incorrect header. I can not decompress data from the server. Another problem with compressed data it does not go beyond resource-binding request. Sticks after a compressed header exchange and does not go far from that.

I have not tested my code using the ejabberd or prosody server, but I guess the problem occurs from the Openfire backend. Any solutions?

It’s not very clear to me exactly what is going on. Let’s start with the basics: What version of Openfire are you using? What client or client library are you using? What type of client connections (TCP, BOSH, Websocket?) are you trying to establish? Has the client successfully negotiated features (including compression)? Can you provide a dump of the XMPP traffic that’s being exchanged?

Sorry for the late response.

I am using 4.8.1 version of Openfire and using the Dart client library in Flutter written by myself. I am connecting over a TCP socket and everything is okay without compression. I am doing TLS handshake after connection establishement, afterwards SASL authentication, resource binding, and negotiating all the available features properly. This works well when there is not compression registered. But when it comes to ZLib decompression, I can not decompress the data that comes from the server. I do not know why, but when I have tried to decompress that data in another languages it gives same error. Openfire accepts the stream header which I am sending after compression till I try to negotiate binding.

Can you show some of the data please? Also, are there any errors in the logs of Openfire?