3 ms·
In src/webserver/Webserver.Incoming.cc you have an ad-hoc HTTP parser that internally buffers partial request data and does some questionable things like recurs
by sigil 15y ago
In src/webserver/Webserver.Incoming.cc you have an ad-hoc HTTP parser that internally buffers partial request data and does some questionable things like recursing on each request header line.
Consider using a finite state machine parser for HTTP like this one [1] or this one [2], which will reduce your overhead, and help you push the buffering and eof problems back up to the main event loop code.
[1] https://github.com/ry/http-parser https://github.com/ry/http-parser
[2] https://github.com/mongrel/mongrel/tree/master/ext/http11 https://github.com/mongrel/mongrel/tree/master/ext/http11
- udp 15y agoYes - the actual HTTP parsing code was written a long time ago, and I'd been meaning to improve it. Thanks for the links.