... > If each part of a multi-part form had a Content-Length, there would be no > reason to parse for the boundary strings. There would, in fact, be little > need for boundary strings at all. I'm not entirely clear on why it was > done with boundaries instead of lengths in the first place. But > anyway... even if IE does return a Content-Length, netscape (at least, > 4.76) does not so we still need to handle boundary strings. ... > I'm going to code something up in C and see how it works. I'll try to > make it a drop-in replacement for form.tcl, and post it back here, get > some comments.
This is correct. However, the form.tcl is not optimal code. You don't need to go through and search each line. You start at the beginning and break into parts by doing string first \n$bound\n $string You can either do this by reading the whole file in memory, or if you are mem-conscious, do it in 512KB chunks. It's a fairly simple technique. Before you do and spend a lot of time coding form.tcl in C though, I would recommend seeing what the AOLServer head is doing. I didn't examine it closely, but it's only about 20 lines of Tcl now. Jeff