<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/slcl/main.c, branch v0.2.0</title>
<subtitle>Small and lightweight cloud storage written in C99 and POSIX.1-2008.
</subtitle>
<id>https://gitea.privatedns.org/xavi/slcl/atom?h=v0.2.0</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/slcl/atom?h=v0.2.0'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/'/>
<updated>2023-11-22T23:06:09+00:00</updated>
<entry>
<title>Upgrade to new libweb interface</title>
<updated>2023-11-22T23:06:09+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-11-22T23:04:28+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=1768210ea43a1a692f844f7497940ec7d3f28d3c'/>
<id>urn:sha1:1768210ea43a1a692f844f7497940ec7d3f28d3c</id>
<content type='text'>
Recent commits from libweb brought a few breaking changes. The one below
affected slcl, so it had to be updated according to the new interface:

commit 98f5f52461b0c1ab1ee3331722bd32e2db9e1d41
Author: Xavier Del Campo &lt;xavier.delcampo@midokura.com&gt;
Date:   Thu Nov 16 12:23:08 2023 +0100

    Split handler_loop from handler_listen

    Some applications might set up a struct handler object to listen on any
    port i.e., 0, but still need a way to determine which port number was
    eventually selected by the implementation.

    Therefore, handler_listen has been reduced to the server initialization
    bit, whereas the main loop has been split into its own function, namely
    handler_loop.

    Because of these changes, it no longer made sense for libweb to write
    the selected port to standard output, as this is something now
    applications can do on their own.
</content>
</entry>
<entry>
<title>main.c: Treat non-existing upload dir as non-fatal</title>
<updated>2023-11-22T23:01:41+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-11-22T23:01:41+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=daffea4660560f7420e57ecc40b29f6ef3c46f98'/>
<id>urn:sha1:daffea4660560f7420e57ecc40b29f6ef3c46f98</id>
<content type='text'>
When a user attempts to upload a file into a non-existing directory,
slcl would not check whether the directory exists. Then, rename(3) would
fail and slcl would treat this as a fatal error, effectively closing
itself.

Since this is an example of ill-formed user input, it must be treated as
a non-fatal error, and instead slcl should return a bad request page.
</content>
</entry>
<entry>
<title>libweb: Bump new signature for http_decode_url</title>
<updated>2023-11-12T00:30:43+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-11-11T23:01:35+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=8dff21942ef7815d04eb03b822ab49d1c8651ad4'/>
<id>urn:sha1:8dff21942ef7815d04eb03b822ab49d1c8651ad4</id>
<content type='text'>
The new signature allows callers to distinguish decoding errors from
fatal errors. This is important for slcl to avoid crashing when
ill-formed data is received from a client.
</content>
</entry>
<entry>
<title>main.c: Use BUFSIZ instead of arbitrary value</title>
<updated>2023-10-19T13:32:22+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-10-19T13:32:22+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=9376361bcb8e323c7041d19895f967b5bf3ba038'/>
<id>urn:sha1:9376361bcb8e323c7041d19895f967b5bf3ba038</id>
<content type='text'>
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).
</content>
</entry>
<entry>
<title>Implement HEAD support</title>
<updated>2023-10-13T23:08:02+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-10-02T22:09:37+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=472b4ddbf151b44f5fc01c4c1752ce5529a0cf85'/>
<id>urn:sha1:472b4ddbf151b44f5fc01c4c1752ce5529a0cf85</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Apply slweb renaming to libweb</title>
<updated>2023-10-10T22:08:40+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-10-10T21:43:47+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=28ae865e5ecad9b398ac21fa148fc4b93c987226'/>
<id>urn:sha1:28ae865e5ecad9b398ac21fa148fc4b93c987226</id>
<content type='text'>
</content>
</entry>
<entry>
<title>main.c: Refactor calls to handler_add</title>
<updated>2023-09-15T23:46:07+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-09-15T23:46:07+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=b2037fea902cca2dd0238a1116b05480ef29b3d6'/>
<id>urn:sha1:b2037fea902cca2dd0238a1116b05480ef29b3d6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>main.c: Remove string duplication in get_forms</title>
<updated>2023-09-09T00:34:26+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-09-09T00:30:37+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=e81d1f6312de85e5640277f5968263aa8cd393db'/>
<id>urn:sha1:e81d1f6312de85e5640277f5968263aa8cd393db</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Check directory on uploads</title>
<updated>2023-09-08T22:50:22+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-09-08T22:47:14+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=fcef3b99b86312aaeb9e1cae88179abbfda90dff'/>
<id>urn:sha1:fcef3b99b86312aaeb9e1cae88179abbfda90dff</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>main.c: Return 1 on null buffer</title>
<updated>2023-09-08T22:15:39+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-09-08T22:15:39+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=df873a988ca42d79d87acac160fdab797cb3d16d'/>
<id>urn:sha1:df873a988ca42d79d87acac160fdab797cb3d16d</id>
<content type='text'>
Malformed POST requests might include no payload data. However, this is
not considered a fatal error, but wrong user input.
</content>
</entry>
</feed>
