Thursday, February 19, 2009

On Deadwood's send() implementation; PayPaI looks like PayPal in some fonts

In a perfect world, DwTcp would properly handle the case of send() sending less information down the TCP pipe than we requested it to send. Yes, if I was trying to make this program perfect, I would engineer for this.

I'm not going to.

Two reasons:
  1. DwTcp's stated purpose is to be a basic program that handles the occasional DNS-over-TCP packet. This program wasn't working for over a year and I didn't even notice.
  2. For me to add code that handles partial send()s, I will need to implement a testing suite that can simulate partial send()s (probably by having a wrapper for the raw send() function that can be optionally compiled to only send some of the data we want to send
Now, should the lack of partial support for send() ever become an issue, I will need to have scripts to allow us to test, in a consistent manner, partial send()s, since this type of code, if incorrectly written, can cause subtle errors that will be very difficult to track down.

The current situation of having a loud, obnoxious message telling the user there's an issue with partial send()s is the best way to handle it; this immediately lets them know what's going on. I would rather do it like this than have untested code in DwTcp.

I plan on releasing a DwTcp 2.04 tomorrow with the post-2.03 fixes (Google problem fixed; coding style revision to remove potential infinite loops; cache size bug; DwTcp works again) once I use Deadwood 20090218 for a day to make sure everything works.
Some fonts, notably Arial and Bitstream Vera sans, have a security problem: The PayPaI security problem. With some fonts, "PayPaI" looks like "PayPal"; this is not only aesthetically ugly, it makes the font harder to read and raises security issues.

One time, I was working with a student and reading something on my computer screen using the Bitstream Vera font when she had a hard time something reading something because she thought a "L" (lower case) was an "i" (upper case). I switched the font to a copy of Verdana I had on the computer (a free download) and we continued to read the article.

Other issues with some typefaces: 0 looks like O; l looks like 1 (or I); 5 looks like S

The one change I made to the vector form of Chortle (besides remapping characters and changing vertical spacing) back in 2007 is making the 1 not look like an l.