News for hackers. Stuff that matters.
Re:Show HN: A little web server in C by userbinator on Tuesday May 16, 2023 @08:08PM (#35969554)
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...)

Re:Show HN: A little web server in C by jeremyjh on Tuesday May 16, 2023 @08:38PM (#35969811)
Peak HN right here folks. Pack it in we are done.
Re:Show HN: A little web server in C by favorited on Tuesday May 16, 2023 @09:06PM (#35970054)
Impossible– 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?"
Re:Show HN: A little web server in C by earthboundkid on Tuesday May 16, 2023 @11:11PM (#35970840)
I could write this thread in an afternoon.
Re:Show HN: A little web server in C by tomcam on Wednesday May 17, 2023 @01:08AM (#35971474)
Deep 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
Re:Show HN: A little web server in C by jerrysievert on Tuesday May 16, 2023 @09:36PM (#35970263)
Re:Show HN: A little web server in C by pjc50 on Wednesday May 17, 2023 @04:20AM (#35972555)
> ASN.1 DER

This has also had serious security bugs because it's so hard to understand.