- From: Larry Masinter <masinter@parc.xerox.com>
- Date: Fri, 16 Dec 1994 10:54:13 PST
- To: jim@spyglass.com
- Cc: http-wg%cuckoo.hpl.hp.com@hplb.hpl.hp.com
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