Despite common use in several POSIX operating systems, mktemp(1) is not
defined by POSIX.1-2008, nor even POSIX.1-2017. As long as it is not
introduced, m4(1)'s mkstemp can be used with similar effect.
According to C99 7.19.1p3:
BUFSIZ is a macro that expands to an integer constant expression that is
the size of the buffer used by the setbuf function.
In other words, this means BUFSIZ is the most optimal length for a
buffer that reads a file into memory in chunks using fread(3).
For platforms where int is a 16-bit data type, this operation might
overflow and possibly cause either unexpected behaviour and/or a
compiler warning.
Therefore, it is safer to promote each integer constant accordingly.
This feature was already implemented by:
commit 0822a982ef
Author: Xavier Del Campo Romero <xavi.dcr@tutanota.com>
Date: Sat Jul 8 00:54:59 2023 +0200
Implement file/directory removal
sha256sum(1) is a GNU utility that might not be available under some
POSIX systems. Since OpenSSL is already a dependency, it makes sense to
reuse it to generate SHA256 digests.
slweb now assumes application/x-www-form-urlencoded-data as text, so it
now returns a null-terminated string on struct http_post member "data".
This removes the need for slcl to call strdup(3) in order to obtain a
null-terminated string.
For historical reasons, slweb used to check for a name called "dir" on
multipart/form-data POST requests. However, stricly speaking this is
application logic, so it has been now moved from slweb to slcl.
This has resulted in a couple of breaking changes in slweb that had to
be updated on slcl.
d55b84f68b90fe5c2521724d0c22ebf22e62b0b4 introduces a bugfix:
Author: Xavier Del Campo Romero <xavi.dcr@tutanota.com>
Date: Tue Aug 8 00:32:21 2023 +0200
html.c: Fix wrong encoding for '>' and '<'
Despite designed around portability and minimalism, I feel slcl no
longer aligns with the philosophical views from the suckless project.
Therefore, I think it was appropriate to unlink its branding from it.
slweb contains the HTTP/1.1 server implementation and surrounding
utilities that are used by slcl. The motivation behind this was to allow
these components to be used by other projects, as well as effectively
making slcl smaller and more modular.
When a user enters a search term that is too generic, slcl would
generate a long list of search results, where this generation could have
a big impact on the server performance and its available resources.
Therefore, it is reasonable to limit the number of search results to an
arbitrary limit, so that users are forced to enter a more specific
search term in order to achieve more relevant results.