darkhttpd
12 months agoAdd benchmark. master
Emil Mikulic [Mon, 10 Dec 2018 13:42:52 +0000 (00:42 +1100)]
Add benchmark.

12 months agoAdd test for --timeout.
Emil Mikulic [Mon, 10 Dec 2018 12:52:42 +0000 (23:52 +1100)]
Add test for --timeout.

12 months agoAdd --timeout cmdline option.
Emil Mikulic [Mon, 10 Dec 2018 12:33:13 +0000 (23:33 +1100)]
Add --timeout cmdline option.

12 months agorun-tests: try to use the default gcc and clang.
Emil Mikulic [Mon, 10 Dec 2018 10:12:24 +0000 (21:12 +1100)]
run-tests: try to use the default gcc and clang.

12 months agorun-tests: don't mix msan with ubsan.
Emil Mikulic [Mon, 10 Dec 2018 10:02:46 +0000 (21:02 +1100)]
run-tests: don't mix msan with ubsan.

ubsan seems to be causing false positives for msan.
We already try ubsan together with asan.

12 months agoClean more.
Emil Mikulic [Mon, 10 Dec 2018 09:36:07 +0000 (20:36 +1100)]
Clean more.

12 months agoBump copyright year.
Emil Mikulic [Sun, 9 Dec 2018 14:11:55 +0000 (01:11 +1100)]
Bump copyright year.

12 months agoopen_sockets: finer grained timing.
Emil Mikulic [Sun, 9 Dec 2018 14:10:06 +0000 (01:10 +1100)]
open_sockets: finer grained timing.

12 months agoIn debug mode: time how long select() takes.
Emil Mikulic [Sun, 9 Dec 2018 14:09:33 +0000 (01:09 +1100)]
In debug mode: time how long select() takes.

12 months agoFix timeouts to close connections.
Emil Mikulic [Sun, 9 Dec 2018 13:54:12 +0000 (00:54 +1100)]
Fix timeouts to close connections.

12 months agoAdd helper script for opening sockets until they run out.
Emil Mikulic [Sun, 9 Dec 2018 13:30:31 +0000 (00:30 +1100)]
Add helper script for opening sockets until they run out.

12 months agoIf accept() fails, don't exit.
Emil Mikulic [Sun, 9 Dec 2018 12:49:43 +0000 (23:49 +1100)]
If accept() fails, don't exit.

Temporarily stop accept()ing if we ran out of fds.

Suggested by: Bert Gijsbers

12 months agoSwitch make_safe_url() to more efficient implementation.
Emil Mikulic [Sun, 9 Dec 2018 12:18:00 +0000 (23:18 +1100)]
Switch make_safe_url() to more efficient implementation.

Contributed by: Bert Gijsbers

12 months agoAdd make_safe_url_new()
Emil Mikulic [Sun, 9 Dec 2018 12:13:28 +0000 (23:13 +1100)]
Add make_safe_url_new()

Contributed by: Bert Gijsbers

12 months agoAdd LLVM fuzzer.
Emil Mikulic [Fri, 2 Sep 2016 09:20:12 +0000 (19:20 +1000)]
Add LLVM fuzzer.

12 months agoBounds check first.
Emil Mikulic [Tue, 21 Aug 2018 15:14:17 +0000 (01:14 +1000)]
Bounds check first.

Found with: cppcheck

3 years ago[ darkhttpd 1.12 release ]
Emil Mikulic [Wed, 27 Jan 2016 14:16:10 +0000 (01:16 +1100)]
[ darkhttpd 1.12 release ]

3 years agoBuild with warnings.
Emil Mikulic [Wed, 27 Jan 2016 14:05:27 +0000 (01:05 +1100)]
Build with warnings.

3 years agoFix IPv6 memory corruption crash on FreeBSD.
Emil Mikulic [Wed, 27 Jan 2016 14:03:38 +0000 (01:03 +1100)]
Fix IPv6 memory corruption crash on FreeBSD.

getsockname() into addrin6 instead of addrin when ipv6 is requested.

3 years agoRun tests under msan.
Emil Mikulic [Wed, 27 Jan 2016 13:41:34 +0000 (00:41 +1100)]
Run tests under msan.

3 years agoAdd asan and ubsan to tests, watch stderr.
Emil Mikulic [Sun, 24 Jan 2016 05:39:32 +0000 (16:39 +1100)]
Add asan and ubsan to tests, watch stderr.

