← Back to team overview

mudlet-makers team mailing list archive

[Bug 734741] Re: ctelnet.cpp decompression fails is compressed data sent with MCCP option

 

Ok testing is a bit of a problem as it only came to light when I enabled
MXP.

I have been using Discworld ( discworld.atuin.net on port 23 or 4242 )
for testing purposes.

Without MXP enabled the packet that enables MCCP does not have any extra data in so no problems. 
If MXP is enabled there is compressed data in the same packet, with MXP info.

By doing pBuffer +=3 firstly assumes that the MCCP enable respones is at the start of the buffer,
which it may not be, and the +3 offset is not the start of the decompressed data, but the sub command end bytes.

>From memory so may be a little wrong, on actually values, can check
later.

As pBuffer contians 0xff, 0xf0, 0x56, 0xff, 0xf0, start of compressed
data

so pBuffer +=3 points to the second 0xff, not the compressed data.
pBuffer+=5 works, although it assumes again that the MCCP sequence is at
the start of the buffer (not sure if that can be guarenteed).

With no MXP, there is no extra data, as the MUD is waiting for user
input at login, so no problems.

-- 
You received this bug notification because you are a member of Mudlet
Makers, which is subscribed to Mudlet.
https://bugs.launchpad.net/bugs/734741

Title:
  ctelnet.cpp decompression fails is compressed data sent with MCCP
  option

Status in Mudlet the MUD client:
  New

Bug description:
  Mudlet 2.0-dev built: January 19, 2011
  OS: kubuntu

  in ctelnet.cpp  void cTelnet::handle_socket_signal_readyRead()

  
                                  initStreamDecompressor();
                                  pBuffer += 3;
                                  //mWaitingForCompressedStreamToStart = false;
                                  int restLength = datalen - i - 3;
                                  if( restLength > 0 )
                                  {
                                      datalen = decompressBuffer( pBuffer, restLength );
                                  }
                                  i = 0;

  this has several errors that cause decompression errors.
  think it needs to be

                                  initStreamDecompressor();
                                  pBuffer += i + 3;  
                                  //mWaitingForCompressedStreamToStart = false;
                                  int restLength = datalen - i -3;
                                  if( restLength > 0 )
                                  {
                                      datalen = decompressBuffer( pBuffer, restLength );
  				     if(datalen !=-1)
  				         datalen += i+3;
  				}
                                  i += 2;



References