3 ms·
That's the "lazy, dumb" way of doing it --- write another string library. A much better way is to design your algorithms so they need a minimum of string manipu
by userbinator 4y ago
That's the "lazy, dumb" way of doing it --- write another string library. A much better way is to design your algorithms so they need a minimum of string manipulation, which is unfortunately on the more difficult side for text-based protocols like HTTP.
Personally, I wish HTTP messages were closer to something like ASN.1 DER; there's little in the way of string manipulation necessary for those, and all the lengths are prefixes instead of "try to find the terminator" (and don't forget to not run past the end of the buffer...)
- jeremyjh 4y agoPeak HN right here folks. Pack it in we are done.
- favorited 4y agoImpossible– no part of the thread has involved someone suggesting rewriting it in Rust, which means there's no opportunity for someone else to reply "This project seems like a perfect fit for golang, why would you suggest they use Rust instead?"
- earthboundkid 4y agoI could write this thread in an afternoon.
- tomcam 4y agoDeep cut! For newer HN users, that's a reference to this comment responding to the original DropBox announcement. https://news.ycombinator.com/item?id=17732980 https://news.ycombinator.com/item?id=17732980
- jerrysievert 4y agoor just parse in place: https://github.com/celcius-labs/tiny-http/blob/master/src/http_request.cpp https://github.com/celcius-labs/tiny-http/blob/master/src/ht...
- deleted 4y ago[deleted]
- pjc50 4y ago> ASN.1 DER This has also had serious security bugs because it's so hard to understand.