<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(51,51,51);font-family:Tahoma,Geneva,Arial,sans-serif;line-height:18px">This is in reference to the following code</p>
<p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(51,51,51);font-family:Tahoma,Geneva,Arial,sans-serif;line-height:18px"><a href="https://github.com/joyent/http-parser" rel="nofollow" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;text-decoration:none;color:rgb(127,58,33)">https://github.com/joyent/http-parser</a></p>
<p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(51,51,51);font-family:Tahoma,Geneva,Arial,sans-serif;line-height:18px">What could be the main reason for such a design decision? I guess I could write few regular expressions to parse HTTP req & res this would be a lot less complex than Igor's version of the parser.</p>
<p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(51,51,51);font-family:Tahoma,Geneva,Arial,sans-serif;line-height:18px">What am I missing here?</p>
<p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(51,51,51);font-family:Tahoma,Geneva,Arial,sans-serif;line-height:18px"><br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(51,51,51);font-family:Tahoma,Geneva,Arial,sans-serif;line-height:18px">
On some discussion with over nginx's IRC i got the following points</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(51,51,51);font-family:Tahoma,Geneva,Arial,sans-serif;line-height:18px">
* HTTP parsing requires recursive exp resolution which is not possible using regexp</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(51,51,51);font-family:Tahoma,Geneva,Arial,sans-serif;line-height:18px">
* State Machines are faster?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(51,51,51);font-family:Tahoma,Geneva,Arial,sans-serif;line-height:18px">
* A tool like ragel is used to create such state machine?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(51,51,51);font-family:Tahoma,Geneva,Arial,sans-serif;line-height:18px">
<br></p></div>