Re: HTTP: T-T-T-Talking about MIME Generation

You don't need content-length to search for the boundary. You can go
ahead and scan the binary data for <CR><LF>--boundary--<CR><LF>. Doing
so either using a simple scan or using a more elaborate boyer-moore
algorithm should be computationally not significantly more expensive
than merely counting bytes. 

At first glance, you might not think so, but both searching and
counting are order-N algorithms; some systems have optimized
block-move, but most C programmers don't think twice about using
strcpy, which is, after all, searching for a null byte. Using
boyer-moore, searching for a long string is more efficient than
searching for a short one.

Received on Friday, 16 December 1994 10:58:33 UTC