3 years agoObvious %lld -> %llu correction.
Emil Mikulic [Sat, 23 Jan 2016 09:13:17 +0000 (20:13 +1100)]
Obvious %lld -> %llu correction.

Caught with cppcheck.
I have no idea why it wasn't caught earlier.

3 years agoAdd Makefile for tests and cleaning up.
Emil Mikulic [Sat, 23 Jan 2016 09:11:30 +0000 (20:11 +1100)]
Add Makefile for tests and cleaning up.

3 years agoMake the output more obvious.
Emil Mikulic [Sat, 23 Jan 2016 09:10:10 +0000 (20:10 +1100)]
Make the output more obvious.

3 years agoTest builds with different defines.
Emil Mikulic [Sat, 23 Jan 2016 09:08:02 +0000 (20:08 +1100)]
Test builds with different defines.

3 years agoRename "cover" to "run-tests"
Emil Mikulic [Sat, 23 Jan 2016 09:05:02 +0000 (20:05 +1100)]
Rename "cover" to "run-tests"

3 years agoBe explicit if the binary was built without IPV6 support.
Emil Mikulic [Sat, 23 Jan 2016 08:57:23 +0000 (19:57 +1100)]
Be explicit if the binary was built without IPV6 support.

Fix the number of newlines involved.

3 years agoTry to build with IPv6 by default.
Emil Mikulic [Sat, 23 Jan 2016 08:55:33 +0000 (19:55 +1100)]
Try to build with IPv6 by default.

3 years agoBump copyright year.
Emil Mikulic [Sat, 23 Jan 2016 08:51:37 +0000 (19:51 +1100)]
Bump copyright year.

3 years agoCatch up to clang changes.
Emil Mikulic [Wed, 13 Jan 2016 13:57:42 +0000 (00:57 +1100)]
Catch up to clang changes.

3 years agoMove HAVE_INET6 guards to avoid the appearance of functions that don't return.
Emil Mikulic [Wed, 13 Jan 2016 09:24:36 +0000 (20:24 +1100)]
Move HAVE_INET6 guards to avoid the appearance of functions that don't return.

Fixes GCC warnings.

3 years agoExplicitly cast getpid() result to int.
Emil Mikulic [Wed, 13 Jan 2016 09:18:30 +0000 (20:18 +1100)]
Explicitly cast getpid() result to int.

This placates cppcheck.

3 years agoTidy up UTF-8 after merge.
Emil Mikulic [Wed, 13 Jan 2016 09:04:29 +0000 (20:04 +1100)]
Tidy up UTF-8 after merge.

3 years agoMerge branches with UTF-8 changes.
Emil Mikulic [Wed, 13 Jan 2016 09:00:44 +0000 (20:00 +1100)]
Merge branches with UTF-8 changes.

3 years agoI added utf-8 in your code: "Content-Type: text/html; charset=utf-8\r\n"
Alexey [Wed, 13 Jan 2016 08:46:31 +0000 (19:46 +1100)]
I added utf-8 in your code: "Content-Type: text/html; charset=utf-8\r\n"

(in few places)

3 years agoAdd '<meta charset="utf-8"/>' to the html header
Stephen Zhang [Mon, 28 Dec 2015 06:41:54 +0000 (14:41 +0800)]
Add '<meta charset="utf-8"/>' to the html header

I think most non-English user would need it to fix error encoding in displaying
file name in the web page.

3 years agoUse UTF-8 as the encoding for directory listing.
Hugh Wang [Sun, 20 Dec 2015 14:49:14 +0000 (22:49 +0800)]
Use UTF-8 as the encoding for directory listing.

3 years agoIndent, add dir, allow inconclusive.
Emil Mikulic [Sun, 10 Jan 2016 13:31:58 +0000 (00:31 +1100)]
Indent, add dir, allow inconclusive.

3 years agoAdd support for IPv6.
Hugh Wang [Sun, 20 Dec 2015 13:59:20 +0000 (21:59 +0800)]
Add support for IPv6.

4 years agoCheck the bound first.
Emil Mikulic [Tue, 19 May 2015 14:06:59 +0000 (00:06 +1000)]
Check the bound first.

Found with cppcheck.

