Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^9: Can't decompress zlib compression stream with Compress:Zlib

by pmqs (Friar)
on Oct 05, 2016 at 14:35 UTC ( [id://1173347]=note: print w/replies, xml ) Need Help??


in reply to Re^8: Can't decompress zlib compression stream with Compress:Zlib
in thread Can't decompress zlib compression stream with Compress:Zlib

Commenting out half of Net::Telnet seems to do the trick.

Do you mean that it has fixed the issue with Compress::Zlib?

  • Comment on Re^9: Can't decompress zlib compression stream with Compress:Zlib

Replies are listed 'Best First'.
Re^10: Can't decompress zlib compression stream with Compress:Zlib
by Anonymous Monk on Oct 09, 2016 at 13:32 UTC
    Do you mean that it has fixed the issue with Compress::Zlib?

    Calls to Compress::Zlib still do not work. Only 'use strict' errors are eliminated.

      OK, in that case can you verify that the if statement in this section of your code evaluates to true and the block is actually being executed? My reading of the code suggests that if it isn't the contents of $s->{buf} will remain unchanged. That could account for your observation that you see strange ascii characters on the terminal.
      if ($nread && $s->{opts}{86}{remote_enabled}) { my ($nout, $status) = $zlib->inflate($s->{buf}); if (! defined $nout) { print "Error inflating: errnum: $status\n"; } else { # Inflation successful $s->{buf} = $nout; $nread = length ($nout); } }
      Also, if that block is triggered, does the call to inflate pass or fail? If it fails, what does this line actually print?
      print "Error inflating: errnum: $status\n";

        OP here. Looks like the MyTelnet->_fillbuf function is never actually called, due to some inheritance problem.

        Darned if I can see why inheritance doesn't work as expected:

        #!/usr/bin/perl -- my $connectObj = MyTelnet->new(); $connectObj->open( Host => 'iberiamud.mooo.com', Port => 5900, ); while (1) {} # Poor man's main loop { package MyTelnet; use base ("Net::Telnet"); sub _fillbuf { print "This function is never called\n"; print "Base class's ->_fillbuf function is called instead\n"; } }

        Regarding the call to inflate. My production code (which probably has no inheritance problems, as it generates billions of debug messages that actually appear) was producing:

        Error: No output status: data error msg: incorrect header check

        I tried ignoring everything before the first ASCII 120 character, which is where the zlib stream is supposed to start. The first couple of calls to Compress::Zlib->inflate then succeed. After that, we're back to square one, with new error messages:

        Error: No output status: data error msg: invalid code lengths set

        The zlib docs suggest this kind of error appears if the compressed stream is corrupted, but I haven't yet found anything in Net::Telnet that might be responsible.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1173347]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-26 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found