Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix: Z_STREAM_END handling
  • Loading branch information
HeikoKoehn committed Apr 24, 2012
1 parent 0e602b6 commit b0d5ab5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ctelnet.cpp
Expand Up @@ -1318,6 +1318,15 @@ int cTelnet::decompressBuffer( char * dirtyBuffer, int length )
if( zval == Z_STREAM_END )
{
inflateEnd( & mZstream );
std::cout << "recv Z_STREAM_END, ending compression" << std::endl;
this->mNeedDecompression = false;
this->mMCCP_version_1 = false;
this->mMCCP_version_2 = false;

// Reset the option state so we can re-enable compression again in the future
// such as in the case of a copyover -JM
hisOptionState[static_cast<int>(OPT_COMPRESS)] = false;
hisOptionState[static_cast<int>(OPT_COMPRESS2)] = false;
}
else
{
Expand Down

0 comments on commit b0d5ab5

Please sign in to comment.