13 Jun 2012 16:13
#240: Unhandled Z_BUF_ERROR inflating compressed stream
#240: Unhandled Z_BUF_ERROR inflating compressed stream
----------------------+--------------------
Reporter: steven | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 1.5.0
Component: protocol | Version: 1.4.1
Keywords: | Blocked By:
Blocks: |
----------------------+--------------------
When using libssh2 to perform an SFTP file transfer from the "JSCAPE MFT
Server" (http://www.jscape.com) the transfer failed. The default JSCAPE
configuration is to enforce zlib compression on SSH2 sessions so the
session was compressed. The relevant part of the debug trace contained:
{{{
[libssh2] 1.052750 Transport: unhandled zlib error -5
[libssh2] 1.052750 Failure Event: -29 - decompression failure
}}}
The trace comes from comp_method_zlib_decomp() in comp.c. The "unhandled
zlib error -5" is the status returned from the zlib function inflate().
The -5 status corresponds to "Z_BUF_ERROR".
The inflate() function takes a pointer to a z_stream structure and
"inflates" (decompresses) as much as it can. The relevant fields of the
z_stream structure are:
* next_in - pointer to the input buffer containing compressed data
* avail_in - the number of bytes available at next_in
* next_out - pointer to the output buffer to be filled with uncompressed
data
* avail_out - how much space available at next_out
So, to decompress data you set up a z_stream struct with the relevant
(Continue reading)
RSS Feed