News for hackers. Stuff that matters.
Re:Althttpd: Simple webserver in a single C file by saba2008 on Tuesday June 08, 2021 @05:07AM (#27432102)
HTTP/1 simplicity comes not from text nature, but from it's clear concept and limited functionality.

At core, it's just request-reply + key-value metadata. Whenever it's text, or binary, it does not matter much. But writing HTTP/2 frame types in letters would not make them any easier to understand.

Re:Althttpd: Simple webserver in a single C file by ahartmetz on Tuesday June 08, 2021 @05:38AM (#27432260)
There are also keep-alive, caching (a big topic), chunked transfer encoding, header parsing peculiarities, and authentication in HTTP. The combination of these creates some nice opportunities for implementation bugs. Source: have worked on a client-side implementation.

Now, HTTP/2 isn't even conceptually simple, I agree about that... it seems ugly.

Re:Althttpd: Simple webserver in a single C file by merb on Tuesday June 08, 2021 @06:36PM (#27441998)
> implementation bugs. Source: have worked on a client-side implementation

well because the hard part is the client-side. caching is a client-side only thing with http, keep-alive is a thing that a server pushes to a client, the same with chunked transfer, which is not as easy to implement for a client like it was with content length.

basically a server does only need to implement certain headers, but a client needs to know all. also most clients even accept bad servers, like content for head requests, etc.. most stateless protocols put a lot of burden into clients.

h2 on the other hand is stateful and keeps the same hard semantics onto the client side and also makes servers more complex, because it's a state machine.

Re:Althttpd: Simple webserver in a single C file by tokamak-teapot on Tuesday June 08, 2021 @07:21AM (#27433621)
One good thing is that you don’t have to support everything if you’re writing a server. It just depends on what kind of use cases you want to support.
Re:Althttpd: Simple webserver in a single C file by jbverschoor on Tuesday June 08, 2021 @12:13PM (#27437116)
That came with http/1.1 ;-)
Re:Althttpd: Simple webserver in a single C file by secondcoming on Tuesday June 08, 2021 @06:21AM (#27432834)
HTTP allows a TimedOut response to be sent by a server to request you haven't yet sent. So it's not strictly request/reply.
Re:Althttpd: Simple webserver in a single C file by saba2008 on Tuesday June 08, 2021 @07:38AM (#27433776)
'100 Continue' would probably be better example of breaking request/reply flow, as it provides useful functionality and requires non-trivial implementation and compatibility measures.

While '408 Request Timeout' is somewhat dubious fig leaf over TCP RST