4 years agoEscape URLs according to RFC3986.
Emil Mikulic [Tue, 19 May 2015 12:02:12 +0000 (22:02 +1000)]
Escape URLs according to RFC3986.

Previously, we weren't escaping parentheses when generating directory listings.

Pointed out by: Wijatmoko U. Prayitno

4 years agoAdd --default-mimetype flag.
Emil Mikulic [Tue, 19 May 2015 11:40:26 +0000 (21:40 +1000)]
Add --default-mimetype flag.

4 years agoAdd test for --no-listing.
Emil Mikulic [Tue, 19 May 2015 11:23:14 +0000 (21:23 +1000)]
Add test for --no-listing.

4 years agoFix memory leak.
Emil Mikulic [Tue, 19 May 2015 11:17:42 +0000 (21:17 +1000)]
Fix memory leak.

4 years agomention --forward-all in help output
Christian Hesse [Mon, 18 May 2015 22:43:42 +0000 (00:43 +0200)]
mention --forward-all in help output

Signed-off-by: Christian Hesse <mail@eworm.de>
4 years agoadd option to deny directory listing
Christian Hesse [Mon, 18 May 2015 22:43:41 +0000 (00:43 +0200)]
add option to deny directory listing

Signed-off-by: Christian Hesse <mail@eworm.de>
4 years ago[ darkhttpd 1.11 release ]
Emil Mikulic [Thu, 1 Jan 2015 11:42:44 +0000 (22:42 +1100)]
[ darkhttpd 1.11 release ]

4 years agoRemove unused var, add casts to str_to_num() calls.
Emil Mikulic [Thu, 1 Jan 2015 11:41:35 +0000 (22:41 +1100)]
Remove unused var, add casts to str_to_num() calls.

4 years agoCall setgroups() before setgid() to drop supplementary groups.
Emil Mikulic [Thu, 1 Jan 2015 11:22:41 +0000 (22:22 +1100)]
Call setgroups() before setgid() to drop supplementary groups.

See also: https://www.securecoding.cert.org/confluence/display/seccode/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges

4 years agoTest keepalive.
Emil Mikulic [Thu, 1 Jan 2015 11:18:10 +0000 (22:18 +1100)]
Test keepalive.

4 years agoAdd TestHelper.get()
Emil Mikulic [Thu, 1 Jan 2015 10:47:59 +0000 (21:47 +1100)]
Add TestHelper.get()

