darkhttpd
5 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>
5 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>
5 years ago[ darkhttpd 1.11 release ]
Emil Mikulic [Thu, 1 Jan 2015 11:42:44 +0000 (22:42 +1100)]
[ darkhttpd 1.11 release ]

5 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.

5 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

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

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

5 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).

5 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().

5 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.

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

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

5 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().

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

5 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.

5 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()

5 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

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

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

6 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].

6 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.

6 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

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

6 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

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

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

6 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.

6 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>

6 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.

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

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

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

6 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.

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

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

6 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.

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

7 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()

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

7 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

7 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.

7 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.

7 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.

7 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.

7 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

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

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

7 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.

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

Requested by: Devin LaSalle

7 years agoFix for when MAXNAMLEN is not found (Android)
Vlatko Kosturjak [Wed, 30 Jun 2010 22:21:35 +0000 (00:21 +0200)]
Fix for when MAXNAMLEN is not found (Android)

7 years ago[ darkhttpd-1.8 release ]
Emil Mikulic [Tue, 3 May 2011 10:53:50 +0000 (20:53 +1000)]
[ darkhttpd-1.8 release ]

printf format fixes from FreeBSD 8.2 (gcc version 4.2.1)

7 years agoAdd guard around __printflike
Emil Mikulic [Tue, 3 May 2011 10:50:31 +0000 (20:50 +1000)]
Add guard around __printflike

7 years agoTest large (>2G, >4G) files.
Emil Mikulic [Tue, 3 May 2011 10:43:04 +0000 (20:43 +1000)]
Test large (>2G, >4G) files.

7 years agoRun usage, not really a test.
Emil Mikulic [Tue, 3 May 2011 10:14:10 +0000 (20:14 +1000)]
Run usage, not really a test.

7 years agoCheck dependencies in devel/cover
Emil Mikulic [Tue, 3 May 2011 10:11:09 +0000 (20:11 +1000)]
Check dependencies in devel/cover

7 years agoBring preprocessor directives in line.
Emil Mikulic [Sun, 1 May 2011 09:29:13 +0000 (19:29 +1000)]
Bring preprocessor directives in line.

7 years agoDon't catch SIGQUIT.
Emil Mikulic [Sun, 1 May 2011 09:25:14 +0000 (19:25 +1000)]
Don't catch SIGQUIT.

I'm okay with this being more fatal.

7 years agoRe-arrange usage().
Emil Mikulic [Sun, 1 May 2011 09:24:31 +0000 (19:24 +1000)]
Re-arrange usage().

7 years agoSingle byte corner cases.
Emil Mikulic [Sun, 1 May 2011 09:19:39 +0000 (19:19 +1000)]
Single byte corner cases.

7 years agoTest directory redirect.
Emil Mikulic [Sun, 1 May 2011 09:13:25 +0000 (19:13 +1000)]
Test directory redirect.

7 years agoImprove handling of invalid ranges.
Emil Mikulic [Sun, 1 May 2011 09:08:29 +0000 (19:08 +1000)]
Improve handling of invalid ranges.

7 years agoStill more range test fiddling.
Emil Mikulic [Sun, 1 May 2011 09:08:12 +0000 (19:08 +1000)]
Still more range test fiddling.

7 years agoAdd test for backwards range.
Emil Mikulic [Sun, 1 May 2011 08:56:04 +0000 (18:56 +1000)]
Add test for backwards range.

7 years agoPassing bad-end range test.
Emil Mikulic [Sun, 1 May 2011 08:54:06 +0000 (18:54 +1000)]
Passing bad-end range test.

7 years agoTest range requests, including one failing test.
Emil Mikulic [Sun, 1 May 2011 08:49:18 +0000 (18:49 +1000)]
Test range requests, including one failing test.

7 years agoAdvertise that we accept ranges.
Emil Mikulic [Sun, 1 May 2011 08:43:14 +0000 (18:43 +1000)]
Advertise that we accept ranges.

7 years agoRemove unnecessary headers from 304 reply.
Emil Mikulic [Sun, 1 May 2011 08:26:33 +0000 (18:26 +1000)]
Remove unnecessary headers from 304 reply.

7 years agoFailing test for If-Modified-Since
Emil Mikulic [Sun, 1 May 2011 08:20:26 +0000 (18:20 +1000)]
Failing test for If-Modified-Since

7 years agoTest for HEAD method.
Emil Mikulic [Sun, 1 May 2011 08:15:56 +0000 (18:15 +1000)]
Test for HEAD method.

7 years agoImplement straightforward GET test.
Emil Mikulic [Sun, 1 May 2011 08:13:41 +0000 (18:13 +1000)]
Implement straightforward GET test.

