On Thu, 24 Apr 2008 13:38:03 +0200
"ry dahl" <[EMAIL PROTECTED]> wrote:

> One could replace http11's parser with some regular expressions and
> out-of-bounds checking rather easily. I think Kirk Haines did this (?)
> and said it was rather comparable in speed to the C/Ragel state
> machine. I guess that wasn't really the point of your exercise, but
> it's worth noting, if anyone actually wants a pure ruby http parser.

Yes, fast, but not correct.  The main difference between a generated
parser based on algorithms and hand crafted regex is when the parser
blows up it says:

"Syntax error at character #34 expecting BLAH, FOO, and BAR symbols."

Regexen do this:

"Hi, oh thanks, I *love* hacks like this.  You crafted this shellcode
really well so that it looks mildly like a payload.  Super awesome I'll
just pass this vaguely HTTP string right on to our app."

:-)

-- 
Zed A. Shaw
- Hate: http://savingtheinternetwithhate.com/
- Good: http://www.zedshaw.com/
- Evil: http://yearofevil.com/
_______________________________________________
Mongrel-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/mongrel-development

Reply via email to