mTCP 2023-03-31 Release Notes

Psst! Join the mailing list!

Welcome to the latest release of mTCP!

It has been less than a year since the last release, so you'll find this release to be fairly modest in comparison. There are two TCP library fixes, a change to the DHCP client behavior with respect to hostnames assigned by badly behaved DHCP servers, Unicode support in IRCjr and Telnet, RLE graphics support in Telnet, and numerous fixes and pleasant changes sprinkled all around. Please see the detailed list of changes for the specifics.

Two notable new projects have sprung up in the past few months. floppy.museum is the floppy disk section of The Museum of Obsolete Media that is hosted on an 80286 class system running the mTCP web server. An of course, it boots and runs entirely from a single boot floppy. It proved to be robust, surviving a "Slashdotting" from Hacker News. AI is in the news everywhere so Yeo Kheng Meng has built a ChatGPT client for DOS using mTCP so that your vintage computers can join the party.

The first TCP library fix helps you if you were using TCP ECN (Explicit Congestion Notification, RFC 3168) which is not in widespread use. I was checking the behavior of reserved bits in the TCP header, which is always a no-no. If you were hit by this bug you would see connections from Linux machines using TCP ECN to FTPSRV or HTTPServ failing with a connection reset. The second TCP library bug only caused a problem when two new socket connections were received at the same time. mTCP would give one of the connections a bogus response, causing a packet to resent.

The DHCP client change makes "HOSTNAME" read-only again instead of read-write as it was in the last release. HOSTNAME is always a request to the DHCP server, and if the DHCP server honors the request it should send a DHCP option back to tell you that. Some DHCP servers were honoring the request but not sending the option, causing mTCP to think the request was not honored. This version introduces "HOSTNAME_ASSIGNED" to tell you directly what the DHCP server responded with. If there was no response, HOSTNAME_ASSIGNED will be empty instead of blotting out HOSTNAME as the last version did.

Unicode support for IRCjr and Telnet has been on my to-do list for years and I am proud to finally have it done. The basic idea is that Unicode characters can have mappings to local characters in your selected code page. If an incoming Unicode character (encoded in UTF-8) has a mapping the local character will be displayed, otherwise you will get the "tofu" character (no mapping). Outgoing characters generated by your keyboard will be mapped to Unicode and sent as well. The mapping is defined in a text file pointed at by an environment variable, so you can customize the mapping.

Great care was taken to ensure the performance of UTF-8 decoding would be usable even on the slowest of machines. This is all still using text mode, so don't expect miracles - to do Unicode correctly requires a bitmapped display and much more code. However it will make things more pleasant for speakers of European languages, especially users of code page 850. Mappings are provided for code page 437 (built into every video card) and code page 850. Please see the documentation for setting the required environment variable to enable it and how to add additional mappings.

The new RLE graphics support in Telnet is a "just for fun" kind of thing, as you'll probably never encounter RLE graphics in the wild. However, if you do then Telnet will be able to display them for you! The entire feature only required about 1.5KB of code and it was fun to work on. See the Telnet page for samples of what it can do. If you are not familiar with RLE graphics, Rediscovering Compuserve RLE Graphics has an interesting overview. With the existing file upload/download support and RLE graphics support I'm getting closer to making an old-school BBS a reality.

The keyboard handling changes improve compatibility with VirtualBox and possibly some PC clone BIOSes. If you were hitting a key and then having mTCP continue to run but stop accepting keyboard input, this problem should be fixed. The cause was a bug in Open Watcom computer run-time combined with poor BIOS keyboard support in VirtualBox. I wrote a small blog post about it that you can find at Adventures In Code if you are interested in the details.

Lastly, there was an ancient token parsing bug that could result in a buffer overrun when the right combination of characters and quotes was provided. And of course a buffer overrun is a bad thing, often leading to the machine crashing. It took me multiple weeks of tracing, watching and debugging to finally find the trigger, and just a hour to fix the bug once I knew what the trigger was. While everybody will benefit from the fix, HTTPServ users were probably the most impacted by this bug.

Enjoy!
-Mike Brutman


Detailed list of changes:


Created March 31st, 2023, (C)opyright Michael B. Brutman, mbbrutman at gmail.com