From: Brent W. <we...@pa...> - 2004-07-20 21:34:33
|
It should be possible to do a non-blocking read instead of gets. You would have to change the code to accumulate the initial line, and then bail out if it grew too long. >>>"Gerald W. Lester" said: > Colin McCormack wrote: > > >On Tue, 2004-07-20 at 11:34, Brent Welch wrote: > > > > > >>I'd be OK with a simple string length limit of say, 10,000 characters. > >>Put the value into the Httpd array in lib/httpd.tcl along with the > >>other hardwired constants in that module. > >> > >> > > > >Yes, this might well be worth doing. > > > >However, on a peripherally related matter, GPS has pointed out on tcl > >chat that it's possible to crash the underlying tcl by sending an > >*extremely* long string - because [gets] has no bounds checking on the > >length of a line, and tcl will eventually run out of allocatable storage > >for buffering. > > > >I hasten to add that tclhttpd shares this behaviour with anything > >net-connected which uses gets (ie: just about every web service in > >tcllib.) > > > >Probably the best/only/complete solution to that is a TIP to fconfigure > >a line limit. > > > > > Actually I'd to see things use read and TIP for an option -breakon > ListOfChars > > -- > +--------------------------------+--------------------------------------- + > | Gerald W. Lester | "The man who fights for his ideals is | > | Ger...@co... | the man who is alive." -- Cervantes | > +--------------------------------+--------------------------------------- + > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > TclHttpd-users mailing list > Tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tclhttpd-users > -- Brent Welch Software Architect, Panasas Inc Delivering the premier storage system for scalable Linux clusters www.panasas.com we...@pa... |