4 years agoTest for unreadable directory (can't generate listing).
Emil Mikulic [Thu, 1 Jan 2015 10:20:08 +0000 (21:20 +1100)]
Test for unreadable directory (can't generate listing).

4 years agoMake str_to_num() check for ERANGE, use it instead of atoi().
Emil Mikulic [Thu, 1 Jan 2015 10:00:57 +0000 (21:00 +1100)]
Make str_to_num() check for ERANGE, use it instead of atoi().

4 years agochomp() isn't needed because read_line() strips [cr]lf.
Emil Mikulic [Thu, 1 Jan 2015 09:38:38 +0000 (20:38 +1100)]
chomp() isn't needed because read_line() strips [cr]lf.

4 years agoTest resize in appendl().
Emil Mikulic [Thu, 1 Jan 2015 09:35:37 +0000 (20:35 +1100)]
Test resize in appendl().

4 years agoTest 404 and 403.
Emil Mikulic [Thu, 1 Jan 2015 09:32:52 +0000 (20:32 +1100)]
Test 404 and 403.

4 years agoTest CRLF handling in read_line().
Emil Mikulic [Thu, 1 Jan 2015 09:16:47 +0000 (20:16 +1100)]
Test CRLF handling in read_line().

4 years agoWhen testing, build with -DDEBUG.
Emil Mikulic [Thu, 1 Jan 2015 07:32:01 +0000 (18:32 +1100)]
When testing, build with -DDEBUG.

4 years agoZero slashes should be impossible here.
Emil Mikulic [Thu, 1 Jan 2015 07:26:35 +0000 (18:26 +1100)]
Zero slashes should be impossible here.

4 years agoAdd a harness for fuzzing make_safe_uri()
Emil Mikulic [Thu, 1 Jan 2015 07:14:28 +0000 (18:14 +1100)]
Add a harness for fuzzing make_safe_uri()

4 years agocp test_make_safe_uri.c fuzz_make_safe_uri.c
Emil Mikulic [Thu, 1 Jan 2015 06:10:47 +0000 (17:10 +1100)]
cp test_make_safe_uri.c fuzz_make_safe_uri.c

5 years ago[ darkhttpd 1.10 release ]
Emil Mikulic [Mon, 26 May 2014 12:07:59 +0000 (22:07 +1000)]
[ darkhttpd 1.10 release ]

5 years agoAdd test for urldecode()
Emil Mikulic [Mon, 26 May 2014 12:01:22 +0000 (22:01 +1000)]
Add test for urldecode()

5 years agoprintf [s]size_t as %z[du].
Emil Mikulic [Mon, 26 May 2014 11:56:45 +0000 (21:56 +1000)]
printf [s]size_t as %z[du].

5 years agocppcheck: use --force to check all #ifdef configurations.
Emil Mikulic [Mon, 26 May 2014 11:56:29 +0000 (21:56 +1000)]
cppcheck: use --force to check all #ifdef configurations.

5 years agoRemove query params.
Emil Mikulic [Mon, 26 May 2014 11:36:29 +0000 (21:36 +1000)]
Remove query params.

Reported by: James Antill
https://bugzilla.redhat.com/show_bug.cgi?id=1099199

5 years agoMark cppcheck executable.
Emil Mikulic [Fri, 14 Mar 2014 11:51:43 +0000 (22:51 +1100)]
Mark cppcheck executable.

5 years agoRun test_make_safe_uri. Retire broken run-tests.sh
Emil Mikulic [Fri, 14 Mar 2014 11:50:44 +0000 (22:50 +1100)]
Run test_make_safe_uri.  Retire broken run-tests.sh

5 years agoSilence warning about unused arg.
Emil Mikulic [Fri, 14 Mar 2014 11:45:39 +0000 (22:45 +1100)]
Silence warning about unused arg.

5 years agoRetab README. No content changes.
Emil Mikulic [Fri, 14 Mar 2014 11:43:46 +0000 (22:43 +1100)]
Retab README.  No content changes.

5 years agoAdd .gitignore.
Christian Hesse [Thu, 2 May 2013 11:47:59 +0000 (13:47 +0200)]
Add .gitignore.

Stop git complaining about untracked file darkhttpd.

5 years agoImplement --forward-all to forward all requests to a given url.
Emil Mikulic [Fri, 14 Mar 2014 11:36:37 +0000 (22:36 +1100)]
Implement --forward-all to forward all requests to a given url.

Suggested and initially implemented by: Christian Hesse <mail@eworm.de>

5 years agontohs() when reporting the port number.
Emil Mikulic [Fri, 14 Mar 2014 11:12:25 +0000 (22:12 +1100)]
ntohs() when reporting the port number.

Re-use addrin when fetching the port number.

5 years agoexit cleanly for `--help`
Lukas Stabe [Wed, 5 Feb 2014 22:49:09 +0000 (23:49 +0100)]
exit cleanly for `--help`

5 years agodocument port 0 == random available
Lukas Stabe [Wed, 29 Jan 2014 16:53:30 +0000 (17:53 +0100)]
document port 0 == random available

5 years agodisplay actual port and address
Lukas Stabe [Wed, 29 Jan 2014 16:32:47 +0000 (17:32 +0100)]
display actual port and address

5 years agoDon't fprintf() inside signal handler, mark running as volatile.
Emil Mikulic [Thu, 13 Mar 2014 13:02:54 +0000 (00:02 +1100)]
Don't fprintf() inside signal handler, mark running as volatile.

5 years agoAdd script to run cppcheck.
Emil Mikulic [Tue, 7 Jan 2014 15:05:00 +0000 (02:05 +1100)]
Add script to run cppcheck.

5 years agoMore cppcheck nits.
Emil Mikulic [Tue, 7 Jan 2014 15:01:00 +0000 (02:01 +1100)]
More cppcheck nits.

5 years agoReduce variable scope to make cppcheck happy.
Emil Mikulic [Tue, 7 Jan 2014 14:55:12 +0000 (01:55 +1100)]
Reduce variable scope to make cppcheck happy.

6 years agoAdd test for --mimetypes
Emil Mikulic [Mon, 10 Jun 2013 10:41:46 +0000 (20:41 +1000)]
Add test for --mimetypes

6 years agoAdd test to exercise memove() in make_safe_url()
Emil Mikulic [Mon, 10 Jun 2013 09:26:25 +0000 (19:26 +1000)]
Add test to exercise memove() in make_safe_url()

6 years agoREADME: update default port.
Emil Mikulic [Mon, 10 Jun 2013 08:59:55 +0000 (18:59 +1000)]
README: update default port.

6 years agoFix file_exists() comparison.
Emil Mikulic [Mon, 10 Jun 2013 08:56:14 +0000 (18:56 +1000)]
Fix file_exists() comparison.

Found with: git://repo.or.cz/smatch.git

6 years agoMakefile: move .PHONY to the end.
Emil Mikulic [Mon, 10 Jun 2013 08:53:19 +0000 (18:53 +1000)]
Makefile: move .PHONY to the end.

6 years agoTests: add pointer to cover script which runs them.
Emil Mikulic [Mon, 10 Jun 2013 08:52:38 +0000 (18:52 +1000)]
Tests: add pointer to cover script which runs them.

6 years ago[ darkhttpd-1.9 release ]
Emil Mikulic [Sun, 28 Apr 2013 15:06:31 +0000 (01:06 +1000)]
[ darkhttpd-1.9 release ]

Add release script.

6 years agoOptimization for case when no web forward is configured.
Egor Ivanov [Tue, 23 Apr 2013 16:31:21 +0000 (20:31 +0400)]
Optimization for case when no web forward is configured.

6 years agoImplement --no-server-id
Emil Mikulic [Sun, 28 Apr 2013 14:55:08 +0000 (00:55 +1000)]
Implement --no-server-id

Suggested by: T.Ramirez

6 years agoAdd test for --forward
Emil Mikulic [Sun, 28 Apr 2013 14:31:54 +0000 (00:31 +1000)]
Add test for --forward

6 years agoChange web_forward_record from a hand-rolled linked list to an array.
Emil Mikulic [Sun, 28 Apr 2013 13:48:16 +0000 (23:48 +1000)]
Change web_forward_record from a hand-rolled linked list to an array.

Free it before exiting.

6 years agoImplement --forward.
Egor Ivanov [Sat, 20 Apr 2013 10:05:27 +0000 (14:05 +0400)]
Implement --forward.

A web forward feature that performs 301 redirects for some requests
(in addition normal web content serving)

The "Host:" request header (HTTP/1.1 only) is compared with a list of
hosts, defined by the "--forward host url" option. If a match is found,
the request is redirected to url+path. Otherwise, it is served as a
request to the local file system.

6 years agoMake devel/cover clean up after itself.
Emil Mikulic [Sun, 28 Apr 2013 11:45:14 +0000 (21:45 +1000)]
Make devel/cover clean up after itself.

6 years agoFix memory leak when diropen() fails.
Emil Mikulic [Sun, 28 Apr 2013 11:39:43 +0000 (21:39 +1000)]
Fix memory leak when diropen() fails.

Found by: clang static analyzer.

6 years agoMake sure malloc and realloc can't be called with size 0.
Emil Mikulic [Sun, 28 Apr 2013 11:37:31 +0000 (21:37 +1000)]
Make sure malloc and realloc can't be called with size 0.

Make pool size double instead of increment in make_sorted_dirlist().

Prompted by: clang static analyzer.

6 years agoFix warnings found by clang r180088.
Emil Mikulic [Sun, 28 Apr 2013 11:24:33 +0000 (21:24 +1000)]
Fix warnings found by clang r180088.

6 years agoClean up and improve the devel/ scripts.
Emil Mikulic [Sun, 28 Apr 2013 11:16:40 +0000 (21:16 +1000)]
Clean up and improve the devel/ scripts.

6 years agoPut project page and contact address into comments.
Emil Mikulic [Sun, 28 Apr 2013 11:03:29 +0000 (21:03 +1000)]
Put project page and contact address into comments.

6 years agoMake keep_alive() a tiny function instead of a macro.
Emil Mikulic [Sun, 28 Apr 2013 11:01:31 +0000 (21:01 +1000)]
Make keep_alive() a tiny function instead of a macro.

6 years agoImplement --no-keepalive.
Emil Mikulic [Mon, 28 May 2012 10:33:52 +0000 (20:33 +1000)]
Implement --no-keepalive.

Requested by: Devin LaSalle