7 years agoUse setUp and tearDown to manage test file.
Emil Mikulic [Sun, 17 Apr 2011 09:01:52 +0000 (19:01 +1000)]
Use setUp and tearDown to manage test file.

7 years agoRe-arrange tests, no functional change.
Emil Mikulic [Sun, 17 Apr 2011 09:00:04 +0000 (19:00 +1000)]
Re-arrange tests, no functional change.

7 years agoImprove "caught Terminated" output.
Emil Mikulic [Sun, 17 Apr 2011 07:34:14 +0000 (17:34 +1000)]
Improve "caught Terminated" output.

7 years agoparse_field() was looking for \r instead of [\r\n]
Emil Mikulic [Sun, 17 Apr 2011 07:00:02 +0000 (17:00 +1000)]
parse_field() was looking for \r instead of [\r\n]

7 years agoWhen logging, escape strings.
Emil Mikulic [Sun, 17 Apr 2011 06:47:09 +0000 (16:47 +1000)]
When logging, escape strings.

While I'm here, rename urlencode[_filename]() and improve it.

7 years agoOops, wrong kind of line ending.
Emil Mikulic [Sat, 16 Apr 2011 09:57:00 +0000 (19:57 +1000)]
Oops, wrong kind of line ending.

Also, enforce Connection:close since the test harness doesn't
handle keep-alive.

7 years agoTest URL escaping in directory listing.
Emil Mikulic [Sat, 16 Apr 2011 09:27:06 +0000 (19:27 +1000)]
Test URL escaping in directory listing.

7 years agoDon't log to stdout when testing.
Emil Mikulic [Sat, 16 Apr 2011 09:15:32 +0000 (19:15 +1000)]
Don't log to stdout when testing.

7 years agoLog to stdout by default.
Emil Mikulic [Sat, 16 Apr 2011 09:14:06 +0000 (19:14 +1000)]
Log to stdout by default.

7 years agoPrint "listening on" as a URL.
Emil Mikulic [Sat, 16 Apr 2011 09:08:31 +0000 (19:08 +1000)]
Print "listening on" as a URL.

7 years agoDefault to --port 8080, or 80 if running as root.
Emil Mikulic [Sat, 16 Apr 2011 09:07:57 +0000 (19:07 +1000)]
Default to --port 8080, or 80 if running as root.

7 years agouri -> url
Emil Mikulic [Sat, 16 Apr 2011 08:52:53 +0000 (18:52 +1000)]
uri -> url

7 years agoUpdate AUTHORS.
Emil Mikulic [Sat, 16 Apr 2011 08:38:39 +0000 (18:38 +1000)]
Update AUTHORS.

7 years agoAccept \n as line ending when parsing URL.
Emil Mikulic [Tue, 18 Jan 2011 14:11:43 +0000 (01:11 +1100)]
Accept \n as line ending when parsing URL.

This fixes "HTTP 0.9" requests.

7 years agoFix include path.
Emil Mikulic [Tue, 18 Jan 2011 13:48:59 +0000 (00:48 +1100)]
Fix include path.

7 years agoPrint more quotes.
Emil Mikulic [Tue, 18 Jan 2011 13:47:18 +0000 (00:47 +1100)]
Print more quotes.

7 years agoAllow running of individual tests from cmdline.
Emil Mikulic [Tue, 18 Jan 2011 13:44:15 +0000 (00:44 +1100)]
Allow running of individual tests from cmdline.

7 years agoMake devel/test.py shorter.
Emil Mikulic [Tue, 18 Jan 2011 13:26:13 +0000 (00:26 +1100)]
Make devel/test.py shorter.

7 years agoMake devel/test.py less repetitive.
Emil Mikulic [Mon, 17 Jan 2011 13:51:56 +0000 (00:51 +1100)]
Make devel/test.py less repetitive.

7 years agoAdd coverage driver.
Emil Mikulic [Mon, 17 Jan 2011 12:59:41 +0000 (23:59 +1100)]
Add coverage driver.

7 years agoMore tests.
Emil Mikulic [Mon, 17 Jan 2011 12:59:33 +0000 (23:59 +1100)]
More tests.

7 years agoWorking on unit tests.
Emil Mikulic [Mon, 17 Jan 2011 12:44:02 +0000 (23:44 +1100)]
Working on unit tests.

7 years agoFor developers: script to run through clang static analyzer.
Emil Mikulic [Sat, 15 Jan 2011 09:56:30 +0000 (20:56 +1100)]
For developers: script to run through clang static analyzer.