I've implemented a new HTTP/1.1 request and response parser by hand
four.livejournal.com
I've implemented a new HTTP/1.1 request and response parser by hand
1–10 of 44 posts
Re: I've implemented a new HTTP/1.1 request and response parser by hand
#2Almost identical cases don't reuse code (not even a define). There are also sections like "`if (usual[ch >> 5] & (1
if (!parser->FOR##_mark) return 0; \
assert(parser->FOR##_mark); \
Sure - speed++, but at what cost? Otherwise... cool code - I like the MARK / CALLBACK macros.Re: I've implemented a new HTTP/1.1 request and response parser by hand
#3Re: I've implemented a new HTTP/1.1 request and response parser by hand
#4For a couple of reasons this code doesn't look like a very reliable one... Almost identical cases don't reuse code (not even a define). There are also sections like "`if (usual[ch >> 5] & (1 if (!parser->FOR##_mark) return 0; \ assert(parser->FOR##_mark); \ Sure - speed++, but at what cost? Otherwise... cool code - I like the MARK / CALLBACK macros.
Re: I've implemented a new HTTP/1.1 request and response parser by hand
#5I doubt that my yacc'd program would be only 124 bytes in size, but it would be interesting to get that old code and compare the results.
Re: I've implemented a new HTTP/1.1 request and response parser by hand
#6For a couple of reasons this code doesn't look like a very reliable one... Almost identical cases don't reuse code (not even a define). There are also sections like "`if (usual[ch >> 5] & (1 if (!parser->FOR##_mark) return 0; \ assert(parser->FOR##_mark); \ Sure - speed++, but at what cost? Otherwise... cool code - I like the MARK / CALLBACK macros.
"I can make it arbitrarily fast if I don't actually have to make it work": http://blogs.msdn.com/larryosterman/archive/2009/09/29/i-can...
Re: I've implemented a new HTTP/1.1 request and response parser by hand
#7For a couple of reasons this code doesn't look like a very reliable one... Almost identical cases don't reuse code (not even a define). There are also sections like "`if (usual[ch >> 5] & (1 if (!parser->FOR##_mark) return 0; \ assert(parser->FOR##_mark); \ Sure - speed++, but at what cost? Otherwise... cool code - I like the MARK / CALLBACK macros.
"I can make it arbitrarily fast if I don't actually have to make it work": http://blogs.msdn.com/larryosterman/archive/2009/09/29/i-can...
Re: I've implemented a new HTTP/1.1 request and response parser by hand
#8For a couple of reasons this code doesn't look like a very reliable one... Almost identical cases don't reuse code (not even a define). There are also sections like "`if (usual[ch >> 5] & (1 if (!parser->FOR##_mark) return 0; \ assert(parser->FOR##_mark); \ Sure - speed++, but at what cost? Otherwise... cool code - I like the MARK / CALLBACK macros.
it only has to be written once. i think it's an important enough problem to warrant such code - definitely could use a few more macros though
Re: I've implemented a new HTTP/1.1 request and response parser by hand
#9Re: I've implemented a new HTTP/1.1 request and response parser by hand
#10For a couple of reasons this code doesn't look like a very reliable one... Almost identical cases don't reuse code (not even a define). There are also sections like "`if (usual[ch >> 5] & (1 if (!parser->FOR##_mark) return 0; \ assert(parser->FOR##_mark); \ Sure - speed++, but at what cost? Otherwise... cool code - I like the MARK / CALLBACK macros.
"I can make it arbitrarily fast if I don't actually have to make it work": http://blogs.msdn.com/larryosterman/archive/2009/09/29/i-can...
One of my favorite software stories.