<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/slcl/http.c, branch test-multiform</title>
<subtitle>Small and lightweight cloud storage written in C99 and POSIX.1-2008.
</subtitle>
<id>https://gitea.privatedns.org/xavi/slcl/atom?h=test-multiform</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/slcl/atom?h=test-multiform'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/'/>
<updated>2023-07-20T23:40:55+00:00</updated>
<entry>
<title>Remove files now provided by slweb</title>
<updated>2023-07-20T23:40:55+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-20T23:07:57+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=7fe639b3ba7a253627d2cd34f3b97bd95b0a90b3'/>
<id>urn:sha1:7fe639b3ba7a253627d2cd34f3b97bd95b0a90b3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>http.c: Disallow forbidden filenames during upload</title>
<updated>2023-07-09T03:41:43+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-09T02:16:31+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=fbd730754b83dd9ae95d9b308e29ba7e85001528'/>
<id>urn:sha1:fbd730754b83dd9ae95d9b308e29ba7e85001528</id>
<content type='text'>
- '.' or '..' must not be used for filenames.
- Filenames must not contain forward slashes ('/').
- Filenames must not contain asterisks ('*') to avoid confusion with
wildcard expressions.
</content>
</entry>
<entry>
<title>http.c: Use case-insensitive compare for Content-Disposition</title>
<updated>2023-07-09T02:14:14+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-09T02:14:14+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=fa8217c511a0ff732be1c02921e105597ced7850'/>
<id>urn:sha1:fa8217c511a0ff732be1c02921e105597ced7850</id>
<content type='text'>
HTTP headers are case-insensitive, so the implementation must accept
Content-Diposition, content-disposition or any other variation.
</content>
</entry>
<entry>
<title>http.c: Accept resources with '&amp;' or '?'</title>
<updated>2023-07-05T22:19:05+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-05T21:34:36+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=7bd56e69dccec2794a7b568eb254a40f96b900c5'/>
<id>urn:sha1:7bd56e69dccec2794a7b568eb254a40f96b900c5</id>
<content type='text'>
Otherwise, client requests to resources such as '/me &amp; you', '/?' or
'/??preview=1' would fail.
</content>
</entry>
<entry>
<title>Avoid crashing on SIGPIPE</title>
<updated>2023-05-01T02:13:25+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-05-01T01:06:34+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=9c7a2e91285ca91d500cc828ad041a264128db4d'/>
<id>urn:sha1:9c7a2e91285ca91d500cc828ad041a264128db4d</id>
<content type='text'>
Under some circumstances, clients could cause SIGPIPE to slcl. Since
this signal was not handled by server.c (i.e., via sigaction(3)), slcl
would crash without any error messages printed to stderr.

In such situation, SIGPIPE should not be usually considered a fatal
error, so it is preferrable to close the connection and keep working.
</content>
</entry>
<entry>
<title>http.c: Decode URL resource and parameters separately</title>
<updated>2023-05-01T02:13:25+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-04-30T21:43:10+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=7d1e41f9c51bc1525e5b0c86b9832562d65675c1'/>
<id>urn:sha1:7d1e41f9c51bc1525e5b0c86b9832562d65675c1</id>
<content type='text'>
Given the following contrived example request:

/example%FB%DC&amp;arg%DE1=examplevalue%AA

slcl must decode each token separately, so that percent-encoded
characters '&amp;', '=' or '?' do not get accidently intepreted.
</content>
</entry>
<entry>
<title>Fix missing error checks for strtoul(3)</title>
<updated>2023-05-01T02:13:25+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-04-30T20:12:57+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=401c5dcf444b50d4fffa66f790aa0ee6a919a967'/>
<id>urn:sha1:401c5dcf444b50d4fffa66f790aa0ee6a919a967</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Return error if write_ctx_free fails</title>
<updated>2023-05-01T02:13:25+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-04-28T22:31:12+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=cfd0a6f7743494f63c6ac5af15bbd3e762591961'/>
<id>urn:sha1:cfd0a6f7743494f63c6ac5af15bbd3e762591961</id>
<content type='text'>
Otherwise, write_body_mem and write_body_mem would silently fail,
causing undefined behaviour.

Notes:

The return value for write_ctx_free is currently assigned to that of
fclose(3), which can be either 0 on success or EOF on failure.
However, it makes sense for write_body_mem and write_body_mem to simply
check against non-zero.

Also, it would not be sensible to return EOF to caller functions, which
expect either 0 (success), -1 (fatal error) or 1 (input error).
</content>
</entry>
<entry>
<title>Remove HTTP/1.0 support</title>
<updated>2023-05-01T02:13:24+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-04-27T22:30:44+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=30a101717c8ac825f6ce676c6d717964f19307a8'/>
<id>urn:sha1:30a101717c8ac825f6ce676c6d717964f19307a8</id>
<content type='text'>
Considering http.h defined HTTP/1.1-only responses such as "303 See
Other", as well as incoming HTTP/1.1-only features (e.g.: byte serving),
it did not make much sense to keep a somewhat broken compatibility
against HTTP/1.0.

Unfortunately, this breaks support with some existing clients such
as lynx(1), even if HTTP/1.0 was already deprecated many years ago.
However, even lynx(1) can be configured to support HTTP/1.1.
</content>
</entry>
<entry>
<title>Support URL parameters</title>
<updated>2023-04-23T03:09:53+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-04-23T03:09:53+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=011807e1d69d196cd0b9fd39a9899eb335c81abf'/>
<id>urn:sha1:011807e1d69d196cd0b9fd39a9899eb335c81abf</id>
<content type='text'>
Now, http_payload includes a list of human-readable parameters that can
be read (but not modified) by users. Given the following example link:

/test?key1=value1&amp;key2=value2

This will generate two parameters, with the following values:

{
	.args =
	{
		[0] = {.key = "key1", .value = "value1"},
		[1] = {.key = "key2", .value = "value2"}
	},

	.n_args = 2
}

As expected, if any URL parameters are given, struct http_payload member
"resource" is accordingly trimmed so as not to include any parameters.
Therefore, considering the example above:

{.args = {...}, .resource = "/test"}

Limitations:

- Since the definition of struct http_arg is both shared by http.h
(as a read-only pointer within struct http_payload) and http.c
(as a read/write pointer within struct ctx), its members (namely key
and value) must remain as read/write pointers, even if they must not
be modified by users of http.h.
</content>
</entry>
</feed>
