Emil Mikulic [Thu, 1 Mar 2012 09:59:12 +0000 (20:59 +1100)]
Cosmetic: capitalize.
Emil Mikulic [Thu, 1 Mar 2012 09:58:58 +0000 (20:58 +1100)]
Improve error message when binding http port.
Emil Mikulic [Thu, 1 Mar 2012 09:33:22 +0000 (20:33 +1100)]
We don't use inet_aton anymore, drop the <arpa/inet.h> includes.
Emil Mikulic [Thu, 1 Mar 2012 09:32:24 +0000 (20:32 +1100)]
Look for hstrerror in -lresolv.
Suggested by: Bernd Schemmer, for Solaris 10
Emil Mikulic [Thu, 1 Mar 2012 09:24:12 +0000 (20:24 +1100)]
Drop -Wlong-long
Emil Mikulic [Thu, 1 Mar 2012 09:20:06 +0000 (20:20 +1100)]
Turn a switch() with no default case into an explicit if+assert.
Emil Mikulic [Thu, 1 Mar 2012 09:19:49 +0000 (20:19 +1100)]
Include bsd/{string,unistd}.h if present.
Emil Mikulic [Mon, 23 Jan 2012 03:47:27 +0000 (19:47 -0800)]
Update ChangeLog for darkstat 3.0.715
Emil Mikulic [Mon, 23 Jan 2012 02:53:44 +0000 (18:53 -0800)]
Make decode_null separate from decode_loop.
This fixes OpenBSD storing family in host-order in the null case.
Emil Mikulic [Mon, 23 Jan 2012 01:52:50 +0000 (17:52 -0800)]
More diagnostics when socket() fails.
Emil Mikulic [Mon, 12 Sep 2011 10:45:55 +0000 (20:45 +1000)]
Detection of multicast IPv4 addresses was looking at the wrong end.
Emil Mikulic [Sun, 11 Sep 2011 10:30:41 +0000 (20:30 +1000)]
Fall back to gethostbyaddr() If getnameinfo() fails.
Original patch from: Shaun Wallace
Emil Mikulic [Sun, 17 Jul 2011 05:50:08 +0000 (15:50 +1000)]
Make failure to get localip non-fatal.
Emil Mikulic [Sun, 17 Jul 2011 05:37:03 +0000 (15:37 +1000)]
Simplify HAVE_ vs HAVE_REAL_
Emil Mikulic [Sun, 17 Jul 2011 05:06:42 +0000 (15:06 +1000)]
Close unlikely race: don't reset before export.
Emil Mikulic [Sun, 17 Jul 2011 05:01:35 +0000 (15:01 +1000)]
ifa_addr can be NULL.
Emil Mikulic [Sun, 17 Jul 2011 04:51:37 +0000 (14:51 +1000)]
Implement --local-only
I've had a couple of requests for restricting accounting to the local net.
Emil Mikulic [Sun, 26 Jun 2011 12:18:10 +0000 (22:18 +1000)]
Split out newer GCC warning flags into a separate check.
FreeBSD's system compiler is too old to recognize them.
Malte S. Stretz [Wed, 22 Jun 2011 20:27:53 +0000 (22:27 +0200)]
Bail out early if the request is too large.
There is no point parsing the request first.
Malte S. Stretz [Wed, 22 Jun 2011 20:23:58 +0000 (22:23 +0200)]
Remove an unnecessary define.
Malte S. Stretz [Wed, 22 Jun 2011 20:21:33 +0000 (22:21 +0200)]
Some small free() fixups.
* No need to check for NULL before free().
* Early free() conn->request in the same function where it was
allocated.
Emil Mikulic [Sun, 26 Jun 2011 06:56:20 +0000 (16:56 +1000)]
Fix up includes.
Malte S. Stretz [Mon, 20 Jun 2011 13:32:52 +0000 (15:32 +0200)]
Move *BSD compatibility layer to extra file.
This makes it easier to silence some warnings.
Malte S. Stretz [Mon, 20 Jun 2011 14:01:36 +0000 (16:01 +0200)]
Fix up pretty printing.
* Add *_HOSTCC, *_LINK and *_CIFY macros to avoid confusion.
* Move cruft to the bottom where nobody sees it.
Emil Mikulic [Tue, 21 Jun 2011 12:38:13 +0000 (22:38 +1000)]
Only update lastseen time for sender, not recipient.
Suggested by: Madhu
Emil Mikulic [Tue, 21 Jun 2011 12:33:24 +0000 (22:33 +1000)]
last_seen -> lastseen, for consistency.
Emil Mikulic [Tue, 21 Jun 2011 10:15:55 +0000 (20:15 +1000)]
Make bind() failure nonfatal.
Malte S. Stretz [Thu, 9 Jun 2011 14:05:43 +0000 (16:05 +0200)]
Tune version/usage output.
Emil Mikulic [Mon, 20 Jun 2011 13:17:32 +0000 (23:17 +1000)]
Abort release if there are uncommitted changes.
Emil Mikulic [Mon, 20 Jun 2011 13:12:24 +0000 (23:12 +1000)]
Make test_headers return an appropriate exit code.
Emil Mikulic [Mon, 20 Jun 2011 13:01:40 +0000 (23:01 +1000)]
Fix release.sh order.
Run test_headers after getting an up-to-date config.h
Emil Mikulic [Mon, 20 Jun 2011 12:46:15 +0000 (22:46 +1000)]
Restore pre-IPv6 localip_update() code for systems without ifaddrs.h
Requested by: Prof Abimbola Olowofoyeku for Routertech (uses uclibc)
Emil Mikulic [Mon, 20 Jun 2011 12:28:05 +0000 (22:28 +1000)]
Improve test_headers.sh: MIN shouldn't match RB_MIN
Malte S. Stretz [Thu, 9 Jun 2011 13:00:17 +0000 (15:00 +0200)]
Explicitly enable IPV6_V6ONLY.
It defaults to off on Linux and on on BSD. Except when it doesn't.
See also <http://www.ipv6style.jp/en/apps/
20030829/index.shtml>.
I'd vote for disabling it instead. But: OpenBSD doesn't allow this
since is so utterly insecure... dude... just get off my lawn.
See also <http://utcc.utoronto.ca/~cks/space/blog/linux/Ipv6DualBinding>
Emil Mikulic [Mon, 20 Jun 2011 12:17:14 +0000 (22:17 +1000)]
Implement automake-style silent-rules
Prompted by: Malte S. Stretz
Malte S. Stretz [Tue, 14 Jun 2011 09:00:43 +0000 (11:00 +0200)]
Enable link-time optimization.
Results in a 15% smaller (and probably quicker) binary.
Malte S. Stretz [Tue, 31 May 2011 23:45:26 +0000 (01:45 +0200)]
Suppress a printf warning by using the proper format.
Malte S. Stretz [Thu, 9 Jun 2011 14:42:41 +0000 (16:42 +0200)]
Mark MIN and MAX as macros as they have side effects.
Emil Mikulic [Mon, 20 Jun 2011 10:50:17 +0000 (20:50 +1000)]
s6_addr32 compatibility for OpenSolaris
Submitted by: Mats Erik Andersson
Reminded by: Bernd Schemmer
Emil Mikulic [Thu, 9 Jun 2011 12:21:10 +0000 (22:21 +1000)]
Use strtol instead of strtonum.
Emil Mikulic [Thu, 9 Jun 2011 12:10:35 +0000 (22:10 +1000)]
Explain Linux workaround for binding to all addresses.
Requested by: Malte S. Stretz
Emil Mikulic [Thu, 9 Jun 2011 11:55:22 +0000 (21:55 +1000)]
Don't use AI_ADDRCONFIG.
Malte says without this:
It fails with "Address family for hostname not supported: Device or
resource busy" if IPv6 is requested (eg. if no bind address was
specified under Linux) but no interface has IPv6 configured (::1/128
and fe80::/64 do not count).
Malte S. Stretz [Wed, 8 Jun 2011 12:33:59 +0000 (14:33 +0200)]
Add license blurb to darkproxy.php.
Feel free to do whatever you like with this trivial code.
Malte S. Stretz [Tue, 31 May 2011 10:26:05 +0000 (12:26 +0200)]
Clean up Makefile.in to simplify future patching.
* Add STATICHS macro.
* Split clean rule.
* Mark phony targets.
Malte S. Stretz [Fri, 3 Sep 2010 09:07:31 +0000 (11:07 +0200)]
Ignore release files.
Malte S. Stretz [Fri, 3 Sep 2010 09:37:31 +0000 (11:37 +0200)]
Fix file name in comment.
Emil Mikulic [Thu, 9 Jun 2011 11:34:07 +0000 (21:34 +1000)]
Max domain name length is 255, not MAXHOSTNAMELEN
This should fix a build failure on Hurd (!)
Thanks to: Rene Mayorga and the Debian project.
Emil Mikulic [Mon, 6 Jun 2011 10:47:56 +0000 (20:47 +1000)]
Whoops, I included sys/types in the wrong file.
Suggested by: Chris Kuethe
Emil Mikulic [Sat, 4 Jun 2011 14:17:52 +0000 (00:17 +1000)]
Update ChangeLog.
Emil Mikulic [Sun, 15 May 2011 12:44:44 +0000 (22:44 +1000)]
make depend
Emil Mikulic [Sat, 4 Jun 2011 13:58:37 +0000 (23:58 +1000)]
Automate release more - run test, make depend.
Also, use "tar chof" to get ustar format.
Malte S. Stretz [Wed, 1 Jun 2011 11:31:53 +0000 (13:31 +0200)]
Update date in manpage.
Emil Mikulic [Sat, 4 Jun 2011 13:29:32 +0000 (23:29 +1000)]
Bump copyright years.
Emil Mikulic [Sat, 4 Jun 2011 13:18:05 +0000 (23:18 +1000)]
Homepage is moving to a sillier domain.
Emil Mikulic [Sat, 4 Jun 2011 12:58:23 +0000 (22:58 +1000)]
Factor and add checks for cdefs.h
Emil Mikulic [Sat, 4 Jun 2011 12:58:29 +0000 (22:58 +1000)]
Remove includes of darkstat.h, add cdefs.h where needed.
Emil Mikulic [Sat, 4 Jun 2011 13:00:37 +0000 (23:00 +1000)]
cp darkstat.h cdefs.h
Emil Mikulic [Sat, 4 Jun 2011 12:40:35 +0000 (22:40 +1000)]
Fix warnings.
Emil Mikulic [Sat, 4 Jun 2011 10:21:56 +0000 (20:21 +1000)]
Use multiple listening sockets, allow multiple bindaddrs.
Emil Mikulic [Sat, 4 Jun 2011 11:31:40 +0000 (21:31 +1000)]
Be explicit that per-host pages are directories.
Browsers get confused by double colons in v6 addresses.
Malte S. Stretz [Wed, 1 Jun 2011 15:44:57 +0000 (17:44 +0200)]
Add missing opt.h to release script.
Emil Mikulic [Sat, 4 Jun 2011 08:21:43 +0000 (18:21 +1000)]
Remove unnecessary header sentinel.
Malte S. Stretz [Wed, 1 Jun 2011 11:30:13 +0000 (13:30 +0200)]
Replace the --base code with relative paths.
Most of the functionality turned out to be overkill since
relative paths work fine, too. The only broken thing is
lighttpd 1.4 which doesn't support proxying of stuff like
/darkstat/ -> http://localhost:667/
But this will be fixed properly in mod_proxy_core in 1.5
once (if ever) it is released.
Malte S. Stretz [Tue, 31 May 2011 23:01:10 +0000 (01:01 +0200)]
Avoid linking against nsl and resolv unless required.
Malte S. Stretz [Tue, 31 May 2011 22:08:40 +0000 (00:08 +0200)]
libbsd provides (a stub for) setproctitle, too.
Emil Mikulic [Sat, 4 Jun 2011 07:59:33 +0000 (17:59 +1000)]
Check for missing and extraneous config.h includes.
Emil Mikulic [Sat, 4 Jun 2011 07:52:59 +0000 (17:52 +1000)]
Make test_headers more automatic.
Also make the output prettier.
Emil Mikulic [Sat, 4 Jun 2011 06:21:47 +0000 (16:21 +1000)]
Include config.h explicitly.
Emil Mikulic [Sat, 4 Jun 2011 06:06:20 +0000 (16:06 +1000)]
Include opt.h explicitly.
Malte S. Stretz [Tue, 31 May 2011 13:27:18 +0000 (15:27 +0200)]
Drop interface from html_open, use global opt_interface.
Malte S. Stretz [Tue, 31 May 2011 13:22:49 +0000 (15:22 +0200)]
Prefix all global variables to aid debugging.
* Also move all options which are set in darkstat.c to a new
header opt.h and prefix options with opt_.
* Declare all opt_* stuff in darkstat.c.
* Prefix globals from acct.c with acct_.
* Prefix globals from cap.c with cap_.
* Prefix globals from hosts_db.c with hosts_db_.
* Prefix globals from http.c with http_.
Malte S. Stretz [Thu, 2 Sep 2010 21:52:58 +0000 (23:52 +0200)]
Rename str_append2() to str_appendn().
Clearifies the difference to str_append (ie. append n bytes), mnemonic:
str_appendn is to str_append what strncat is to strcat.
Emil Mikulic [Mon, 30 May 2011 11:44:32 +0000 (21:44 +1000)]
Change example to discourage use of hyphen (-rc1)
Ports doesn't like hyphens there.
Emil Mikulic [Mon, 30 May 2011 11:38:10 +0000 (21:38 +1000)]
Use PACKAGE_URL.
- Use PACKAGE_strings directly instead of through %s indirection.
- Reduce duplication by removing URL from AUTHORS and README.
Malte S. Stretz [Fri, 3 Sep 2010 09:06:23 +0000 (11:06 +0200)]
Add homepage URL to AC_INIT.
This sets PACKAGE_URL in config.h.
Malte S. Stretz [Fri, 3 Sep 2010 09:05:25 +0000 (11:05 +0200)]
Use sed to set the version number.
Malte S. Stretz [Fri, 3 Sep 2010 09:04:31 +0000 (11:04 +0200)]
Use separate output function, fix eval.
Emil Mikulic [Mon, 30 May 2011 11:29:22 +0000 (21:29 +1000)]
Add sys/types.h includes for OpenBSD.
Suggested by: Chris Kuethe
Emil Mikulic [Sun, 29 May 2011 05:15:59 +0000 (15:15 +1000)]
Simplify how the http socket is bound.
- Use dual-stack socket for wildcard.
- Sadly, AI_V4MAPPED doesn't work on FreeBSD 8.2
Emil Mikulic [Tue, 24 May 2011 12:29:38 +0000 (22:29 +1000)]
Retire DARKSTAT_USES_HOSTENT conditional code.
Emil Mikulic [Mon, 23 May 2011 13:50:07 +0000 (23:50 +1000)]
Show base_url in "listening on" output.
Emil Mikulic [Mon, 23 May 2011 13:44:52 +0000 (23:44 +1000)]
Put fewer slashes into the slashed_url.
Emil Mikulic [Sun, 15 May 2011 14:16:28 +0000 (00:16 +1000)]
Add addr module and autogenerated files to release tarball.
Emil Mikulic [Sun, 15 May 2011 14:00:59 +0000 (00:00 +1000)]
reply_sent is zero in poll_send_header_and_reply
Found by: Clang Static Analyzer
Emil Mikulic [Sun, 15 May 2011 13:38:34 +0000 (23:38 +1000)]
Format string fixes, problem caught by _printflike_
Emil Mikulic [Sun, 15 May 2011 13:04:39 +0000 (23:04 +1000)]
Fix warnings, bring in restrict keyword, modernize strl{cpy,cat}
Emil Mikulic [Sun, 15 May 2011 12:32:10 +0000 (22:32 +1000)]
Handle getnameinfo() failing in timeout code.
Emil Mikulic [Sun, 15 May 2011 12:12:08 +0000 (22:12 +1000)]
Portability fixes for FreeBSD - include the right headers.
Emil Mikulic [Sun, 15 May 2011 12:40:01 +0000 (22:40 +1000)]
Clean up un-needed date variables, include str.
Emil Mikulic [Sun, 15 May 2011 10:25:55 +0000 (20:25 +1000)]
Don't leak base_url memory.
Emil Mikulic [Sun, 15 May 2011 10:15:36 +0000 (20:15 +1000)]
Fixes for non-default base_url.
* use relative path to graphs.xml
* use correct absolute path for hosts
(relative paths are confused by colons in IPv6 addresses)
Emil Mikulic [Sun, 15 May 2011 10:01:38 +0000 (20:01 +1000)]
Remove headers callback and tidy up html module a bit.
Emil Mikulic [Sun, 15 May 2011 09:47:18 +0000 (19:47 +1000)]
Add Dirk and Mats to AUTHORS.
Emil Mikulic [Sun, 15 May 2011 09:43:35 +0000 (19:43 +1000)]
Drop XHTML.
We never served it with the right content-type anyway.
Emil Mikulic [Sun, 15 May 2011 09:34:28 +0000 (19:34 +1000)]
Fix up includes in html.c
Malte S. Stretz [Wed, 1 Sep 2010 11:48:28 +0000 (13:48 +0200)]
Avoid indexing of darkstat pages.
The data displayed by darkstat is probably not something which you want
to appear on Google and friends. Just have a try:
http://www.google.com/search?q=intitle:darkstat+inurl:666
http://www.google.com/search?q=intitle:darkstat+inurl:667
Malte S. Stretz [Wed, 1 Sep 2010 11:43:05 +0000 (13:43 +0200)]
Fix a memory leak triggered by 404s.
Malte S. Stretz [Wed, 1 Sep 2010 11:40:15 +0000 (13:40 +0200)]
Consolidate HTTP header generation.
Always sending a Content-Encoding (with the value "identity" if
uncompressed) and a Vary doesn't really hurt but allows for cleaner
header generation code (and less duplication).
All we lose is the date on the error messages since I wanted to avoid to
format the date twice.
Malte S. Stretz [Wed, 1 Sep 2010 11:31:06 +0000 (13:31 +0200)]
Introducing the --base switch to modify the base URL.
The --base option (defaulting to "/") essentially configures the
base_url in http.c which was introduced previously. Now darkstat works
without too much magic behind a reverse proxy.
My mod_proxy config changed from
ProxyPass /darkstat http://localhost:666
<Location /darkstat/>
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /darkstat/
RequestHeader unset Accept-Encoding
</Location>
Redirect permanent /graphs.xml /darkstat/graphs.xml
to the simpler
ProxyPass /darkstat/ http://localhost:666/darkstat/
ProxyPassReverse /darkstat/ http://localhost:666/darkstat/
(the ProxyPassReverse isn't even needed since darkstat doesn't generate
any Location headers).
Malte S. Stretz [Wed, 1 Sep 2010 11:19:05 +0000 (13:19 +0200)]
Make HTML template more flexible.
Preparation for URI base feature. It is a little bit more overhead than
just appending constant strings, but I doubt it is measurable. Also, it
unifies the appearance a bit more since the <title> etc. is now also
generated by html_open() instead differently in each page generator.