Tree for my work on http://tools.suckless.org/quark/
Find a file
Laslo Hunhold d105c28aad
Ensure const-correctness where possible and refactor parse_range()
I know that the effect of 'const' on compiler optimizations is smaller
than many believe, but it provides a good insight to the caller which
parameters are not modified and simplifies parallelization, in case
that is desired at a later point.

Throughout processing, the big structs mostly remained unmodified, with
the exception of parse_range(), which added a null-byte in the "Range"-
header to simplify its parsing. This commit refactors parse_range()
such that it won't modify this string anymore.

Additionally, the parser was made even stricter: Usually, strtoll()
(which is wrapped by strtonum()) allows whitespace and plus and minus
signs before the number, which is not part of the specification. The
stricter parser also better differentiates now between invalid requests
and range-lists. In that context, the switch in http_send_response()
was replaced for better readability.

Signed-off-by: Laslo Hunhold <dev@frign.de>
2020-08-05 18:28:21 +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 Ensure const-correctness where possible and refactor parse_range() 2020-08-05 18:28:21 +02:00
http.h Ensure const-correctness where possible and refactor parse_range() 2020-08-05 18:28:21 +02:00
LICENSE Use timegm() instead of mktime() to generate UNIX-timestamp 2020-07-23 16:48:34 +02:00
main.c Ensure const-correctness where possible and refactor parse_range() 2020-08-05 18:28:21 +02:00
Makefile Refactor the single source file into multiple modules 2018-02-04 21:27:33 +01:00
quark.1 Make host parameters optional 2020-04-21 17:04:52 +02:00
resp.c Ensure const-correctness where possible and refactor parse_range() 2020-08-05 18:28:21 +02:00
resp.h Ensure const-correctness where possible and refactor parse_range() 2020-08-05 18:28:21 +02:00
sock.c Ensure const-correctness where possible and refactor parse_range() 2020-08-05 18:28:21 +02:00
sock.h Ensure const-correctness where possible and refactor parse_range() 2020-08-05 18:28:21 +02:00
util.c Refactor response-generation 2020-08-05 13:41:44 +02:00
util.h Refactor response-generation 2020-08-05 13:41:44 +02:00