Tree for my work on http://tools.suckless.org/quark/
Find a file
Laslo Hunhold c0909c70e4
Improve http_prepare_response()'s error semantics
I don't like the juggling with status-values in serve. It makes
sense for http_recv_header() and http_parse_header(), because we
don't have a response-struct yet that we can "fill". We could pass
it to them, but that would make the usage a bit messy.

However, in http_prepare_response(), we are already entrusted with
a pointer to a response-struct, and just failing here (by returning
an error value) leaves the response-struct in an invalid state. Instead,
we make it a void function and reflect the status using the status field
in the passed response struct.

This way, there is no case where the response struct is in an
invalid state after calling a http_prepare_*()-method.

Signed-off-by: Laslo Hunhold <dev@frign.de>
2020-08-28 22:52:04 +02:00
arg.h Correct arg.h license 2018-07-16 11:49:51 +02:00
config.def.h Specify UTF-8 for non-binary content-types 2019-01-02 17:04:23 +01:00
config.mk Be extra pedantic again and remove all warnings 2018-03-05 00:30:53 +01:00
http.c Improve http_prepare_response()'s error semantics 2020-08-28 22:52:04 +02:00
http.h Improve http_prepare_response()'s error semantics 2020-08-28 22:52:04 +02:00
LICENSE Use timegm() instead of mktime() to generate UNIX-timestamp 2020-07-23 16:48:34 +02:00
main.c Improve http_prepare_response()'s error semantics 2020-08-28 22:52:04 +02:00
Makefile Refactor the single source file into multiple modules 2018-02-04 21:27:33 +01:00
quark.1 Mention default behaviour in the manual when the host is not given 2020-08-23 13:36:56 +02:00
resp.c Refactor http_send_response() into http_prepare_response() 2020-08-22 23:20:00 +02:00
resp.h Refactor http_send_response() into http_prepare_response() 2020-08-22 23:20:00 +02:00
sock.c Refactor sock_get_uds() a bit 2020-08-23 13:35:49 +02:00
sock.h Ensure const-correctness where possible and refactor parse_range() 2020-08-05 18:28:21 +02:00
util.c Refactor http_send_response() into http_prepare_response() 2020-08-22 23:20:00 +02:00
util.h Refactor http_send_response() into http_prepare_response() 2020-08-22 23:20:00 +02:00