Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ CHAT_FILE_BLOCK bugs

CHAT_FILE_BLOCK bugs

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Glorimus   (7 posts)  Bio
Date Thu 13 Oct 2016 09:09 AM (UTC)
Message
The current chat file block protocol has a few bugs in ..

1) it doesn't handle the end of the file correctly.
Specifically this line in ChatSock::OnReceive

          // must have file block size + 2 (command and terminator)
          // otherwise we will get them later
          if (iLength < (m_iFileBlockSize + 2))
            return;

this expects the file to always to be of blocksize 500

2) it goes against the protocol. according to
Quote:

<CHAT_FILE_BLOCK><block of data>

A file block is 500 bytes. A file block is ALWAYS 500 bytes so no CHAT_END_OF_COMMAND is needed.


there should be no end byte, but the code in ChatSock expects it

 // discard the file block and message number and terminator byte
          m_outstanding_input = m_outstanding_input.Mid (m_iFileBlockSize + 2);
Top

Posted by Glorimus   (7 posts)  Bio
Date Reply #1 on Thu 13 Oct 2016 05:30 PM (UTC)
Message
btw, I found a workaround.

I padded the file up until 500 bytes, but kept the filesize the original size. This gets me past the first if check of blocksize +2, but only the filesize % 500 gets written
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


8,185 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.